src/HOL/ATP.thy
author blanchet
Tue May 13 11:10:23 2014 +0200 (2014-05-13)
changeset 56946 10d9bd4ea94f
parent 54148 c8cc5ab4a863
child 57255 488046fdda59
permissions -rw-r--r--
hide more internal names
     1 (*  Title:      HOL/ATP.thy
     2     Author:     Fabian Immler, TU Muenchen
     3     Author:     Jasmin Blanchette, TU Muenchen
     4 *)
     5 
     6 header {* Automatic Theorem Provers (ATPs) *}
     7 
     8 theory ATP
     9 imports Meson
    10 begin
    11 
    12 ML_file "Tools/lambda_lifting.ML"
    13 ML_file "Tools/monomorph.ML"
    14 ML_file "Tools/ATP/atp_util.ML"
    15 ML_file "Tools/ATP/atp_problem.ML"
    16 ML_file "Tools/ATP/atp_proof.ML"
    17 ML_file "Tools/ATP/atp_proof_redirect.ML"
    18 
    19 
    20 subsection {* Higher-order reasoning helpers *}
    21 
    22 definition fFalse :: bool where
    23 "fFalse \<longleftrightarrow> False"
    24 
    25 definition fTrue :: bool where
    26 "fTrue \<longleftrightarrow> True"
    27 
    28 definition fNot :: "bool \<Rightarrow> bool" where
    29 "fNot P \<longleftrightarrow> \<not> P"
    30 
    31 definition fComp :: "('a \<Rightarrow> bool) \<Rightarrow> 'a \<Rightarrow> bool" where
    32 "fComp P = (\<lambda>x. \<not> P x)"
    33 
    34 definition fconj :: "bool \<Rightarrow> bool \<Rightarrow> bool" where
    35 "fconj P Q \<longleftrightarrow> P \<and> Q"
    36 
    37 definition fdisj :: "bool \<Rightarrow> bool \<Rightarrow> bool" where
    38 "fdisj P Q \<longleftrightarrow> P \<or> Q"
    39 
    40 definition fimplies :: "bool \<Rightarrow> bool \<Rightarrow> bool" where
    41 "fimplies P Q \<longleftrightarrow> (P \<longrightarrow> Q)"
    42 
    43 definition fAll :: "('a \<Rightarrow> bool) \<Rightarrow> bool" where
    44 "fAll P \<longleftrightarrow> All P"
    45 
    46 definition fEx :: "('a \<Rightarrow> bool) \<Rightarrow> bool" where
    47 "fEx P \<longleftrightarrow> Ex P"
    48 
    49 definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where
    50 "fequal x y \<longleftrightarrow> (x = y)"
    51 
    52 lemma fTrue_ne_fFalse: "fFalse \<noteq> fTrue"
    53 unfolding fFalse_def fTrue_def by simp
    54 
    55 lemma fNot_table:
    56 "fNot fFalse = fTrue"
    57 "fNot fTrue = fFalse"
    58 unfolding fFalse_def fTrue_def fNot_def by auto
    59 
    60 lemma fconj_table:
    61 "fconj fFalse P = fFalse"
    62 "fconj P fFalse = fFalse"
    63 "fconj fTrue fTrue = fTrue"
    64 unfolding fFalse_def fTrue_def fconj_def by auto
    65 
    66 lemma fdisj_table:
    67 "fdisj fTrue P = fTrue"
    68 "fdisj P fTrue = fTrue"
    69 "fdisj fFalse fFalse = fFalse"
    70 unfolding fFalse_def fTrue_def fdisj_def by auto
    71 
    72 lemma fimplies_table:
    73 "fimplies P fTrue = fTrue"
    74 "fimplies fFalse P = fTrue"
    75 "fimplies fTrue fFalse = fFalse"
    76 unfolding fFalse_def fTrue_def fimplies_def by auto
    77 
    78 lemma fAll_table:
    79 "Ex (fComp P) \<or> fAll P = fTrue"
    80 "All P \<or> fAll P = fFalse"
    81 unfolding fFalse_def fTrue_def fComp_def fAll_def by auto
    82 
    83 lemma fEx_table:
    84 "All (fComp P) \<or> fEx P = fTrue"
    85 "Ex P \<or> fEx P = fFalse"
    86 unfolding fFalse_def fTrue_def fComp_def fEx_def by auto
    87 
    88 lemma fequal_table:
    89 "fequal x x = fTrue"
    90 "x = y \<or> fequal x y = fFalse"
    91 unfolding fFalse_def fTrue_def fequal_def by auto
    92 
    93 lemma fNot_law:
    94 "fNot P \<noteq> P"
    95 unfolding fNot_def by auto
    96 
    97 lemma fComp_law:
    98 "fComp P x \<longleftrightarrow> \<not> P x"
    99 unfolding fComp_def ..
   100 
   101 lemma fconj_laws:
   102 "fconj P P \<longleftrightarrow> P"
   103 "fconj P Q \<longleftrightarrow> fconj Q P"
   104 "fNot (fconj P Q) \<longleftrightarrow> fdisj (fNot P) (fNot Q)"
   105 unfolding fNot_def fconj_def fdisj_def by auto
   106 
   107 lemma fdisj_laws:
   108 "fdisj P P \<longleftrightarrow> P"
   109 "fdisj P Q \<longleftrightarrow> fdisj Q P"
   110 "fNot (fdisj P Q) \<longleftrightarrow> fconj (fNot P) (fNot Q)"
   111 unfolding fNot_def fconj_def fdisj_def by auto
   112 
   113 lemma fimplies_laws:
   114 "fimplies P Q \<longleftrightarrow> fdisj (\<not> P) Q"
   115 "fNot (fimplies P Q) \<longleftrightarrow> fconj P (fNot Q)"
   116 unfolding fNot_def fconj_def fdisj_def fimplies_def by auto
   117 
   118 lemma fAll_law:
   119 "fNot (fAll R) \<longleftrightarrow> fEx (fComp R)"
   120 unfolding fNot_def fComp_def fAll_def fEx_def by auto
   121 
   122 lemma fEx_law:
   123 "fNot (fEx R) \<longleftrightarrow> fAll (fComp R)"
   124 unfolding fNot_def fComp_def fAll_def fEx_def by auto
   125 
   126 lemma fequal_laws:
   127 "fequal x y = fequal y x"
   128 "fequal x y = fFalse \<or> fequal y z = fFalse \<or> fequal x z = fTrue"
   129 "fequal x y = fFalse \<or> fequal (f x) (f y) = fTrue"
   130 unfolding fFalse_def fTrue_def fequal_def by auto
   131 
   132 
   133 subsection {* Setup *}
   134 
   135 ML_file "Tools/ATP/atp_problem_generate.ML"
   136 ML_file "Tools/ATP/atp_proof_reconstruct.ML"
   137 ML_file "Tools/ATP/atp_systems.ML"
   138 
   139 setup ATP_Systems.setup
   140 
   141 end