Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[minor] Add Property primitive operations, starting with integer addition. #168

Merged
merged 4 commits into from
Feb 9, 2024

Conversation

mikeurbach
Copy link
Collaborator

This adds prose to the Expressions section introducing the concept of
primitive Property operations, adds a new section defining the
primitive Property operations, and adds primitive Property operations
to the grammar.

As a concrete example, integer addition is included.

…tion.

This adds prose to the Expressions section introducing the concept of
primitive Property operations, adds a new section defining the
primitive Property operations, and adds primitive Property operations
to the grammar.

As a concrete example, integer addition is included.
@mikeurbach
Copy link
Collaborator Author

I tried to follow very closely the language, structure, and grammar that we are using when describing the other primitive operations on ground types. Please let me know what you think.

spec.md Outdated
@@ -3459,6 +3498,9 @@ primop_1expr = primop_1expr_keyword , "(" , expr , ")" ;
primop_1expr1int = primop_1expr1int_keyword , "(", expr , "," , int , ")" ;
primop_1expr2int = primop_1expr2int_keyword , "(" , expr , "," , int , "," , int , ")" ;

(* Primitive Property Operations *)
property_primop_2expr = property_primop_2expr_keyword , "(" , property_expr , "," , property_expr ")" ;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm in the rendered PDF this overflows... I will try breaking this differently.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes... the grammar is verbatim and you have to do some manual reflowing to get things to fit. There are other examples of manual breaking in the grammar where this happens.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated slightly, this is what I went with.
Screen Shot 2024-02-08 at 5 19 07 PM

Open to other indentation ideas.

Copy link
Collaborator

@mwachs5 mwachs5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This is beginning to motivate prefixes on the hardware operations, e.g., hw_add. 🧐

spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
@@ -2450,6 +2450,26 @@ asClock(x)

[@sec:primitive-operations] will describe the format and semantics of each primitive operation.

## Primitive Property Operations {#sec:expressions:primitive-property-operations}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's kind of unfortunate that the PR has to go through this just because two different subsections have the same name. I should see if there is a pandoc option to do this automatically.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I just sort of followed how HW primitives do it--both naming the subsection the same as the section, and using these anchors to disambiguate. If there is a better option with pandoc, happy to use that.

@mikeurbach
Copy link
Collaborator Author

This is beginning to motivate prefixes on the hardware operations, e.g., hw_add. 🧐

Hmm, yeah maybe. I don't know if we need to update the original primitives, but I think the type prefix is good for the new ones (e.g., integer_add, list_create, etc.).

@mikeurbach mikeurbach merged commit ca58304 into main Feb 9, 2024
1 check passed
@mikeurbach mikeurbach deleted the mikeurbach/property-integer-arithmetic-add branch February 9, 2024 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants