You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/src/custom.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ On the backend, custom predicates are defined in _groups_. A group can contain
14
14
15
15
The definition of a custom predicate might also be called an _operation_ or _deduction rule_. It includes two (or, potentially, say, five) statement templates as conditions. The arguments to the statement templates are decomposed as (origin, key) pairs: if statements are allowed to have arity at most 4, then the statement templates in a deduction rule will have at most 8 arguments (4 origins and 4 keys). The same holds for the output statement.
16
16
17
-
Each argument (origin or key) to an statement template is either a wildcard or a literal. In the backend, the wildcard arguments will be identified as *1, *2, *3, ....
17
+
Each argument (origin or key) to an statement template is either a wildcard or a literal. In the backend, the wildcard arguments will be identified as ?1, ?2, ?3, ....
18
18
19
19
## Examples
20
20
@@ -32,7 +32,7 @@ For a custom statement, the "reason" includes the following witnesses and verifi
32
32
- the definition of the statement, serialized (see [examples](./customexample.md))
33
33
- if the statement is part of a group, the definition of the full group, serialized
34
34
- verify that the hash of the definition is the statement ID
35
-
- the definition will have some number of "wildcards" (*1, *2, ...) as arguments to statement templates; a value for each wildcard must be provided as a witness (each will be either an origin ID or key)
35
+
- the definition will have some number of "wildcards" (?1, ?2, ...) as arguments to statement templates; a value for each wildcard must be provided as a witness (each will be either an origin ID or key)
36
36
- the circuit must substitute the claimed values for the wildcards, and the resulting statements (true statements with origins and keys) will appear as witnesses
37
37
- the circuit must verify that all the input statement templates (with origins and keys) appear in the previous statements (in higher rows of the table)
38
38
- the circuit also substitutes the claimed values for the wildcards in the output statement, and verifies that it matches the claimed output statement
A custom operation accepts as input a number of statements (the `Condition`);
22
22
each statement has a number of arguments, which may be constants or anchored keys; and an [anchored key](./anchoredkeys.md) in turn can optionally be decomposed as a pair of an Origin and a Key.
23
23
24
-
In the "original example" above, the anchored keys `good_boy_issuers` and `receiver` are not broken down, but `AK(pod, "_type"), AK(pod, "_signer"), AK(pod, "friend")` are. The purpose of breaking them down, in this case, is to force the three anchored keys to come from the same pod.
24
+
In the "original example" above, the anchored keys `good_boy_issuers` and `receiver` are not broken down, but `?pod["_type"], ?pod["_signer"], pod["friend"]` are. The purpose of breaking them down, in this case, is to force the three anchored keys to come from the same pod.
25
25
26
26
In the "compiled example", all the anchored keys have been broken down into origins and keys.
27
27
@@ -35,18 +35,18 @@ On the back end the "compiled example" deduction rule is converted to a sort of
0 commit comments