-
Notifications
You must be signed in to change notification settings - Fork 11
sync spec & code #107
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
sync spec & code #107
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,4 +9,4 @@ title = "POD2-docs" | |
| default-theme = "light" | ||
|
|
||
| [preprocessor.katex] | ||
| after = ["links"] | ||
| after = ["links"] | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,28 +18,29 @@ The POD system has several builtin statements. These statements are associated t | |
|
|
||
| ### Backend statements | ||
|
|
||
| <font color="red">TODO: update table of backend statements </font> | ||
|
|
||
| A statement is a code (or, in the frontend, string identifier) followed by 0 or more arguments. These arguments may consist of up to three anchored keys and up to one POD value. | ||
|
|
||
| The following table summarises the natively-supported statements, where we write `value_of(ak)` for 'the value anchored key `ak` maps to', which is of type `PODValue`, and `key_of(ak)` for the key part of `ak`: | ||
|
|
||
| | Code | Identifier | Args | Meaning | | ||
| |------|-------------|---------------------|-------------------------------------------------------------------| | ||
| | 0 | `None` | | no statement (useful for padding) | | ||
| | 1 | `ValueOf` | `ak`, `value` | `value_of(ak) = value` | | ||
| | 2 | `Eq` | `ak1`, `ak2` | `value_of(ak1) = value_of(ak2)` | | ||
| | 3 | `NEq` | `ak1`, `ak2` | `value_of(ak1) != value_of(ak2)` | | ||
| | 4 | `Gt` | `ak1`, `ak2` | `value_of(ak1) > value_of(ak2)` | | ||
| | 5 | `LEq` | `ak1`, `ak2` | `value_of(ak1) <= value_of(ak2)` | | ||
| | 6 | `Contains` | `ak1`, `ak2` | `(key_of(ak2), value_of(ak2)) ∈ value_of(ak1)` (Merkle inclusion) | | ||
| | 7 | `Sintains` | `ak1`, `ak2` | `(key_of(ak2), value_of(ak2)) ∉ value_of(ak1)` (Merkle exclusion) | | ||
| | 8 | `SumOf` | `ak1`, `ak2`, `ak3` | `value_of(ak1) = value_of(ak2) + value_of(ak3)` | | ||
| | 9 | `ProductOf` | `ak1`, `ak2`, `ak3` | `value_of(ak1) = value_of(ak2) * value_of(ak3)` | | ||
| | 10 | `MaxOf` | `ak1`, `ak2`, `ak3` | `value_of(ak1) = max(value_of(ak2), value_of(ak3))` | | ||
| | Code | Identifier | Args | Meaning | | ||
| |------|---------------|---------------------|-------------------------------------------------------------------| | ||
| | 0 | `None` | | no statement (useful for padding) | | ||
| | 1 | `ValueOf` | `ak`, `value` | `value_of(ak) = value` | | ||
| | 2 | `Eq` | `ak1`, `ak2` | `value_of(ak1) = value_of(ak2)` | | ||
| | 3 | `NEq` | `ak1`, `ak2` | `value_of(ak1) != value_of(ak2)` | | ||
| | 4 | `Gt` | `ak1`, `ak2` | `value_of(ak1) > value_of(ak2)` | | ||
| | 5 | `LEq` | `ak1`, `ak2` | `value_of(ak1) <= value_of(ak2)` | | ||
| | 6 | `Contains` | `ak1`, `ak2` | `(key_of(ak2), value_of(ak2)) ∈ value_of(ak1)` (Merkle inclusion) | | ||
| | 7 | `NotContains` | `ak1`, `ak2` | `(key_of(ak2), value_of(ak2)) ∉ value_of(ak1)` (Merkle exclusion) | | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did this change to make it match the implementation naming, but later realized that other sections of the spec use
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apparently
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well in this specific line I changed it to |
||
| | 8 | `SumOf` | `ak1`, `ak2`, `ak3` | `value_of(ak1) = value_of(ak2) + value_of(ak3)` | | ||
| | 9 | `ProductOf` | `ak1`, `ak2`, `ak3` | `value_of(ak1) = value_of(ak2) * value_of(ak3)` | | ||
| | 10 | `MaxOf` | `ak1`, `ak2`, `ak3` | `value_of(ak1) = max(value_of(ak2), value_of(ak3))` | | ||
|
|
||
| ### Frontend statements | ||
|
|
||
| <span style="color:red">TODO: Current implementation frontend Statements reuse the middleware Statements, which:</span><br> | ||
| <span style="color:red">- 1: GEq & LEq don't appear in the frontend impl</span><br> | ||
| <span style="color:red">- 2: frontend impl has Contains & NotContains, which don't appear at the following block</span> | ||
| ``` | ||
| ValueOf(key: AnchoredKey, value: ScalarOrVec) | ||
|
|
||
|
|
@@ -150,4 +151,4 @@ ecdsa_priv_to_pub_of(A.pubkey, B.privkey) | |
|
|
||
| [^builtin]: <font color="red">TODO</font> List of built-in statements is not yet complete. | ||
|
|
||
| [^fillsum]: <font color="red">TODO</font> Does sum mean x+y = z or x = y+z? | ||
| [^fillsum]: <font color="red">TODO</font> Does sum mean x+y = z or x = y+z? | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| pub mod basetypes; | ||
| pub mod mock_main; | ||
| pub mod mock_signed; | ||
| pub mod primitives; |
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.
(the changes in this file are just to update the merkletree.md#Interface to match the rust implementation interface)