src/HOL/ATP.thy
author blanchet
Sun May 04 18:14:58 2014 +0200 (2014-05-04)
changeset 56846 9df717fef2bb
parent 54148 c8cc5ab4a863
child 56946 10d9bd4ea94f
permissions -rw-r--r--
renamed 'xxx_size' to 'size_xxx' for old datatype package
     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 subsection {* Higher-order reasoning helpers *}
    20 
    21 definition fFalse :: bool where
    22 "fFalse \<longleftrightarrow> False"
    23 
    24 definition fTrue :: bool where
    25 "fTrue \<longleftrightarrow> True"
    26 
    27 definition fNot :: "bool \<Rightarrow> bool" where
    28 "fNot P \<longleftrightarrow> \<not> P"
    29 
    30 definition fComp :: "('a \<Rightarrow> bool) \<Rightarrow> 'a \<Rightarrow> bool" where
    31 "fComp P = (\<lambda>x. \<not> P x)"
    32 
    33 definition fconj :: "bool \<Rightarrow> bool \<Rightarrow> bool" where
    34 "fconj P Q \<longleftrightarrow> P \<and> Q"
    35 
    36 definition fdisj :: "bool \<Rightarrow> bool \<Rightarrow> bool" where
    37 "fdisj P Q \<longleftrightarrow> P \<or> Q"
    38 
    39 definition fimplies :: "bool \<Rightarrow> bool \<Rightarrow> bool" where
    40 "fimplies P Q \<longleftrightarrow> (P \<longrightarrow> Q)"
    41 
    42 definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where
    43 "fequal x y \<longleftrightarrow> (x = y)"
    44 
    45 definition fAll :: "('a \<Rightarrow> bool) \<Rightarrow> bool" where
    46 "fAll P \<longleftrightarrow> All P"
    47 
    48 definition fEx :: "('a \<Rightarrow> bool) \<Rightarrow> bool" where
    49 "fEx P \<longleftrightarrow> Ex P"
    50 
    51 lemma fTrue_ne_fFalse: "fFalse \<noteq> fTrue"
    52 unfolding fFalse_def fTrue_def by simp
    53 
    54 lemma fNot_table:
    55 "fNot fFalse = fTrue"
    56 "fNot fTrue = fFalse"
    57 unfolding fFalse_def fTrue_def fNot_def by auto
    58 
    59 lemma fconj_table:
    60 "fconj fFalse P = fFalse"
    61 "fconj P fFalse = fFalse"
    62 "fconj fTrue fTrue = fTrue"
    63 unfolding fFalse_def fTrue_def fconj_def by auto
    64 
    65 lemma fdisj_table:
    66 "fdisj fTrue P = fTrue"
    67 "fdisj P fTrue = fTrue"
    68 "fdisj fFalse fFalse = fFalse"
    69 unfolding fFalse_def fTrue_def fdisj_def by auto
    70 
    71 lemma fimplies_table:
    72 "fimplies P fTrue = fTrue"
    73 "fimplies fFalse P = fTrue"
    74 "fimplies fTrue fFalse = fFalse"
    75 unfolding fFalse_def fTrue_def fimplies_def by auto
    76 
    77 lemma fequal_table:
    78 "fequal x x = fTrue"
    79 "x = y \<or> fequal x y = fFalse"
    80 unfolding fFalse_def fTrue_def fequal_def by auto
    81 
    82 lemma fAll_table:
    83 "Ex (fComp P) \<or> fAll P = fTrue"
    84 "All P \<or> fAll P = fFalse"
    85 unfolding fFalse_def fTrue_def fComp_def fAll_def by auto
    86 
    87 lemma fEx_table:
    88 "All (fComp P) \<or> fEx P = fTrue"
    89 "Ex P \<or> fEx P = fFalse"
    90 unfolding fFalse_def fTrue_def fComp_def fEx_def by auto
    91 
    92 lemma fNot_law:
    93 "fNot P \<noteq> P"
    94 unfolding fNot_def by auto
    95 
    96 lemma fComp_law:
    97 "fComp P x \<longleftrightarrow> \<not> P x"
    98 unfolding fComp_def ..
    99 
   100 lemma fconj_laws:
   101 "fconj P P \<longleftrightarrow> P"
   102 "fconj P Q \<longleftrightarrow> fconj Q P"
   103 "fNot (fconj P Q) \<longleftrightarrow> fdisj (fNot P) (fNot Q)"
   104 unfolding fNot_def fconj_def fdisj_def by auto
   105 
   106 lemma fdisj_laws:
   107 "fdisj P P \<longleftrightarrow> P"
   108 "fdisj P Q \<longleftrightarrow> fdisj Q P"
   109 "fNot (fdisj P Q) \<longleftrightarrow> fconj (fNot P) (fNot Q)"
   110 unfolding fNot_def fconj_def fdisj_def by auto
   111 
   112 lemma fimplies_laws:
   113 "fimplies P Q \<longleftrightarrow> fdisj (\<not> P) Q"
   114 "fNot (fimplies P Q) \<longleftrightarrow> fconj P (fNot Q)"
   115 unfolding fNot_def fconj_def fdisj_def fimplies_def by auto
   116 
   117 lemma fequal_laws:
   118 "fequal x y = fequal y x"
   119 "fequal x y = fFalse \<or> fequal y z = fFalse \<or> fequal x z = fTrue"
   120 "fequal x y = fFalse \<or> fequal (f x) (f y) = fTrue"
   121 unfolding fFalse_def fTrue_def fequal_def by auto
   122 
   123 lemma fAll_law:
   124 "fNot (fAll R) \<longleftrightarrow> fEx (fComp R)"
   125 unfolding fNot_def fComp_def fAll_def fEx_def by auto
   126 
   127 lemma fEx_law:
   128 "fNot (fEx R) \<longleftrightarrow> fAll (fComp R)"
   129 unfolding fNot_def fComp_def fAll_def fEx_def by auto
   130 
   131 subsection {* Setup *}
   132 
   133 ML_file "Tools/ATP/atp_problem_generate.ML"
   134 ML_file "Tools/ATP/atp_proof_reconstruct.ML"
   135 ML_file "Tools/ATP/atp_systems.ML"
   136 
   137 setup ATP_Systems.setup
   138 
   139 end