Allow literals in statements (#276)

Implements #229 and #261.
This commit is contained in:
Daniel Gulotta 2025-06-13 10:27:19 -07:00 committed by GitHub
parent 21ab3c2d0d
commit 7d0d3ad769
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 992 additions and 825 deletions

View file

@ -527,7 +527,7 @@ mod tests {
"_".into(),
vec![
st(
P::Native(NP::ValueOf),
P::Native(NP::Equal),
vec![
STA::AnchoredKey(sow_wc(4), kow_wc(5)),
STA::Literal(2.into()),
@ -558,8 +558,8 @@ mod tests {
let custom_deduction = Operation::Custom(
CustomPredicateRef::new(cust_pred_batch, 0),
vec![
Statement::ValueOf(AnchoredKey::from((SELF, "Some constant")), 2.into()),
Statement::ProductOf(
Statement::equal(AnchoredKey::from((SELF, "Some constant")), 2),
Statement::product_of(
AnchoredKey::from((SELF, "Some value")),
AnchoredKey::from((SELF, "Some constant")),
AnchoredKey::from((SELF, "Some other value")),
@ -585,7 +585,7 @@ mod tests {
"eth_friend_cp".into(),
vec![
st(
P::Native(NP::ValueOf),
P::Native(NP::Equal),
vec![
STA::AnchoredKey(sow_wc(4), KeyOrWildcard::Key("type".into())),
STA::Literal(PodType::Signed.into()),
@ -626,7 +626,7 @@ mod tests {
],
),
st(
P::Native(NP::ValueOf),
P::Native(NP::Equal),
vec![
STA::AnchoredKey(sow_wc(4), kow_wc(5)),
STA::Literal(0.into()),
@ -654,7 +654,7 @@ mod tests {
],
),
st(
P::Native(NP::ValueOf),
P::Native(NP::Equal),
vec![
STA::AnchoredKey(sow_wc(6), kow_wc(7)),
STA::Literal(1.into()),
@ -776,8 +776,8 @@ mod tests {
WildcardValue::Key(Key::from("Six")),
],
),
Statement::ValueOf(AnchoredKey::from((SELF, "One")), 1.into()),
Statement::SumOf(
Statement::equal(AnchoredKey::from((SELF, "One")), 1),
Statement::sum_of(
AnchoredKey::from((SELF, "Seven")),
AnchoredKey::from((pod_id4, "Six")),
AnchoredKey::from((SELF, "One")),