Skip to content

Commit

Permalink
add wanings to the print function
Browse files Browse the repository at this point in the history
  • Loading branch information
Alidra committed Mar 29, 2024
1 parent 1f5dbcf commit 2b3ea4c
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions src/handle/command.ml
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,8 @@ let get_proof_data : compiler -> sig_state -> p_command -> cmd_output =
let declpos = Pos.cat pos (Option.bind p_sym_typ (fun x -> x.pos)) in
let pdata_finalize, printfct =
match pe.elt with
| P_proof_abort -> wrn pe.pos "Proof aborted."; (fun ss _ps -> ss), fun() -> ()
| P_proof_abort ->
(fun ss _ps -> ss), fun() -> wrn pe.pos "Proof aborted.";
| P_proof_admitted ->
let pdata_finalize_fct ss ps =
if finished ps then
Expand All @@ -512,16 +513,21 @@ let get_proof_data : compiler -> sig_state -> p_command -> cmd_output =
in
List.iter admit_goal ps.proof_goals;
(* Add the symbol in the signature with a warning. *)
wrn pe.pos "Proof admitted.";
(* Keep the definition only if the symbol is not opaque. *)
let d =
if opaq then None
else Option.map (fun m -> unfold (mk_Meta(m,[||]))) ps.proof_term
else
Option.map (fun m -> unfold (mk_Meta(m,[||]))) ps.proof_term
in
(* Add the symbol in the signature. *)
fst (Sig_state.add_symbol
ss expo prop mstrat opaq p_sym_nam declpos a impl d) in
pdata_finalize_fct, fun() -> Console.out 2 (Color.red "symbol %a : %a") uid id term a
pdata_finalize_fct,
fun() ->
Console.out 2
(Color.red "symbol %a : %a")
uid id term a;
wrn pe.pos "Proof admitted."
| P_proof_end ->
let pdata_finalize_fct ss ps =
(* Check that the proof is indeed finished. *)
Expand All @@ -530,14 +536,20 @@ let get_proof_data : compiler -> sig_state -> p_command -> cmd_output =
(* Keep the definition only if the symbol is not opaque. *)
let d =
if opaq then None
else Option.map (fun m -> unfold (mk_Meta(m,[||]))) ps.proof_term
else
Option.map
(fun m -> unfold (mk_Meta(m,[||])))
ps.proof_term
in
(* Add the symbol in the signature. *)
fst (Sig_state.add_symbol
ss expo prop mstrat opaq p_sym_nam declpos a impl d) in
pdata_finalize_fct, fun() -> Console.out 2 (Color.red "symbol %a : %a") uid id term a
pdata_finalize_fct,
fun() ->
Console.out 2
(Color.red "symbol %a : %a")
uid id term a
in

(* Create the proof state. *)
let pdata_state =
let proof_goals = Proof.add_goals_of_problem p [] in
Expand Down

0 comments on commit 2b3ea4c

Please sign in to comment.