src/HOL/BCV/Fixpoint.thy
author wenzelm
Mon, 29 Nov 1999 15:52:49 +0100
changeset 8039 a901bafe4578
parent 7626 5997f35954d7
permissions -rw-r--r--
Goal: tuned pris;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7626
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     1
(*  Title:      HOL/BCV/Fixpoint.thy
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     2
    ID:         $Id$
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     3
    Author:     Tobias Nipkow
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     4
    Copyright   1999 TUM
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     5
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     6
Searching for a fixpoint.
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     7
*)
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     8
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
     9
Fixpoint = SemiLattice +
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    10
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    11
consts fix :: "('a => 'a option) * 'a => bool"
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    12
recdef fix
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    13
 "{((nxt,t),(nxs,s)) . nxt=nxs &
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    14
      ~(? f. f 0 = s & (!i. nxt (f i) = Some(f(i+1)) & f(i+1) ~= f i)) &
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    15
      nxs s = Some t & t ~= s}"
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    16
"fix(next,s) =
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    17
  (if (? f. f 0 = s & (!i. next (f i) = Some(f(i+1)) & f(i+1) ~= f i))
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    18
   then arbitrary
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    19
   else case next s of None => False |
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    20
                       Some t => if t=s then True else fix(next,t))"
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    21
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    22
5997f35954d7 A new theory: a model of bytecode verification.
nipkow
parents:
diff changeset
    23
end