@@ -568,7 +568,12 @@ let mk_opts file () () debug_flags ddebug_flags dddebug_flags backtrace
568568 Debug. mk ~verbosity: 3 dddebug_flags;
569569 if backtrace then Printexc. record_backtrace true ;
570570 Rule. mk rule;
571- if halt_opt then `Ok false
571+ let path =
572+ match file with
573+ | Some f -> `File f
574+ | None -> `Stdin
575+ in
576+ if halt_opt then `Ok None
572577 (* If save_used_context was invoked as an option it should
573578 automatically set unsat_core to true *)
574579 else begin
@@ -579,14 +584,13 @@ let mk_opts file () () debug_flags ddebug_flags dddebug_flags backtrace
579584 Filename. chop_extension f
580585 with Invalid_argument _ -> f
581586 in
582- set_file f;
583587 set_session_file (base_file^ " .agr" );
584588 set_used_context_file base_file;
585589 | _ -> ()
586590 );
587591
588592 Gc. set { (Gc. get() ) with Gc. allocation_policy = gc };
589- `Ok true
593+ `Ok ( Some path)
590594 end
591595
592596let mk_output_channel_opt regular_output diagnostic_output =
@@ -1500,7 +1504,8 @@ let main =
15001504 ($(i,.mlw) and $(i,.why) are deprecated), \
15011505 $(i,.smt2) or $(i,.psmt2)." in
15021506 let i = Arg. (info [] ~docv: " FILE" ~doc ) in
1503- Arg. (value & pos ~rev: true 0 (some file) None & i) in
1507+ Arg. (value & pos ~rev: true 0 (some file) None & i)
1508+ in
15041509
15051510 let doc = " Execute Alt-Ergo on the given file." in
15061511 let exits = Cmd.Exit. defaults in
@@ -1576,8 +1581,8 @@ let parse_cmdline_arguments () =
15761581 at_exit Options.Output. close_all;
15771582 let r = Cmd. eval_value main in
15781583 match r with
1579- | Ok `Ok true -> ()
1580- | Ok `Ok false -> raise (Exit_parse_command 0 )
1584+ | Ok `Ok Some path -> Solving_loop. { path }
1585+ | Ok `Ok None -> raise (Exit_parse_command 0 )
15811586 | Ok `Version | Ok `Help -> exit 0
15821587 | Error `Parse -> exit Cmd.Exit. cli_error
15831588 | Error `Term -> exit Cmd.Exit. internal_error
0 commit comments