Skip to content
Snippets Groups Projects
Commit cbed8092 authored by Loïc Correnson's avatar Loïc Correnson Committed by Virgile Prevosto
Browse files

[wp] don't put check lemma in proof context

parent cf255eef
No related branches found
No related tags found
No related merge requests found
...@@ -199,7 +199,7 @@ let ip_lemma l = ...@@ -199,7 +199,7 @@ let ip_lemma l =
il_args = l.lem_types; il_loc = (l.lem_position, l.lem_position); il_args = l.lem_types; il_loc = (l.lem_position, l.lem_position);
il_pred = l.lem_property} il_pred = l.lem_property}
let lemma_of_global proof = function let lemma_of_global ~context = function
| Dlemma(name,axiom,labels,types,pred,_,loc) -> | Dlemma(name,axiom,labels,types,pred,_,loc) ->
let kind = if axiom then `Axiom else let kind = if axiom then `Axiom else
if pred.tp_only_check then `Check else `Lemma in if pred.tp_only_check then `Check else `Lemma in
...@@ -210,14 +210,14 @@ let lemma_of_global proof = function ...@@ -210,14 +210,14 @@ let lemma_of_global proof = function
lem_labels = labels ; lem_labels = labels ;
lem_kind = kind ; lem_kind = kind ;
lem_property = pred.tp_statement ; lem_property = pred.tp_statement ;
lem_depends = proof ; lem_depends = context ;
} }
| _ -> assert false | _ -> assert false
let populate a proof = function let populate a ~context = function
| Dfun_or_pred(l,_) -> a.ax_logics <- l :: a.ax_logics | Dfun_or_pred(l,_) -> a.ax_logics <- l :: a.ax_logics
| Dtype(t,_) -> a.ax_types <- t :: a.ax_types | Dtype(t,_) -> a.ax_types <- t :: a.ax_types
| Dlemma _ as g -> a.ax_lemmas <- lemma_of_global proof g :: a.ax_lemmas | Dlemma _ as g -> a.ax_lemmas <- lemma_of_global ~context g :: a.ax_lemmas
| _ -> () | _ -> ()
let ip_of_axiomatic g = let ip_of_axiomatic g =
...@@ -225,7 +225,7 @@ let ip_of_axiomatic g = ...@@ -225,7 +225,7 @@ let ip_of_axiomatic g =
| None -> assert false | None -> assert false
| Some ip -> ip | Some ip -> ip
let axiomatic_of_global proof = function let axiomatic_of_global ~context = function
| Daxiomatic(name,globals,_,loc) as g -> | Daxiomatic(name,globals,_,loc) as g ->
let a = { let a = {
ax_name = name ; ax_name = name ;
...@@ -234,7 +234,7 @@ let axiomatic_of_global proof = function ...@@ -234,7 +234,7 @@ let axiomatic_of_global proof = function
ax_reads = Varinfo.Set.empty ; ax_reads = Varinfo.Set.empty ;
ax_types = [] ; ax_lemmas = [] ; ax_logics = [] ; ax_types = [] ; ax_lemmas = [] ; ax_logics = [] ;
} in } in
List.iter (populate a proof) globals ; List.iter (populate a ~context) globals ;
a.ax_types <- List.rev a.ax_types ; a.ax_types <- List.rev a.ax_types ;
a.ax_logics <- List.rev a.ax_logics ; a.ax_logics <- List.rev a.ax_logics ;
a.ax_lemmas <- List.rev a.ax_lemmas ; a.ax_lemmas <- List.rev a.ax_lemmas ;
...@@ -407,7 +407,8 @@ class visitor = ...@@ -407,7 +407,8 @@ class visitor =
| Dlemma _ -> | Dlemma _ ->
let lem = lemma_of_global database.proofcontext global in let lem = lemma_of_global database.proofcontext global in
register_lemma database self#section lem ; register_lemma database self#section lem ;
database.proofcontext <- lem :: database.proofcontext ; if lem.lem_kind <> `Check then
database.proofcontext <- lem :: database.proofcontext ;
SkipChildren SkipChildren
| Dtype(t,_) -> | Dtype(t,_) ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment