src/HOL/UNITY/Reach.thy
author paulson
Fri, 31 Jul 1998 18:46:55 +0200
changeset 5232 e5a7cdd07ea5
parent 5071 548f398d770b
child 5240 bbcd79ef7cf2
permissions -rw-r--r--
Tidied; uses records
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     1
(*  Title:      HOL/UNITY/Reach.thy
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     2
    ID:         $Id$
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     5
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     6
Reachability in Directed Graphs.  From Chandy and Misra, section 6.4.
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     7
*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     8
5232
e5a7cdd07ea5 Tidied; uses records
paulson
parents: 5071
diff changeset
     9
Reach = FP + Traces + SubstAx +
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    10
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    11
types   vertex
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    12
        state = "vertex=>bool"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    13
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    14
arities vertex :: term
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    15
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    16
consts
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    17
  init ::  "vertex"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    18
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    19
  edges :: "(vertex*vertex) set"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    20
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    21
constdefs
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    22
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    23
  asgt  :: "[vertex,vertex] => (state*state) set"
5071
548f398d770b Consequences of the change from [ := ] to ( := ) in theory Update.
nipkow
parents: 4896
diff changeset
    24
    "asgt u v == {(s,s'). s' = s(v:= s u | s v)}"
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    25
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    26
  racts :: "(state*state) set set"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    27
    "racts == insert id (UN (u,v): edges. {asgt u v})"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    28
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    29
  rinit :: "state set"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    30
    "rinit == {%v. v=init}"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    31
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    32
  invariant :: state set
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    33
    "invariant == {s. (ALL v. s v --> (init, v) : edges^*) & s init}"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    34
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    35
  fixedpoint :: state set
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    36
    "fixedpoint == {s. ALL (u,v): edges. s u --> s v}"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    37
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    38
  metric :: state => nat
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    39
    "metric == (%s. card {v. ~ s v})"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    40
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    41
rules
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    42
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    43
  (*We assume that the set of vertices is finite*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    44
  finite_graph "finite (UNIV :: vertex set)"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    45
  
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    46
end