src/HOL/MicroJava/BV/Typing_Framework.thy
author kleing
Sun, 16 Dec 2001 00:17:44 +0100
changeset 12516 d09d0f160888
parent 11299 1d3d110c456e
child 12911 704713ca07ea
permissions -rw-r--r--
exceptions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11229
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
     1
(*  Title:      HOL/MicroJava/BV/Typing_Framework.thy
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
     2
    ID:         $Id$
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
     3
    Author:     Tobias Nipkow
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
     4
    Copyright   2000 TUM
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
     5
*)
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
     6
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
     7
header "Typing and Dataflow Analysis Framework"
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
     8
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
     9
theory Typing_Framework = Listn:
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
    10
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
    11
text {* 
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
    12
  The relationship between dataflow analysis and a welltyped-insruction predicate. 
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
    13
*}
12516
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    14
types
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    15
  's step_type = "nat \<Rightarrow> 's \<Rightarrow> (nat \<times> 's) list"
11229
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
    16
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
    17
constdefs
12516
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    18
 bounded :: "'s step_type => nat => bool"
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    19
"bounded step n == !p<n. !s. !(q,t):set(step p s). q<n"  
11229
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
    20
12516
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    21
 stable :: "'s ord => 's step_type => 's list => nat => bool"
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    22
"stable r step ss p == !(q,s'):set(step p (ss!p)). s' <=_r ss!q"
11229
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
    23
12516
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    24
 stables :: "'s ord => 's step_type => 's list => bool"
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    25
"stables r step ss == !p<size ss. stable r step ss p"
11229
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
    26
12516
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    27
 is_bcv :: "'s ord => 's => 's step_type 
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    28
           => nat => 's set => ('s list => 's list) => bool"  
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    29
"is_bcv r T step n A bcv == !ss : list n A.
11229
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
    30
   (!p<n. (bcv ss)!p ~= T) =
12516
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    31
   (? ts: list n A. ss <=[r] ts & wt_step r T step ts)"
11229
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
    32
11299
1d3d110c456e welltyping -> wt_step
nipkow
parents: 11229
diff changeset
    33
 wt_step ::
12516
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    34
"'s ord => 's => 's step_type => 's list => bool"
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    35
"wt_step r T step ts ==
d09d0f160888 exceptions
kleing
parents: 11299
diff changeset
    36
 !p<size(ts). ts!p ~= T & stable r step ts p"
11229
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
    37
f417841385b7 Got rid of is_dfa
nipkow
parents:
diff changeset
    38
end