Commit 62350257 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Turn off the costly well-formedness assertions in Lr0.

This allows a 30% speedup on the construction of large LR(1) automata
and in conflict explanation.
parent db15d0c1
......@@ -327,9 +327,15 @@ let print_closure leading state =
let core (k, _) =
(* A sanity check. *)
(* A sanity check. This well-formedness check is quite costly, due to the
use of [Item.Set.cardinal]. Therefore, it is enabled only when [debug]
is [true]. *)
let debug =
let well_formed (k, toksr) =
not debug ||
Array.length toksr = Item.Set.cardinal (InfiniteArray.get states k)
(* An LR(1) start state is the combination of an LR(0) start state
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment