author | nipkow |
Wed, 05 Nov 1997 09:08:35 +0100 | |
changeset 4137 | 2ce2e659c2b1 |
permissions | -rw-r--r-- |
4137
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
1 |
(* |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
2 |
Conversion of automata into regular sets. |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
3 |
use_thy"Auto"; |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
4 |
*) |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
5 |
|
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
6 |
Regset_of_auto = List + |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
7 |
|
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
8 |
(* autos *) |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
9 |
|
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
10 |
types 'a auto = "'a => nat => nat" |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
11 |
|
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
12 |
consts deltas :: 'a auto => 'a list => nat => nat |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
13 |
primrec deltas list |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
14 |
"deltas A [] i = i" |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
15 |
"deltas A (x#xs) i = deltas A xs (A x i)" |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
16 |
|
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
17 |
consts trace :: 'a auto => nat => 'a list => nat list |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
18 |
primrec trace list |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
19 |
"trace A i [] = []" |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
20 |
"trace A i (x#xs) = A x i # trace A (A x i) xs" |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
21 |
|
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
22 |
(* regular sets *) |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
23 |
|
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
24 |
constdefs conc :: 'a list set => 'a list set => 'a list set |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
25 |
"conc A B == {xs@ys | xs ys. xs:A & ys:B}" |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
26 |
|
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
27 |
consts star :: 'a list set => 'a list set |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
28 |
inductive "star A" |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
29 |
intrs |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
30 |
NilI "[] : star A" |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
31 |
ConsI "[| a:A; as : star A |] ==> a@as : star A" |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
32 |
|
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
33 |
(* conversion a la Warshall *) |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
34 |
|
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
35 |
consts regset_of :: 'a auto => nat => nat => nat => 'a list set |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
36 |
primrec regset_of nat |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
37 |
"regset_of A i j 0 = (if i=j then insert [] {[a] | a. A a i = j} |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
38 |
else {[a] | a. A a i = j})" |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
39 |
"regset_of A i j (Suc k) = regset_of A i j k Un |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
40 |
conc (regset_of A i k k) |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
41 |
(conc (star(regset_of A k k k)) |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
42 |
(regset_of A k j k))" |
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
43 |
|
2ce2e659c2b1
Added an alternativ version of AutoChopper and a theory for the conversion of
nipkow
parents:
diff
changeset
|
44 |
end |