@@ -31,12 +31,14 @@ Options:
31
31
--goal=GOAL Specifies a goal to evaluate (may be given more than once).
32
32
--overflow-depth=N Specifies the overflow depth [default: 10].
33
33
--multiple Output multiple answers instead of ambiguous solution.
34
+ --solver=S Specifies the solver to use. `slg` or `recursive`. Default is SLG.
34
35
" ;
35
36
36
37
/// This struct represents the various command line options available.
37
38
#[ derive( Debug , Deserialize ) ]
38
39
struct Args {
39
40
flag_program : Option < String > ,
41
+ flag_solver : Option < String > ,
40
42
flag_goal : Vec < String > ,
41
43
flag_overflow_depth : usize ,
42
44
flag_multiple : bool ,
@@ -288,9 +290,17 @@ fn read_program(rl: &mut rustyline::Editor<()>) -> Result<String> {
288
290
289
291
impl Args {
290
292
fn solver_choice ( & self ) -> SolverChoice {
291
- SolverChoice :: SLG {
292
- max_size : self . flag_overflow_depth ,
293
- expected_answers : None ,
293
+ match self . flag_solver . as_ref ( ) . map ( String :: as_str) {
294
+ None | Some ( "slg" ) => SolverChoice :: SLG {
295
+ max_size : self . flag_overflow_depth ,
296
+ expected_answers : None ,
297
+ } ,
298
+ Some ( "recursive" ) => SolverChoice :: Recursive {
299
+ overflow_depth : 100 ,
300
+ caching_enabled : true ,
301
+ max_size : 30 ,
302
+ } ,
303
+ Some ( s) => panic ! ( "invalid solver {}" , s) ,
294
304
}
295
305
}
296
306
}
0 commit comments