@@ -138,7 +138,7 @@ let add_if_named
138138 ~(acc : DStd.Expr.term Util.MS.t )
139139 (stmt : Typer_Pipe.typechecked D_loop.Typer_Pipe.stmt ) =
140140 match stmt.contents with
141- | `Defs [`Term_def ({name = Simple n; _}, id, _, _, t)] ->
141+ | `Defs ( _recursive , [`Term_def ({name = Simple n ; _} , id , _ , _ , t )]) ->
142142 begin
143143 match DStd.Expr.Id. get_tag id DStd.Expr.Tags. named with
144144 | None -> acc
@@ -404,7 +404,7 @@ let process_source ?selector_inst ~print_status src =
404404 ~interactive_prompt
405405 |> Typer. init
406406 ~additional_builtins: Translate. builtins
407- ~extension_builtins: [Typer.Ext. bv2nat ]
407+ ~extension_builtins: [Dolmen_loop. Typer.Ext.bvconv ]
408408 |> Typer_Pipe. init ~type_check
409409 in
410410
@@ -608,7 +608,9 @@ let process_source ?selector_inst ~print_status src =
608608 issue in Dolmen, we can replace the [loc] argument by the [st_loc]
609609 value built in [handle_stmt]. *)
610610 let handle_custom_statement ~loc id args st =
611- let args = List. map Dolmen_type.Core.Smtlib2. sexpr_as_term args in
611+ let args =
612+ List. map (Dolmen_type.Core.Smtlib2. sexpr_as_term (`Script `Poly )) args
613+ in
612614 let logic_file = State. get State. logic_file st in
613615 let st, terms = Typer. terms st ~input: (`Logic logic_file) ~loc args in
614616 match id, terms.ret with
@@ -638,46 +640,53 @@ let process_source ?selector_inst ~print_status src =
638640 st
639641 in
640642
641- let handle_get_info ~loc (st : State.t ) (name : string ) =
642- let print_std =
643- fun (type a ) (pp :a Fmt.t ) (a : a ) ->
644- Printer. print_std " (%s %a)" name pp a
645- in
646- let pp_reason_unknown st =
647- let err () =
648- recoverable_error ~loc " Invalid (get-info :reason-unknown)"
643+ let handle_get_info ~loc (st : State.t ) (info : DStd.Term.t ) =
644+ match info with
645+ | { term = Builtin _ | App _ | Binder _ | Match _ | Colon _; _ }
646+ | { term = Symbol { ns = (Var | Sort | Term | Decl | Track | Value _); _ }
647+ ; _ }
648+ | { term = Symbol { name = Indexed _ | Qualified _ ; ns = Attr } ; _ } ->
649+ unsupported_opt " get-info"
650+ | { term = Symbol { name = Simple name ; ns = Attr } ; _ } ->
651+ let print_std =
652+ fun (type a ) (pp :a Fmt.t ) (a : a ) ->
653+ Printer. print_std " (%s %a)" name pp a
649654 in
650- match State. get partial_model_key st with
651- | None -> err ()
652- | Some Model ((module SAT), sat ) ->
653- match SAT. get_unknown_reason sat with
655+ let pp_reason_unknown st =
656+ let err () =
657+ recoverable_error ~loc " Invalid (get-info :reason-unknown)"
658+ in
659+ match State. get partial_model_key st with
654660 | None -> err ()
655- | Some ur ->
656- print_std Sat_solver_sig. pp_smt_unknown_reason ur
657- in
658- match name with
659- | ":authors" ->
660- print_std (fun fmt -> Fmt. pf fmt " %S" ) " Alt-Ergo developers"
661- | ":error-behavior" ->
662- let behavior =
663- if Options. get_exit_on_error () then
664- " immediate-exit"
665- else
666- " continued-execution"
661+ | Some Model ((module SAT), sat ) ->
662+ match SAT. get_unknown_reason sat with
663+ | None -> err ()
664+ | Some ur ->
665+ print_std Sat_solver_sig. pp_smt_unknown_reason ur
667666 in
668- print_std Fmt. string behavior
669- | ":name" ->
670- print_std (fun fmt -> Fmt. pf fmt " %S" ) " Alt-Ergo"
671- | ":reason-unknown" ->
672- pp_reason_unknown st
673- | ":version" ->
674- print_std Fmt. string Version. _version
675- | ":all-statistics" ->
676- Printer. print_std " %t" Profiling. print_statistics
677- | ":assertion-stack-levels" ->
678- unsupported_opt name
679- | _ ->
680- unsupported_opt name
667+ match name with
668+ | ":authors" ->
669+ print_std (fun fmt -> Fmt. pf fmt " %S" ) " Alt-Ergo developers"
670+ | ":error-behavior" ->
671+ let behavior =
672+ if Options. get_exit_on_error () then
673+ " immediate-exit"
674+ else
675+ " continued-execution"
676+ in
677+ print_std Fmt. string behavior
678+ | ":name" ->
679+ print_std (fun fmt -> Fmt. pf fmt " %S" ) " Alt-Ergo"
680+ | ":reason-unknown" ->
681+ pp_reason_unknown st
682+ | ":version" ->
683+ print_std Fmt. string Version. _version
684+ | ":all-statistics" ->
685+ Printer. print_std " %t" Profiling. print_statistics
686+ | ":assertion-stack-levels" ->
687+ unsupported_opt name
688+ | _ ->
689+ unsupported_opt name
681690 in
682691
683692 (* Fetches the term value in the current model. *)
@@ -921,7 +930,18 @@ let process_source ?selector_inst ~print_status src =
921930 let preludes =
922931 theory_preludes @
923932 List. map (fun path ->
924- let dir, source = State. split_input (`File path) in
933+ (* Using [`File] sources with preludes is currently broken,
934+ see https://github.com/Gbury/dolmen/issues/248
935+ and https://github.com/OCamlPro/alt-ergo/issues/1330 *)
936+ let dir, source =
937+ let content =
938+ let ch = open_in_bin path in
939+ let s = really_input_string ch (in_channel_length ch) in
940+ close_in ch;
941+ s
942+ in
943+ Filename. dirname path, (`Raw (Filename. basename path, content))
944+ in
925945 State. mk_file dir source) (Options. get_preludes () )
926946 in
927947 let g =
0 commit comments