src/HOL/BCV/Semilat.thy
author nipkow
Fri, 01 Sep 2000 18:29:52 +0200
changeset 9791 a39e5d43de55
permissions -rw-r--r--
Completely new version of BCV
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9791
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     1
(*  Title:      HOL/BCV/Semilat.thy
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     2
    ID:         $Id$
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     3
    Author:     Tobias Nipkow
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     4
    Copyright   2000 TUM
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     5
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     6
Semilattices
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     7
*)
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     8
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
     9
Semilat = Main +
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    10
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    11
types 'a ord    = 'a => 'a => bool
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    12
      'a binop  = 'a => 'a => 'a
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    13
      'a sl     = "'a set * 'a ord * 'a binop"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    14
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    15
consts
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    16
 "@lesub"   :: 'a => 'a ord => 'a => bool ("(_ /<='__ _)" [50, 1000, 51] 50)
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    17
 "@lesssub" :: 'a => 'a ord => 'a => bool ("(_ /<'__ _)" [50, 1000, 51] 50)
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    18
defs
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    19
lesub_def   "x <=_r y == r x y"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    20
lesssub_def "x <_r y  == x <=_r y & x ~= y"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    21
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    22
consts
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    23
 "@plussub" :: 'a => ('a => 'b => 'c) => 'b => 'c ("(_ /+'__ _)" [65, 1000, 66] 65)
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    24
defs
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    25
plussub_def   "x +_f y == f x y"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    26
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    27
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    28
constdefs
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    29
 ord :: "('a*'a)set => 'a ord"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    30
"ord r == %x y. (x,y):r"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    31
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    32
 order :: 'a ord => bool
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    33
"order r == (!x. x <=_r x) &
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    34
            (!x y. x <=_r y & y <=_r x --> x=y) &
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    35
            (!x y z. x <=_r y & y <=_r z --> x <=_r z)"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    36
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    37
 acc :: 'a ord => bool
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    38
"acc r == wf{(y,x) . x <_r y}"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    39
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    40
 top :: 'a ord => 'a => bool
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    41
"top r T == !x. x <=_r T"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    42
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    43
 closed :: 'a set => 'a binop => bool
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    44
"closed A f == !x:A. !y:A. x +_f y : A"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    45
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    46
 semilat :: "'a sl => bool"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    47
"semilat == %(A,r,f). order r & closed A f &
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    48
                (!x:A. !y:A. x <=_r x +_f y)  &
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    49
                (!x:A. !y:A. y <=_r x +_f y)  &
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    50
                (!x:A. !y:A. !z:A. x <=_r z & y <=_r z --> x +_f y <=_r z)"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    51
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    52
 is_ub :: "('a*'a)set => 'a => 'a => 'a => bool"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    53
"is_ub r x y u == (x,u):r & (y,u):r"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    54
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    55
 is_lub :: "('a*'a)set => 'a => 'a => 'a => bool"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    56
"is_lub r x y u == is_ub r x y u & (!z. is_ub r x y z --> (u,z):r)"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    57
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    58
 some_lub :: "('a*'a)set => 'a => 'a => 'a"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    59
"some_lub r x y == SOME z. is_lub r x y z"
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    60
a39e5d43de55 Completely new version of BCV
nipkow
parents:
diff changeset
    61
end