ex/PropLog.thy
author nipkow
Tue, 30 Aug 1994 10:05:46 +0200
changeset 130 e7dcf3c07865
child 135 a06a2d930a03
permissions -rw-r--r--
Updated PL to PropLog using Larrys ind. defs.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
130
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
     1
(*  Title: 	HOL/ex/pl.thy
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
     2
    ID:         $Id$
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
     3
    Author: 	Tobias Nipkow
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
     4
    Copyright   1994  TU Muenchen
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
     5
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
     6
Inductive definition of propositional logic.
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
     7
*)
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
     8
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
     9
PropLog = Finite +
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    10
datatype
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    11
    'a pl = false | var ('a) ("#_" [1000]) | "->" ('a pl,'a pl) (infixr 90)
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    12
consts
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    13
  thms :: "'a pl set => 'a pl set"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    14
  "|-" 	:: "['a pl set, 'a pl] => bool"	(infixl 50)
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    15
  "|="	:: "['a pl set, 'a pl] => bool"	(infixl 50)
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    16
  eval2	:: "['a pl, 'a set] => bool"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    17
  eval	:: "['a set, 'a pl] => bool"	("_[_]" [100,0] 100)
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    18
  hyps	:: "['a pl, 'a set] => 'a pl set"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    19
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    20
translations
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    21
  "H |- p" == "p : thms(H)"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    22
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    23
inductive "thms(H)"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    24
  intrs
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    25
  H   "p:H ==> H |- p"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    26
  K   "H |- p->q->p"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    27
  S   "H |- (p->q->r) -> (p->q) -> p->r"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    28
  DN  "H |- ((p->false) -> false) -> p"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    29
  MP  "[| H |- p->q; H |- p |] ==> H |- q"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    30
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    31
rules
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    32
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    33
  (** Proof theory for propositional logic
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    34
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    35
  axK_def   "axK ==  {x . ? p q.   x = p->q->p}"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    36
  axS_def   "axS ==  {x . ? p q r. x = (p->q->r) -> (p->q) -> p->r}"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    37
  axDN_def  "axDN == {x . ? p.     x = ((p->false) -> false) -> p}"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    38
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    39
  (*the use of subsets simplifies the proof of monotonicity*)
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    40
  ruleMP_def  "ruleMP(X) == {q. ? p:X. p->q : X}"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    41
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    42
  thms_def
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    43
   "thms(H) == lfp(%X. H Un axK Un axS Un axDN Un ruleMP(X))"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    44
  
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    45
  conseq_def  "H |- p == p : thms(H)"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    46
**)
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    47
  sat_def "H |= p  ==  (!tt. (!q:H. tt[q]) --> tt[p])"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    48
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    49
  eval_def "tt[p] == eval2(p,tt)"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    50
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    51
primrec eval2 pl
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    52
  eval2_false "eval2(false) = (%x.False)"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    53
  eval2_var   "eval2(#v) = (%tt.v:tt)"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    54
  eval2_imp   "eval2(p->q) = (%tt.eval2(p,tt)-->eval2(q,tt))"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    55
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    56
primrec hyps pl
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    57
  hyps_false "hyps(false) = (%tt.{})"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    58
  hyps_var   "hyps(#v) = (%tt.{if(v:tt, #v, #v->false)})"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    59
  hyps_imp   "hyps(p->q) = (%tt.hyps(p,tt) Un hyps(q,tt))"
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    60
e7dcf3c07865 Updated PL to PropLog using Larrys ind. defs.
nipkow
parents:
diff changeset
    61
end