src/HOL/Induct/PropLog.thy
 author berghofe Fri, 24 Jul 1998 13:19:38 +0200 changeset 5184 9b8547a9496a parent 3842 b55686a7b22c child 9101 b643f4d7b9e9 permissions -rw-r--r--
```
(*  Title:      HOL/ex/PropLog.thy
ID:         \$Id\$
Author:     Tobias Nipkow

Inductive definition of propositional logic.
*)

PropLog = Finite + Datatype +

datatype
'a pl = false | var 'a ("#_" [1000]) | "->" ('a pl) ('a pl) (infixr 90)
consts
thms :: 'a pl set => 'a pl set
"|-"  :: ['a pl set, 'a pl] => bool   (infixl 50)
"|="  :: ['a pl set, 'a pl] => bool   (infixl 50)
eval2 :: ['a pl, 'a set] => bool
eval  :: ['a set, 'a pl] => bool      ("_[_]" [100,0] 100)
hyps  :: ['a pl, 'a set] => 'a pl set

translations
"H |- p" == "p : thms(H)"

inductive "thms(H)"
intrs
H   "p:H ==> H |- p"
K   "H |- p->q->p"
S   "H |- (p->q->r) -> (p->q) -> p->r"
DN  "H |- ((p->false) -> false) -> p"
MP  "[| H |- p->q; H |- p |] ==> H |- q"

defs
sat_def  "H |= p  ==  (!tt. (!q:H. tt[q]) --> tt[p])"
eval_def "tt[p] == eval2 p tt"

primrec
"eval2(false) = (%x. False)"
"eval2(#v) = (%tt. v:tt)"
"eval2(p->q) = (%tt. eval2 p tt-->eval2 q tt)"

primrec
"hyps(false) = (%tt.{})"
"hyps(#v) = (%tt.{if v:tt then #v else #v->false})"
"hyps(p->q) = (%tt. hyps p tt Un hyps q tt)"

end

```