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