4832
|
1 |
(* Title: HOL/Lex/NAe.thy
|
|
2 |
ID: $Id$
|
|
3 |
Author: Tobias Nipkow
|
|
4 |
Copyright 1998 TUM
|
|
5 |
|
|
6 |
Nondeterministic automata with epsilon transitions
|
|
7 |
*)
|
|
8 |
|
8732
|
9 |
NAe = NA +
|
4832
|
10 |
|
|
11 |
types ('a,'s)nae = ('a option,'s)na
|
|
12 |
|
|
13 |
syntax eps :: "('a,'s)nae => ('s * 's)set"
|
|
14 |
translations "eps A" == "step A None"
|
|
15 |
|
|
16 |
consts steps :: "('a,'s)nae => 'a list => ('s * 's)set"
|
5184
|
17 |
primrec
|
4832
|
18 |
"steps A [] = (eps A)^*"
|
|
19 |
"steps A (a#w) = steps A w O step A (Some a) O (eps A)^*"
|
|
20 |
|
4900
|
21 |
constdefs
|
|
22 |
accepts :: ('a,'s)nae => 'a list => bool
|
|
23 |
"accepts A w == ? q. (start A,q) : steps A w & fin A q"
|
|
24 |
|
|
25 |
(* not really used:
|
4832
|
26 |
consts delta :: "('a,'s)nae => 'a list => 's => 's set"
|
5184
|
27 |
primrec
|
10834
|
28 |
"delta A [] s = (eps A)^* `` {s}"
|
|
29 |
"delta A (a#w) s = lift(delta A w) (lift(next A (Some a)) ((eps A)^* `` {s}))"
|
4900
|
30 |
*)
|
4832
|
31 |
end
|