@@ -31,12 +31,14 @@ Options:
3131 --goal=GOAL Specifies a goal to evaluate (may be given more than once).
3232 --overflow-depth=N Specifies the overflow depth [default: 10].
3333 --multiple Output multiple answers instead of ambiguous solution.
34+ --solver=S Specifies the solver to use. `slg` or `recursive`. Default is SLG.
3435" ;
3536
3637/// This struct represents the various command line options available.
3738#[ derive( Debug , Deserialize ) ]
3839struct Args {
3940 flag_program : Option < String > ,
41+ flag_solver : Option < String > ,
4042 flag_goal : Vec < String > ,
4143 flag_overflow_depth : usize ,
4244 flag_multiple : bool ,
@@ -288,9 +290,17 @@ fn read_program(rl: &mut rustyline::Editor<()>) -> Result<String> {
288290
289291impl Args {
290292 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) ,
294304 }
295305 }
296306}
0 commit comments