-
Notifications
You must be signed in to change notification settings - Fork 7
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
docs: update spec for Row Variables and no-input-extensions #1402
Conversation
@@ -791,15 +791,16 @@ There are two classes of type: `AnyType` $\supset$ `CopyableType`. Types in thes | |||
classes are distinguished by whether the runtime values of those types can be implicitly | |||
copied or discarded (multiple or 0 links from on output port respectively): | |||
|
|||
- For the broadest class (`AnyType`), the only operation supported is the identity operation (aka no-op, or `lift` - see [Extension Tracking](#extension-tracking) below). Specifically, we do not require it to be possible to copy or discard all values, hence the requirement that outports of linear type must have exactly one edge. (That is, a type not known to be in the copyable subset). All incoming ports must have exactly one edge. | |||
- For the broadest class (`AnyType`), the only operation supported is the identity operation (aka no-op, or `lift` - see [Extension Tracking](#extension-tracking) below). Specifically, we do not require it to be possible to copy or discard all values, hence the requirement that outports of linear type must have exactly one edge. (That is, a type not known to be in the copyable subset). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a driveby commoning up, see below
specification/hugr.md
Outdated
@@ -812,7 +813,7 @@ Extensions ::= (Extension)* -- a set, not a list | |||
Type ::= Sum([#]) -- disjoint union of rows of other types, tagged by unsigned int | |||
| Opaque(Name, [TypeArg]) -- a (instantiation of a) custom type defined by an extension | |||
| Function(#, #, Extensions) -- monomorphic function: arguments, results, and delta (see below) | |||
| Variable -- refers to a TypeParam bound by the nearest enclosing FuncDefn node, or an enclosing Function Type | |||
| Variable -- refers to a TypeParam bound by an the nearest enclosing FuncDefn node or polymorphic type scheme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dates back to #906!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, by an the
back to by an
| BoundedUSize(u64) | ||
| Extensions(Extensions) -- may contain TypeArg's of kind Extensions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just putting in same order as corresponding TypeParam
s
I don't think spec should be explicit about inference, I think that is more a feature of the reference implementation. |
specification/hugr.md
Outdated
the union of these two must match the set of extensions on each successor node. | ||
Similarly, every dataflow node in the HUGR has a set of extensions required to execute the node (computed from its operation), also known as the "delta". The delta of any node must be a subset of its parent, | ||
except for FuncDefn's: | ||
* the delta of any child of a FuncDefn, must be a subset of the extensions in the FuncDefn's *type* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit awkward. Suggestions welcome
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just remove the comma I think
specification/hugr.md
Outdated
Having these as explicit nodes on the graph allows us to search for the | ||
point before extensions were added when we want to copy graphs, allowing | ||
us to get the version with minimal extension requirements. | ||
# Having these as explicit nodes on the graph allows us to search for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any point in keeping these sections I've commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think so
specification/hugr.md
Outdated
b: List[Type] | ||
signature: | ||
inputs: Sum([a]), Sum([b]) | ||
outputs: Sum([(a,b)]) # Syntax! Sum([a,b]) would be either-a-or-b, this has one variant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bleurgh. It'd be awkward to write these examples not in the "declarative format", but OTOH I don't think we are really moving in this direction, and it's very unclear how to write these ATM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think better just to say what it is in the comment
outputs: Sum([(a,b)]) # Syntax! Sum([a,b]) would be either-a-or-b, this has one variant | |
outputs: Sum([(a,b)]) # sum with a single variant of type (a, b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
specification/hugr.md
Outdated
Every node in the HUGR is annotated with the set of extensions required to produce its inputs, | ||
and each operation provides (a way to compute) the set of extensions required to execute the node, known as the "delta"; | ||
the union of these two must match the set of extensions on each successor node. | ||
Similarly, every dataflow node in the HUGR has a set of extensions required to execute the node (computed from its operation), also known as the "delta". The delta of any node must be a subset of its parent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, every dataflow node in the HUGR has a set of extensions required to execute the node (computed from its operation), also known as the "delta". The delta of any node must be a subset of its parent, | |
Similarly, every dataflow node in the HUGR has a set of extensions required to execute the node (computed from its operation), also known as the "delta". The delta of any node must be a subset of its parent's delta, |
specification/hugr.md
Outdated
the union of these two must match the set of extensions on each successor node. | ||
Similarly, every dataflow node in the HUGR has a set of extensions required to execute the node (computed from its operation), also known as the "delta". The delta of any node must be a subset of its parent, | ||
except for FuncDefn's: | ||
* the delta of any child of a FuncDefn, must be a subset of the extensions in the FuncDefn's *type* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just remove the comma I think
specification/hugr.md
Outdated
Having these as explicit nodes on the graph allows us to search for the | ||
point before extensions were added when we want to copy graphs, allowing | ||
us to get the version with minimal extension requirements. | ||
# Having these as explicit nodes on the graph allows us to search for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think so
specification/hugr.md
Outdated
b: List[Type] | ||
signature: | ||
inputs: Sum([a]), Sum([b]) | ||
outputs: Sum([(a,b)]) # Syntax! Sum([a,b]) would be either-a-or-b, this has one variant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think better just to say what it is in the comment
outputs: Sum([(a,b)]) # Syntax! Sum([a,b]) would be either-a-or-b, this has one variant | |
outputs: Sum([(a,b)]) # sum with a single variant of type (a, b) |
Also some driveby updates e.g. missed in #906.
Closes #1097, #745.