feat!(argus-parser): complete parser

This changes the API for `ExprBuilder`, but that is OK.
This commit is contained in:
Anand Balakrishnan 2023-10-03 16:08:22 -07:00
parent 17042a2544
commit 2319668e2b
No known key found for this signature in database
9 changed files with 545 additions and 146 deletions

View file

@ -53,13 +53,13 @@ mod tests {
fn simple_iter() {
let mut ctx = ExprBuilder::new();
let x = ctx.float_var("x".to_owned()).unwrap();
let y = ctx.float_var("y".to_owned()).unwrap();
let lit = ctx.float_const(2.0);
let x = Box::new(ctx.float_var("x".to_owned()).unwrap());
let y = Box::new(ctx.float_var("y".to_owned()).unwrap());
let lit = Box::new(ctx.float_const(2.0));
let pred1 = ctx.make_le(x.clone(), lit.clone());
let pred2 = ctx.make_gt(y.clone(), lit.clone());
let spec = ctx.make_or([*pred1.clone(), *pred2.clone()]).unwrap();
let pred1 = Box::new(ctx.make_le(x.clone(), lit.clone()));
let pred2 = Box::new(ctx.make_gt(y.clone(), lit.clone()));
let spec = Box::new(ctx.make_or([*pred1.clone(), *pred2.clone()]).unwrap());
drop(ctx);