Skip to content

Commit

Permalink
lib/monads: use experiment for demo lemmas
Browse files Browse the repository at this point in the history
Use the experiment context to discard demo lemmas from the theory in the
Monad session. Some of these demo lemmas confuse sledgehammer.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
  • Loading branch information
lsf37 committed Dec 2, 2024
1 parent c9c4d49 commit 6c449e1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Monads/wp/Datatype_Schematic.thy
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ declare option.sel[datatype_schematic]
declare list.sel(1,3)[datatype_schematic]
declare sum.sel[datatype_schematic]

locale datatype_schem_demo begin
experiment begin

lemma handles_nested_constructors:
"\<exists>f. \<forall>y. f True (Some [x, (y, z)]) = y"
Expand Down
5 changes: 5 additions & 0 deletions lib/Monads/wp/WPBang.thy
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ method_setup wpe = \<open>WP_Safe.wpe_args\<close>

text \<open>Testing.\<close>

experiment
begin

lemma
assumes x: "\<lbrace> P \<rbrace> f \<lbrace> \<lambda>rv. Q \<rbrace>"
and y: "\<lbrace> P \<rbrace> f \<lbrace> \<lambda>rv. R \<rbrace>"
Expand All @@ -71,3 +74,5 @@ lemma
done

end

end
5 changes: 5 additions & 0 deletions lib/Monads/wp/WPFix.thy
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ end

method_setup wpfix = \<open>WPFix.method\<close>

experiment
begin

lemma demo1:
"(\<exists>Ia Ib Ic Id Ra.
(Ia (Suc 0) \<longrightarrow> Qa)
Expand Down Expand Up @@ -267,3 +270,5 @@ lemma (in datatype_schem_demo) demo3:
by (rule refl)

end

end
5 changes: 5 additions & 0 deletions lib/Monads/wp/WP_Pre.thy
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ named_theorems wp_pre
method wp_pre0 = pre_tac wp_pre
method wp_pre = wp_pre0?

experiment
begin

definition
test_wp_pre :: "bool \<Rightarrow> bool \<Rightarrow> bool"
where
Expand All @@ -121,3 +124,5 @@ lemma demo:
done

end

end

0 comments on commit 6c449e1

Please sign in to comment.