src/HOL/Lex/AutoMaxChop.thy
author wenzelm
Mon, 16 Aug 1999 22:07:12 +0200
changeset 7224 e41e64476f9b
parent 5184 9b8547a9496a
child 14428 bb2b0e10d9be
permissions -rw-r--r--
'a list: Nil, Cons;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4714
bcdf68c78e18 New scanner in abstract form.
nipkow
parents:
diff changeset
     1
(*  Title:      HOL/Lex/AutoMaxChop.thy
bcdf68c78e18 New scanner in abstract form.
nipkow
parents:
diff changeset
     2
    ID:         $Id$
bcdf68c78e18 New scanner in abstract form.
nipkow
parents:
diff changeset
     3
    Author:     Tobias Nipkow
bcdf68c78e18 New scanner in abstract form.
nipkow
parents:
diff changeset
     4
    Copyright   1998 TUM
bcdf68c78e18 New scanner in abstract form.
nipkow
parents:
diff changeset
     5
*)
bcdf68c78e18 New scanner in abstract form.
nipkow
parents:
diff changeset
     6
4832
bc11b5b06f87 Added conversion of reg.expr. to automata.
nipkow
parents: 4714
diff changeset
     7
AutoMaxChop = DA + MaxChop +
4714
bcdf68c78e18 New scanner in abstract form.
nipkow
parents:
diff changeset
     8
bcdf68c78e18 New scanner in abstract form.
nipkow
parents:
diff changeset
     9
consts
4910
697d17fe1665 Reordered a few parameters.
nipkow
parents: 4832
diff changeset
    10
 auto_split :: "('a,'s)da => 's  => 'a list * 'a list => 'a list => 'a splitter"
5184
9b8547a9496a Adapted to new datatype package.
berghofe
parents: 4910
diff changeset
    11
primrec
4910
697d17fe1665 Reordered a few parameters.
nipkow
parents: 4832
diff changeset
    12
"auto_split A q res ps []     = (if fin A q then (ps,[]) else res)"
697d17fe1665 Reordered a few parameters.
nipkow
parents: 4832
diff changeset
    13
"auto_split A q res ps (x#xs) =
697d17fe1665 Reordered a few parameters.
nipkow
parents: 4832
diff changeset
    14
   auto_split A (next A x q) (if fin A q then (ps,x#xs) else res) (ps@[x]) xs"
4714
bcdf68c78e18 New scanner in abstract form.
nipkow
parents:
diff changeset
    15
bcdf68c78e18 New scanner in abstract form.
nipkow
parents:
diff changeset
    16
constdefs
4832
bc11b5b06f87 Added conversion of reg.expr. to automata.
nipkow
parents: 4714
diff changeset
    17
 auto_chop :: "('a,'s)da => 'a chopper"
4910
697d17fe1665 Reordered a few parameters.
nipkow
parents: 4832
diff changeset
    18
"auto_chop A == chop (%xs. auto_split A (start A) ([],xs) [] xs)"
4714
bcdf68c78e18 New scanner in abstract form.
nipkow
parents:
diff changeset
    19
end