diff --git a/thys/PLM/TAO_99_SanityTests.thy b/thys/PLM/TAO_99_SanityTests.thy --- a/thys/PLM/TAO_99_SanityTests.thy +++ b/thys/PLM/TAO_99_SanityTests.thy @@ -1,242 +1,242 @@ (*<*) theory TAO_99_SanityTests imports TAO_7_Axioms begin (*>*) section\Sanity Tests\ text\\label{TAO_SanityTests}\ locale SanityTests begin interpretation MetaSolver. interpretation Semantics. subsection\Consistency\ text\\label{TAO_SanityTests_Consistency}\ lemma "True" nitpick[expect=genuine, user_axioms, satisfy] by auto subsection\Intensionality\ text\\label{TAO_SanityTests_Intensionality}\ lemma "[(\<^bold>\y. (q \<^bold>\ \<^bold>\q)) \<^bold>= (\<^bold>\y. (p \<^bold>\ \<^bold>\p)) in v]" unfolding identity_\\<^sub>1_def conn_defs apply (rule Eq\<^sub>1I) apply (simp add: meta_defs) nitpick[expect = genuine, user_axioms=true, card i = 2, card j = 2, card \ = 1, card \ = 1, - sat_solver = MiniSat_JNI, verbose, show_all] + sat_solver = MiniSat, verbose, show_all] oops \ \Countermodel by Nitpick\ lemma "[(\<^bold>\y. (p \<^bold>\ q)) \<^bold>= (\<^bold>\y. (q \<^bold>\ p)) in v]" unfolding identity_\\<^sub>1_def apply (rule Eq\<^sub>1I) apply (simp add: meta_defs) nitpick[expect = genuine, user_axioms=true, - sat_solver = MiniSat_JNI, card i = 2, + sat_solver = MiniSat, card i = 2, card j = 2, card \ = 1, card \ = 1, card \ = 2, verbose, show_all] oops \ \Countermodel by Nitpick\ subsection\Concreteness coindices with Object Domains\ text\\label{TAO_SanityTests_Concreteness}\ lemma OrdCheck: "[\\<^bold>\ x . \<^bold>\\<^bold>\(\<^bold>\\E!, x\<^sup>P\), x\ in v] \ (proper x) \ (case (rep x) of \\ y \ True | _ \ False)" using OrdinaryObjectsPossiblyConcreteAxiom apply (simp add: meta_defs meta_aux split: \.split \.split) using \\_\\_is_\\ by fastforce lemma AbsCheck: "[\\<^bold>\ x . \<^bold>\(\<^bold>\\E!, x\<^sup>P\), x\ in v] \ (proper x) \ (case (rep x) of \\ y \ True | _ \ False)" using OrdinaryObjectsPossiblyConcreteAxiom apply (simp add: meta_defs meta_aux split: \.split \.split) using no_\\ by blast subsection\Justification for Meta-Logical Axioms\ text\\label{TAO_SanityTests_MetaAxioms}\ text\ \begin{remark} OrdinaryObjectsPossiblyConcreteAxiom is equivalent to "all ordinary objects are possibly concrete". \end{remark} \ lemma OrdAxiomCheck: "OrdinaryObjectsPossiblyConcrete \ (\ x. ([\\<^bold>\ x . \<^bold>\\<^bold>\(\<^bold>\\E!, x\<^sup>P\), x\<^sup>P\ in v] \ (case x of \\ y \ True | _ \ False)))" unfolding Concrete_def apply (simp add: meta_defs meta_aux split: \.split \.split) using \\_\\_is_\\ by fastforce text\ \begin{remark} OrdinaryObjectsPossiblyConcreteAxiom is equivalent to "all abstract objects are necessarily not concrete". \end{remark} \ lemma AbsAxiomCheck: "OrdinaryObjectsPossiblyConcrete \ (\ x. ([\\<^bold>\ x . \<^bold>\(\<^bold>\\E!, x\<^sup>P\), x\<^sup>P\ in v] \ (case x of \\ y \ True | _ \ False)))" apply (simp add: meta_defs meta_aux split: \.split \.split) using \\_\\_is_\\ no_\\ by fastforce text\ \begin{remark} PossiblyContingentObjectExistsAxiom is equivalent to the corresponding statement in the embedded logic. \end{remark} \ lemma PossiblyContingentObjectExistsCheck: "PossiblyContingentObjectExists \ [\<^bold>\(\<^bold>\(\<^bold>\ x. \E!,x\<^sup>P\ \<^bold>\ \<^bold>\\E!,x\<^sup>P\)) in v]" apply (simp add: meta_defs forall_\_def meta_aux split: \.split \.split) by (metis \.simps(5) \\_def \.simps(1) no_\\ \.exhaust) text\ \begin{remark} PossiblyNoContingentObjectExistsAxiom is equivalent to the corresponding statement in the embedded logic. \end{remark} \ lemma PossiblyNoContingentObjectExistsCheck: "PossiblyNoContingentObjectExists \ [\<^bold>\(\<^bold>\(\<^bold>\(\<^bold>\ x. \E!,x\<^sup>P\ \<^bold>\ \<^bold>\\E!,x\<^sup>P\))) in v]" apply (simp add: meta_defs forall_\_def meta_aux split: \.split \.split) using \\_\\_is_\\ by blast subsection\Relations in the Meta-Logic\ text\\label{TAO_SanityTests_MetaRelations}\ text\ \begin{remark} Material equality in the embedded logic corresponds to equality in the actual state in the meta-logic. \end{remark} \ lemma mat_eq_is_eq_dj: "[\<^bold>\ x . \<^bold>\(\F,x\<^sup>P\ \<^bold>\ \G,x\<^sup>P\) in v] \ ((\ x . (eval\\<^sub>1 F) x dj) = (\ x . (eval\\<^sub>1 G) x dj))" proof assume 1: "[\<^bold>\x. \<^bold>\(\F,x\<^sup>P\ \<^bold>\ \G,x\<^sup>P\) in v]" { fix v fix y obtain x where y_def: "y = \\ x" by (meson \\_surj surj_def) have "(\r o\<^sub>1. Some r = d\<^sub>1 F \ Some o\<^sub>1 = d\<^sub>\ (x\<^sup>P) \ o\<^sub>1 \ ex1 r v) = (\r o\<^sub>1. Some r = d\<^sub>1 G \ Some o\<^sub>1 = d\<^sub>\ (x\<^sup>P) \ o\<^sub>1 \ ex1 r v)" using 1 apply - by meta_solver moreover obtain r where r_def: "Some r = d\<^sub>1 F" unfolding d\<^sub>1_def by auto moreover obtain s where s_def: "Some s = d\<^sub>1 G" unfolding d\<^sub>1_def by auto moreover have "Some x = d\<^sub>\ (x\<^sup>P)" using d\<^sub>\_proper by simp ultimately have "(x \ ex1 r v) = (x \ ex1 s v)" by (metis option.inject) hence "(eval\\<^sub>1 F) y dj v = (eval\\<^sub>1 G) y dj v" using r_def s_def y_def by (simp add: d\<^sub>1.rep_eq ex1_def) } thus "(\x. eval\\<^sub>1 F x dj) = (\x. eval\\<^sub>1 G x dj)" by auto next assume 1: "(\x. eval\\<^sub>1 F x dj) = (\x. eval\\<^sub>1 G x dj)" { fix y v obtain x where x_def: "x = \\ y" by simp hence "eval\\<^sub>1 F x dj = eval\\<^sub>1 G x dj" using 1 by metis moreover obtain r where r_def: "Some r = d\<^sub>1 F" unfolding d\<^sub>1_def by auto moreover obtain s where s_def: "Some s = d\<^sub>1 G" unfolding d\<^sub>1_def by auto ultimately have "(y \ ex1 r v) = (y \ ex1 s v)" by (simp add: d\<^sub>1.rep_eq ex1_def \\_surj x_def) hence "[\F,y\<^sup>P\ \<^bold>\ \G,y\<^sup>P\ in v]" apply - apply meta_solver using r_def s_def by (metis Semantics.d\<^sub>\_proper option.inject) } thus "[\<^bold>\x. \<^bold>\(\F,x\<^sup>P\ \<^bold>\ \G,x\<^sup>P\) in v]" using T6 T8 by fast qed text\ \begin{remark} Materially equivalent relations are equal in the embedded logic if and only if they also coincide in all other states. \end{remark} \ lemma mat_eq_is_eq_if_eq_forall_j: assumes "[\<^bold>\ x . \<^bold>\(\F,x\<^sup>P\ \<^bold>\ \G,x\<^sup>P\) in v]" shows "[F \<^bold>= G in v] \ (\ s . s \ dj \ (\ x . (eval\\<^sub>1 F) x s = (eval\\<^sub>1 G) x s))" proof interpret MetaSolver . assume "[F \<^bold>= G in v]" hence "F = G" apply - unfolding identity_\\<^sub>1_def by meta_solver thus "\s. s \ dj \ (\x. eval\\<^sub>1 F x s = eval\\<^sub>1 G x s)" by auto next interpret MetaSolver . assume "\s. s \ dj \ (\x. eval\\<^sub>1 F x s = eval\\<^sub>1 G x s)" moreover have "((\ x . (eval\\<^sub>1 F) x dj) = (\ x . (eval\\<^sub>1 G) x dj))" using assms mat_eq_is_eq_dj by auto ultimately have "\s x. eval\\<^sub>1 F x s = eval\\<^sub>1 G x s" by metis hence "eval\\<^sub>1 F = eval\\<^sub>1 G" by blast hence "F = G" by (metis eval\\<^sub>1_inverse) thus "[F \<^bold>= G in v]" unfolding identity_\\<^sub>1_def using Eq\<^sub>1I by auto qed text\ \begin{remark} Under the assumption that all properties behave in all states like in the actual state the defined equality degenerates to material equality. \end{remark} \ lemma assumes "\ F x s . (eval\\<^sub>1 F) x s = (eval\\<^sub>1 F) x dj" shows "[\<^bold>\ x . \<^bold>\(\F,x\<^sup>P\ \<^bold>\ \G,x\<^sup>P\) in v] \ [F \<^bold>= G in v]" by (metis (no_types) MetaSolver.Eq\<^sub>1S assms identity_\\<^sub>1_def mat_eq_is_eq_dj mat_eq_is_eq_if_eq_forall_j) subsection\Lambda Expressions\ text\\label{TAO_SanityTests_MetaLambda}\ lemma lambda_interpret_1: assumes "[a \<^bold>= b in v]" shows "(\<^bold>\x. \R,x\<^sup>P,a\) = (\<^bold>\x . \R,x\<^sup>P, b\)" proof - have "a = b" using MetaSolver.Eq\S Semantics.d\<^sub>\_inject assms identity_\_def by auto thus ?thesis by simp qed lemma lambda_interpret_2: assumes "[a \<^bold>= (\<^bold>\y. \G,y\<^sup>P\) in v]" shows "(\<^bold>\x. \R,x\<^sup>P,a\) = (\<^bold>\x . \R,x\<^sup>P, \<^bold>\y. \G,y\<^sup>P\\)" proof - have "a = (\<^bold>\y. \G,y\<^sup>P\)" using MetaSolver.Eq\S Semantics.d\<^sub>\_inject assms identity_\_def by auto thus ?thesis by simp qed end (*<*) end (*>*)