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