Fix handling of Lt, LtEq (#393)

Changed the middleware to only allow comparison of integers and to
use the implementation of Ord for i64.  This matches the backend
behavior.

Also fixed a separate bug where LtEqFromEntries was producing a
NotEquals statement.
This commit is contained in:
Daniel Gulotta 2025-08-18 07:54:20 -07:00 committed by GitHub
parent 1508dd6126
commit f76197c602
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 36 additions and 27 deletions

View file

@ -1095,4 +1095,14 @@ pub mod tests {
let std_common = &*cache_get_standard_rec_main_pod_common_circuit_data();
assert_eq!(std_common.0, main_common.0);
}
#[test]
fn test_negative_less_than_zero() -> frontend::Result<()> {
let params = Params::default();
let mut builder = MainPodBuilder::new(&params, &DEFAULT_VD_SET);
builder.pub_op(frontend::Operation::lt(-1, 0))?;
let prover = Prover {};
builder.prove(&prover)?;
Ok(())
}
}