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

Fix a bug in the Brzozowski demo, reported by Chet Murthy.

Regular expressions were not correctly canonicalized.
parent a288f05d
......@@ -232,7 +232,7 @@ let disjunction (es : regexp list) : regexp =
(* [1 ||| e] is [1]. *)
if exists universal es then one else
(* Disjunction is ACI. *)
let es = es |> undisj |> uniq compare |> sort compare in
let es = es |> undisj |> sort compare |> uniq compare in
(* Avoid disjunctions of one element. *)
match es with [e] -> e | _ -> make (EDisj es)
......@@ -256,7 +256,7 @@ let conjunction (es : regexp list) : regexp =
(* [0 &&& e] is [0]. *)
if exists empty es then zero else
(* Conjunction is ACI. *)
let es = es |> unconj |> uniq compare |> sort compare in
let es = es |> unconj |> sort compare |> uniq compare in
(* Avoid conjunctions of one element. *)
match es with [e] -> e | _ -> make (EConj es)
......
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