Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 16942dd3 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Comments.

parent ec2e2ab1
No related branches found
No related tags found
No related merge requests found
......@@ -387,21 +387,21 @@ type dfa = {
(* Constructing a DFA for an expression [e]. *)
(* We wish to define a mapping of (nonempty) regexps to states. We must be
careful to avoid divergence, by recognizing regexps that have been
(* We wish to define a mapping of nonempty expressions to states. We must be
careful to avoid divergence, by recognizing expressions that have been
encountered already. To do this, we proceed in two steps. First, we
discover the (finite) set of regexps that are obtained from [e] by repeated
derivation. We assign a unique number to each of these reachable regexps.
Then, we construct a deterministic finite automaton whose states are the
reachable regexps and whose transitions correspond to derivation. *)
discover the finite set of expressions that are obtained from [e] by
repeated derivation. We assign a unique number to each of these reachable
expressions. Then, we construct a DFA whose states are the reachable
expressions and whose transitions correspond to derivation. *)
let dfa (e : regexp) : dfa =
(* Discover the nonempty regexps and assign a unique number to each of them.
The most nontrivial aspect of this phase is termination. The fact that
expressions are considered equal modulo a certain equational theory is
crucial here. The equational theory used by Owens et al. is actually
stronger than strictly necessary to ensure termination. A stronger theory
results in more expressions being identified, therefore smaller automata. *)
(* Discover and number the nonempty reachable expressions. The most
nontrivial aspect of this phase is termination. The fact that expressions
are considered equal modulo a certain equational theory is crucial here.
The equational theory used by Owens et al. is actually stronger than
strictly necessary to ensure termination. A stronger theory results in
more expressions being identified, therefore smaller automata. *)
let module G = struct
type t = regexp
(* The successors of [e] are its derivatives along every character [a],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment