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

Specify Logic Resource. #266

Merged
merged 4 commits into from
Jul 13, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions specification/hugr.md
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,24 @@ implementation of this design document is available on GitHub.
`panic`: panics unconditionally; no inputs, any type of outputs (these
are never produced)

### Logic Resource

The Logic Resource provides a boolean type and basic logical operations.

The boolean type `bool` is defined to be `Sum((),())`, with the convention that the
first option in the sum represents "false" and the second represents "true".

The following operations are defined:

| Name | Inputs | Outputs | Meaning |
| -------- | ---------- | ------- | ----------------------------- |
| `not` | `bool` | `bool` | logical "not" |
| `and<N>` | `bool` x N | `bool` | N-ary logical "and" (N \>= 0) |
| `or<N>` | `bool` x N | `bool` | N-ary logical "or" (N \>= 0) |

Note that an `and<0>` operation produces the constant value "true" and an
`or<0>` operation produces the constant value "false".

### Arithmetic Resource

The Arithmetic Resource provides types and operations for integer and
Expand Down