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
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"
wenzelm@48891
    14
ML_file "Tools/ATP/atp_util.ML"
wenzelm@48891
    15
ML_file "Tools/ATP/atp_problem.ML"
wenzelm@48891
    16
ML_file "Tools/ATP/atp_proof.ML"
wenzelm@48891
    17
ML_file "Tools/ATP/atp_proof_redirect.ML"
wenzelm@48891
    18
blanchet@56946
    19
blanchet@43085
    20
subsection {* Higher-order reasoning helpers *}
blanchet@43085
    21
blanchet@54148
    22
definition fFalse :: bool where
blanchet@43085
    23
"fFalse \<longleftrightarrow> False"
blanchet@43085
    24
blanchet@54148
    25
definition fTrue :: bool where
blanchet@43085
    26
"fTrue \<longleftrightarrow> True"
blanchet@43085
    27
blanchet@54148
    28
definition fNot :: "bool \<Rightarrow> bool" where
blanchet@43085
    29
"fNot P \<longleftrightarrow> \<not> P"
blanchet@43085
    30
blanchet@54148
    31
definition fComp :: "('a \<Rightarrow> bool) \<Rightarrow> 'a \<Rightarrow> bool" where
blanchet@47946
    32
"fComp P = (\<lambda>x. \<not> P x)"
blanchet@47946
    33
blanchet@54148
    34
definition fconj :: "bool \<Rightarrow> bool \<Rightarrow> bool" where
blanchet@43085
    35
"fconj P Q \<longleftrightarrow> P \<and> Q"
blanchet@43085
    36
blanchet@54148
    37
definition fdisj :: "bool \<Rightarrow> bool \<Rightarrow> bool" where
blanchet@43085
    38
"fdisj P Q \<longleftrightarrow> P \<or> Q"
blanchet@43085
    39
blanchet@54148
    40
definition fimplies :: "bool \<Rightarrow> bool \<Rightarrow> bool" where
blanchet@43085
    41
"fimplies P Q \<longleftrightarrow> (P \<longrightarrow> Q)"
blanchet@43085
    42
blanchet@54148
    43
definition fAll :: "('a \<Rightarrow> bool) \<Rightarrow> bool" where
nik@43678
    44
"fAll P \<longleftrightarrow> All P"
nik@43678
    45
blanchet@54148
    46
definition fEx :: "('a \<Rightarrow> bool) \<Rightarrow> bool" where
nik@43678
    47
"fEx P \<longleftrightarrow> Ex P"
blanchet@43085
    48
blanchet@56946
    49
definition fequal :: "'a \<Rightarrow> 'a \<Rightarrow> bool" where
blanchet@56946
    50
"fequal x y \<longleftrightarrow> (x = y)"
blanchet@56946
    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 fAll_table:
blanchet@47946
    79
"Ex (fComp P) \<or> fAll P = fTrue"
blanchet@47946
    80
"All P \<or> fAll P = fFalse"
blanchet@47946
    81
unfolding fFalse_def fTrue_def fComp_def fAll_def by auto
blanchet@47946
    82
blanchet@47946
    83
lemma fEx_table:
blanchet@47946
    84
"All (fComp P) \<or> fEx P = fTrue"
blanchet@47946
    85
"Ex P \<or> fEx P = fFalse"
blanchet@47946
    86
unfolding fFalse_def fTrue_def fComp_def fEx_def by auto
blanchet@47946
    87
blanchet@56946
    88
lemma fequal_table:
blanchet@56946
    89
"fequal x x = fTrue"
blanchet@56946
    90
"x = y \<or> fequal x y = fFalse"
blanchet@56946
    91
unfolding fFalse_def fTrue_def fequal_def by auto
blanchet@56946
    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 fAll_law:
blanchet@47946
   119
"fNot (fAll R) \<longleftrightarrow> fEx (fComp R)"
blanchet@47946
   120
unfolding fNot_def fComp_def fAll_def fEx_def by auto
blanchet@47946
   121
blanchet@47946
   122
lemma fEx_law:
blanchet@47946
   123
"fNot (fEx R) \<longleftrightarrow> fAll (fComp R)"
blanchet@47946
   124
unfolding fNot_def fComp_def fAll_def fEx_def by auto
blanchet@47946
   125
blanchet@56946
   126
lemma fequal_laws:
blanchet@56946
   127
"fequal x y = fequal y x"
blanchet@56946
   128
"fequal x y = fFalse \<or> fequal y z = fFalse \<or> fequal x z = fTrue"
blanchet@56946
   129
"fequal x y = fFalse \<or> fequal (f x) (f y) = fTrue"
blanchet@56946
   130
unfolding fFalse_def fTrue_def fequal_def by auto
blanchet@56946
   131
blanchet@56946
   132
blanchet@43085
   133
subsection {* Setup *}
blanchet@43085
   134
wenzelm@48891
   135
ML_file "Tools/ATP/atp_problem_generate.ML"
wenzelm@48891
   136
ML_file "Tools/ATP/atp_proof_reconstruct.ML"
wenzelm@48891
   137
ML_file "Tools/ATP/atp_systems.ML"
blanchet@43085
   138
blanchet@39951
   139
setup ATP_Systems.setup
blanchet@39951
   140
blanchet@39951
   141
end