Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
POTTIER Francois
menhir
Commits
b277b7f8
Commit
b277b7f8
authored
Nov 09, 2015
by
POTTIER Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed the analysis [MINIMAL] and moved [CompletedNatWitness] and [Seq] to the attic.
parent
618dbcfd
Changes
7
Hide whitespace changes
Inline
Sidebyside
Showing
7 changed files
with
42 additions
and
48 deletions
+42
48
src/attic/CompletedNatWitness.ml
src/attic/CompletedNatWitness.ml
+0
0
src/attic/CompletedNatWitness.mli
src/attic/CompletedNatWitness.mli
+0
0
src/attic/Seq.ml
src/attic/Seq.ml
+0
0
src/attic/Seq.mli
src/attic/Seq.mli
+0
0
src/attic/minimal.ml
src/attic/minimal.ml
+42
0
src/grammar.ml
src/grammar.ml
+0
37
src/grammar.mli
src/grammar.mli
+0
11
No files found.
src/CompletedNatWitness.ml
→
src/
attic/
CompletedNatWitness.ml
View file @
b277b7f8
File moved
src/CompletedNatWitness.mli
→
src/
attic/
CompletedNatWitness.mli
View file @
b277b7f8
File moved
src/Seq.ml
→
src/
attic/
Seq.ml
View file @
b277b7f8
File moved
src/Seq.mli
→
src/
attic/
Seq.mli
View file @
b277b7f8
File moved
src/attic/minimal.ml
0 → 100644
View file @
b277b7f8
(* See the commit entitled:
Removed the analysis [MINIMAL] and moved [CompletedNatWitness] and [Seq] to the attic.
*)
(*  *)
(* For every nonterminal symbol [nt], compute a word of minimal length
generated by [nt]. This analysis subsumes [NONEMPTY] and [NULLABLE].
Indeed, [nt] produces a nonempty language if only if the minimal length is
finite; [nt] is nullable if only if the minimal length is zero. *)
(* This analysis is in principle more costly than the [NONEMPTY] and
[NULLABLE], so it is performed only on demand. In practice, it seems
to be very cheap: its cost is not measurable for any of the grammars
in our benchmark suite. *)
module
MINIMAL
=
GenericAnalysis
(
struct
include
CompletedNatWitness
type
property
=
Terminal
.
t
t
end
)
(
struct
open
CompletedNatWitness
(* A terminal symbol has length 1. *)
let
terminal
=
singleton
(* The length of an alternative is the minimum length of any branch. *)
let
disjunction
=
min_lazy
(* The length of a sequence is the sum of the lengths of the members. *)
let
conjunction
_
=
add_lazy
(* The epsilon sequence has length 0. *)
let
epsilon
=
epsilon
end
)
let
()
=
Error
.
logG
2
(
fun
f
>
for
nt
=
Nonterminal
.
start
to
Nonterminal
.
n

1
do
Printf
.
fprintf
f
"minimal(%s) = %s
\n
"
(
Nonterminal
.
print
false
nt
)
(
CompletedNatWitness
.
print
Terminal
.
print
(
MINIMAL
.
nonterminal
nt
))
done
)
src/grammar.ml
View file @
b277b7f8
...
...
@@ 1119,35 +1119,6 @@ let () =
"%s generates the empty language."
(
Nonterminal
.
print
false
nt
);
done
(*  *)
(* For every nonterminal symbol [nt], compute a word of minimal length
generated by [nt]. This analysis subsumes [NONEMPTY] and [NULLABLE].
Indeed, [nt] produces a nonempty language if only if the minimal length is
finite; [nt] is nullable if only if the minimal length is zero. *)
(* This analysis is in principle more costly than the [NONEMPTY] and
[NULLABLE], so it is performed only on demand. In practice, it seems
to be very cheap: its cost is not measurable for any of the grammars
in our benchmark suite. *)
module
MINIMAL
=
GenericAnalysis
(
struct
include
CompletedNatWitness
type
property
=
Terminal
.
t
t
end
)
(
struct
open
CompletedNatWitness
(* A terminal symbol has length 1. *)
let
terminal
=
singleton
(* The length of an alternative is the minimum length of any branch. *)
let
disjunction
=
min_lazy
(* The length of a sequence is the sum of the lengths of the members. *)
let
conjunction
_
=
add_lazy
(* The epsilon sequence has length 0. *)
let
epsilon
=
epsilon
end
)
(*  *)
(* Dump the analysis results. *)
...
...
@@ 1162,11 +1133,6 @@ let () =
Printf
.
fprintf
f
"first(%s) = %s
\n
"
(
Nonterminal
.
print
false
nt
)
(
TerminalSet
.
print
(
FIRST
.
nonterminal
nt
))
done
;
for
nt
=
Nonterminal
.
start
to
Nonterminal
.
n

1
do
Printf
.
fprintf
f
"minimal(%s) = %s
\n
"
(
Nonterminal
.
print
false
nt
)
(
CompletedNatWitness
.
print
Terminal
.
print
(
MINIMAL
.
nonterminal
nt
))
done
)
...
...
@@ 1449,9 +1415,6 @@ module Analysis = struct
let
follow
=
follow
let
minimal_symbol
=
MINIMAL
.
symbol
let
minimal_prod
=
MINIMAL
.
production
end
(*  *)
...
...
src/grammar.mli
View file @
b277b7f8
...
...
@@ 438,17 +438,6 @@ module Analysis : sig
val
follow
:
Nonterminal
.
t
>
TerminalSet
.
t
(* [minimal_symbol sym] is the minimal length of a word generated by
the symbol [sym]. *)
val
minimal_symbol
:
Symbol
.
t
>
Terminal
.
t
CompletedNatWitness
.
t
(* [minimal_prod prod i] is the minimal length of a word generated
by [prod/i], i.e., the suffix of production [prod] defined by
offset [i]. *)
val
minimal_prod
:
Production
.
index
>
int
>
Terminal
.
t
CompletedNatWitness
.
t
end
(*  *)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment