src/ZF/ex/PropLog.thy
author clasohm
Tue, 06 Feb 1996 12:27:17 +0100
changeset 1478 2b8c2a7547ab
parent 1401 0c439768f45c
child 3840 e0baea4d485a
permissions -rw-r--r--
expanded tabs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     1
(*  Title:      ZF/ex/PropLog.thy
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     3
    Author:     Tobias Nipkow & Lawrence C Paulson
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
     6
Datatype definition of propositional logic formulae and inductive definition
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
     7
of the propositional tautologies.
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
935
a94ef3eed456 Changed Univ to Datatype in parents
lcp
parents: 753
diff changeset
    10
PropLog = Finite + Datatype +
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    11
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    12
(** The datatype of propositions; note mixfix syntax **)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
consts
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1155
diff changeset
    14
  prop     :: i
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    16
datatype
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    17
  "prop" = Fls
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    18
         | Var ("n: nat")                       ("#_" [100] 100)
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    19
         | "=>" ("p: prop", "q: prop")          (infixr 90)
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    20
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    21
(** The proof system **)
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    22
consts
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1155
diff changeset
    23
  thms     :: i => i
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    24
  "|-"     :: [i,i] => o                        (infixl 50)
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
translations
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
  "H |- p" == "p : thms(H)"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    29
inductive
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    30
  domains "thms(H)" <= "prop"
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    31
  intrs
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    32
    H  "[| p:H;  p:prop |] ==> H |- p"
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    33
    K  "[| p:prop;  q:prop |] ==> H |- p=>q=>p"
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    34
    S  "[| p:prop;  q:prop;  r:prop |] ==> H |- (p=>q=>r) => (p=>q) => p=>r"
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    35
    DN "p:prop ==> H |- ((p=>Fls) => Fls) => p"
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    36
    MP "[| H |- p=>q;  H |- p;  p:prop;  q:prop |] ==> H |- q"
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    37
  type_intrs "prop.intrs"
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    38
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    39
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    40
(** The semantics **)
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    41
consts
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1155
diff changeset
    42
  prop_rec :: [i, i, i=>i, [i,i,i,i]=>i] => i
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1155
diff changeset
    43
  is_true  :: [i,i] => o
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
    44
  "|="     :: [i,i] => o                        (infixl 50)
1401
0c439768f45c removed quotes from consts and syntax sections
clasohm
parents: 1155
diff changeset
    45
  hyps     :: [i,i] => i
515
abcc438e7c27 installation of new inductive/datatype sections
lcp
parents: 501
diff changeset
    46
753
ec86863e87c8 replaced "rules" by "defs"
lcp
parents: 515
diff changeset
    47
defs
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    48
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
  prop_rec_def
1155
928a16e02f9f removed \...\ inside strings
clasohm
parents: 935
diff changeset
    50
   "prop_rec(p,b,c,h) == 
928a16e02f9f removed \...\ inside strings
clasohm
parents: 935
diff changeset
    51
   Vrec(p, %p g.prop_case(b, c, %x y. h(x, y, g`x, g`y), p))"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
  (** Semantics of propositional logic **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
  is_true_def
1155
928a16e02f9f removed \...\ inside strings
clasohm
parents: 935
diff changeset
    55
   "is_true(p,t) == prop_rec(p, 0,  %v. if(v:t, 1, 0), 
928a16e02f9f removed \...\ inside strings
clasohm
parents: 935
diff changeset
    56
                               %p q tp tq. if(tp=1,tq,1))         =  1"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
501
9c724f7085f9 ZF/ex/PropLog/sat_XXX: renamed logcon_XXX, since the relation is logical
lcp
parents: 0
diff changeset
    58
  (*Logical consequence: for every valuation, if all elements of H are true
9c724f7085f9 ZF/ex/PropLog/sat_XXX: renamed logcon_XXX, since the relation is logical
lcp
parents: 0
diff changeset
    59
     then so is p*)
9c724f7085f9 ZF/ex/PropLog/sat_XXX: renamed logcon_XXX, since the relation is logical
lcp
parents: 0
diff changeset
    60
  logcon_def  "H |= p == ALL t. (ALL q:H. is_true(q,t)) --> is_true(p,t)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
  (** A finite set of hypotheses from t and the Vars in p **)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
  hyps_def
1155
928a16e02f9f removed \...\ inside strings
clasohm
parents: 935
diff changeset
    64
   "hyps(p,t) == prop_rec(p, 0,  %v. {if(v:t, #v, #v=>Fls)}, 
928a16e02f9f removed \...\ inside strings
clasohm
parents: 935
diff changeset
    65
                            %p q Hp Hq. Hp Un Hq)"
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    66
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
end