Desugar statement templates (#226)
* Desugar statement templates * Support desugaring of SetContains statement templates * Update the book
This commit is contained in:
parent
726f95483d
commit
b2cb563eb6
4 changed files with 158 additions and 14 deletions
|
|
@ -9,8 +9,7 @@ use serde::{Deserialize, Serialize};
|
|||
use crate::middleware::{
|
||||
self, check_st_tmpl, hash_str, hash_values, AnchoredKey, Hash, Key, MainPodInputs,
|
||||
NativeOperation, NativePredicate, OperationAux, OperationType, Params, PodId, PodProver,
|
||||
PodSigner, Predicate, Statement, StatementArg, Value, WildcardValue, EMPTY_VALUE, KEY_TYPE,
|
||||
SELF,
|
||||
PodSigner, Predicate, Statement, StatementArg, Value, WildcardValue, KEY_TYPE, SELF,
|
||||
};
|
||||
|
||||
mod custom;
|
||||
|
|
@ -251,8 +250,11 @@ impl MainPodBuilder {
|
|||
}
|
||||
Native(SetContainsFromEntries) => {
|
||||
let [set, value] = op.1.try_into().unwrap(); // TODO: Error handling
|
||||
let empty = OperationArg::Literal(Value::from(EMPTY_VALUE));
|
||||
Operation(Native(ContainsFromEntries), vec![set, value, empty], op.2)
|
||||
Operation(
|
||||
Native(ContainsFromEntries),
|
||||
vec![set, value.clone(), value],
|
||||
op.2,
|
||||
)
|
||||
}
|
||||
Native(SetNotContainsFromEntries) => {
|
||||
let [set, value] = op.1.try_into().unwrap(); // TODO: Error handling
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue