@@ -203,14 +203,17 @@ impl<'a, T: FieldElement, FixedEval: FixedEvaluator<T>> WitgenInference<'a, T, F
203
203
. collect_vec ( ) ;
204
204
let known = evaluated. iter ( ) . map ( |e| e. is_some ( ) ) . collect ( ) ;
205
205
206
- if !can_process_call. can_process_call_fully ( lookup_id, & known, & range_constraints) {
206
+ let Some ( new_range_constraints) =
207
+ can_process_call. can_process_call_fully ( lookup_id, & known, & range_constraints)
208
+ else {
207
209
log:: trace!(
208
210
"Sub-machine cannot process call fully (will retry later): {lookup_id}, arguments: {}" ,
209
211
arguments. iter( ) . zip( known) . map( |( arg, known) | {
210
212
format!( "{arg} [{}]" , if known { "known" } else { "unknown" } )
211
213
} ) . format( ", " ) ) ;
212
214
return ProcessResult :: empty ( ) ;
213
- }
215
+ } ;
216
+ // TODO process range constraints.
214
217
let args = evaluated
215
218
. into_iter ( )
216
219
. zip ( arguments)
@@ -480,16 +483,17 @@ pub trait FixedEvaluator<T: FieldElement> {
480
483
}
481
484
482
485
pub trait CanProcessCall < T : FieldElement > {
483
- /// Returns true if a call to the machine that handles the given identity
486
+ /// Returns Some(..) if a call to the machine that handles the given identity
484
487
/// can always be processed with the given known inputs and range constraints
485
488
/// on the parameters.
489
+ /// The value in the Option is a vector of new range constraints.
486
490
/// @see Machine::can_process_call
487
491
fn can_process_call_fully (
488
492
& self ,
489
493
_identity_id : u64 ,
490
494
_known_inputs : & BitVec ,
491
495
_range_constraints : & [ Option < RangeConstraint < T > > ] ,
492
- ) -> bool ;
496
+ ) -> Option < Vec < Option < RangeConstraint < T > > > > ;
493
497
}
494
498
495
499
impl < T : FieldElement , Q : QueryCallback < T > > CanProcessCall < T > for & MutableState < ' _ , T , Q > {
@@ -498,7 +502,7 @@ impl<T: FieldElement, Q: QueryCallback<T>> CanProcessCall<T> for &MutableState<'
498
502
identity_id : u64 ,
499
503
known_inputs : & BitVec ,
500
504
range_constraints : & [ Option < RangeConstraint < T > > ] ,
501
- ) -> bool {
505
+ ) -> Option < Vec < Option < RangeConstraint < T > > > > {
502
506
MutableState :: can_process_call_fully ( self , identity_id, known_inputs, range_constraints)
503
507
}
504
508
}
0 commit comments