Desugar statement templates (#226)

* Desugar statement templates

* Support desugaring of SetContains statement templates

* Update the book
This commit is contained in:
Rob Knight 2025-05-09 05:48:18 -07:00 committed by GitHub
parent 726f95483d
commit b2cb563eb6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 158 additions and 14 deletions

View file

@ -11,7 +11,7 @@ use super::serialization::{ordered_map, ordered_set};
use crate::backends::plonky2::primitives::merkletree::{MerkleProof, MerkleTree};
use crate::{
constants::MAX_DEPTH,
middleware::{hash_value, Error, Hash, Key, RawValue, Result, Value, EMPTY_VALUE},
middleware::{hash_value, Error, Hash, Key, RawValue, Result, Value},
};
/// Dictionary: the user original keys and values are hashed to be used in the leaf.
@ -129,7 +129,7 @@ impl Set {
.iter()
.map(|e| {
let h = hash_value(&e.raw());
(RawValue::from(h), EMPTY_VALUE)
(RawValue::from(h), RawValue::from(h))
})
.collect();
Ok(Self {
@ -159,7 +159,7 @@ impl Set {
root,
proof,
&RawValue::from(h),
&EMPTY_VALUE,
&RawValue::from(h),
)?)
}
pub fn verify_nonexistence(root: Hash, proof: &MerkleProof, value: &Value) -> Result<()> {