src/HOL/ATP.thy
author blanchet
Mon May 21 10:39:32 2012 +0200 (2012-05-21)
changeset 47946 33afcfad3f8d
parent 46320 0b8b73b49848
child 48891 c0eafbd55de3
permissions -rw-r--r--
add an experimental "aggressive" mode to Sledgehammer, to experiment with more complete translations of higher-order features without breaking "metis"
     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 uses "Tools/lambda_lifting.ML"
    11      "Tools/monomorph.ML"
    12      "Tools/ATP/atp_util.ML"
    13      "Tools/ATP/atp_problem.ML"
    14      "Tools/ATP/atp_proof.ML"
    15      "Tools/ATP/atp_proof_redirect.ML"
    16      ("Tools/ATP/atp_problem_generate.ML")
    17      ("Tools/ATP/atp_proof_reconstruct.ML")
    18      ("Tools/ATP/atp_systems.ML")
    19 begin
    20 
    21 subsection {* Higher-order reasoning helpers *}
    22 
    23 definition fFalse :: bool where [no_atp]:
    24 "fFalse \<longleftrightarrow> False"
    25 
    26 definition fTrue :: bool where [no_atp]:
    27 "fTrue \<longleftrightarrow> True"
    28 
    29 definition fNot :: "bool \<Rightarrow> bool" where [no_atp]:
    30 "fNot P \<longleftrightarrow> \<not> P"
    31 
    32 definition fComp :: "('a \<Rightarrow> bool) \<Rightarrow> 'a \<Rightarrow> bool" where [no_atp]:
    33 "fComp P = (\<lambda>x. \<not> P x)"
    34 
    35 definition fconj :: "bool \<Rightarrow> bool \<Rightarrow> bool" where [no_atp]:
    36 "fconj P Q \<longleftrightarrow> P \<and> Q"
    37 
    38 definition fdisj :: "bool \<Rightarrow> bool \<Rightarrow> bool" where [no_atp]:
    39 "fdisj P Q \<longleftrightarrow> P \<or> Q"
    40 
    41 definition fimplies :: "bool \<Rightarrow> bool \<Rightarrow> bool" where [no_atp]:
    42 "fimplies P Q \<longleftrightarrow> (P \<longrightarrow> Q)"
    43 
    44 definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where [no_atp]:
    45 "fequal x y \<longleftrightarrow> (x = y)"
    46 
    47 definition fAll :: "('a \<Rightarrow> bool) \<Rightarrow> bool" where [no_atp]:
    48 "fAll P \<longleftrightarrow> All P"
    49 
    50 definition fEx :: "('a \<Rightarrow> bool) \<Rightarrow> bool" where [no_atp]:
    51 "fEx P \<longleftrightarrow> Ex P"
    52 
    53 lemma fTrue_ne_fFalse: "fFalse \<noteq> fTrue"
    54 unfolding fFalse_def fTrue_def by simp
    55 
    56 lemma fNot_table:
    57 "fNot fFalse = fTrue"
    58 "fNot fTrue = fFalse"
    59 unfolding fFalse_def fTrue_def fNot_def by auto
    60 
    61 lemma fconj_table:
    62 "fconj fFalse P = fFalse"
    63 "fconj P fFalse = fFalse"
    64 "fconj fTrue fTrue = fTrue"
    65 unfolding fFalse_def fTrue_def fconj_def by auto
    66 
    67 lemma fdisj_table:
    68 "fdisj fTrue P = fTrue"
    69 "fdisj P fTrue = fTrue"
    70 "fdisj fFalse fFalse = fFalse"
    71 unfolding fFalse_def fTrue_def fdisj_def by auto
    72 
    73 lemma fimplies_table:
    74 "fimplies P fTrue = fTrue"
    75 "fimplies fFalse P = fTrue"
    76 "fimplies fTrue fFalse = fFalse"
    77 unfolding fFalse_def fTrue_def fimplies_def by auto
    78 
    79 lemma fequal_table:
    80 "fequal x x = fTrue"
    81 "x = y \<or> fequal x y = fFalse"
    82 unfolding fFalse_def fTrue_def fequal_def by auto
    83 
    84 lemma fAll_table:
    85 "Ex (fComp P) \<or> fAll P = fTrue"
    86 "All P \<or> fAll P = fFalse"
    87 unfolding fFalse_def fTrue_def fComp_def fAll_def by auto
    88 
    89 lemma fEx_table:
    90 "All (fComp P) \<or> fEx P = fTrue"
    91 "Ex P \<or> fEx P = fFalse"
    92 unfolding fFalse_def fTrue_def fComp_def fEx_def by auto
    93 
    94 lemma fNot_law:
    95 "fNot P \<noteq> P"
    96 unfolding fNot_def by auto
    97 
    98 lemma fComp_law:
    99 "fComp P x \<longleftrightarrow> \<not> P x"
   100 unfolding fComp_def ..
   101 
   102 lemma fconj_laws:
   103 "fconj P P \<longleftrightarrow> P"
   104 "fconj P Q \<longleftrightarrow> fconj Q P"
   105 "fNot (fconj P Q) \<longleftrightarrow> fdisj (fNot P) (fNot Q)"
   106 unfolding fNot_def fconj_def fdisj_def by auto
   107 
   108 lemma fdisj_laws:
   109 "fdisj P P \<longleftrightarrow> P"
   110 "fdisj P Q \<longleftrightarrow> fdisj Q P"
   111 "fNot (fdisj P Q) \<longleftrightarrow> fconj (fNot P) (fNot Q)"
   112 unfolding fNot_def fconj_def fdisj_def by auto
   113 
   114 lemma fimplies_laws:
   115 "fimplies P Q \<longleftrightarrow> fdisj (\<not> P) Q"
   116 "fNot (fimplies P Q) \<longleftrightarrow> fconj P (fNot Q)"
   117 unfolding fNot_def fconj_def fdisj_def fimplies_def by auto
   118 
   119 lemma fequal_laws:
   120 "fequal x y = fequal y x"
   121 "fequal x y = fFalse \<or> fequal y z = fFalse \<or> fequal x z = fTrue"
   122 "fequal x y = fFalse \<or> fequal (f x) (f y) = fTrue"
   123 unfolding fFalse_def fTrue_def fequal_def by auto
   124 
   125 lemma fAll_law:
   126 "fNot (fAll R) \<longleftrightarrow> fEx (fComp R)"
   127 unfolding fNot_def fComp_def fAll_def fEx_def by auto
   128 
   129 lemma fEx_law:
   130 "fNot (fEx R) \<longleftrightarrow> fAll (fComp R)"
   131 unfolding fNot_def fComp_def fAll_def fEx_def by auto
   132 
   133 subsection {* Setup *}
   134 
   135 use "Tools/ATP/atp_problem_generate.ML"
   136 use "Tools/ATP/atp_proof_reconstruct.ML"
   137 use "Tools/ATP/atp_systems.ML"
   138 
   139 setup ATP_Systems.setup
   140 
   141 end