fact: Definition mkAnd r1 r2 := nosimpl match r1,r2 with | CVoid, _ => CVoid | _, CVoid => CVoid | CNot CVoid, _ => r2 | _, CNot CVoid => r1 | CAnd l1, CAnd l2 => match undup (merge' (sort' l1) (sort' l2)) with | [::] => CNot CVoid | [:: r] => r | rs => CAnd rs end | CAnd l1, _ => match undup (merge' (sort' l1) [::r2]) with | [::] => CNot CVoid | [:: r] => r | rs => CAnd rs end | _, CAnd l2 => match undup (merge' [:: r1] (sort' l2)) with | [::] => CNot CVoid | [:: r] => r | rs => CAnd rs end | _,_ => match compare r1 r2 with | Lt => CAnd [:: r1; r2] | Eq => r1 | Gt => CAnd [:: r2; r1] end end.
imports: Coq(RelationClasses Setoid Morphisms) HB(structures) mathcomp(ssreflect ssrfun ssrbool eqtype ssrnat seq fintype) mathcomp(bigop path) RegLang(languages) RegexpBrzozowski(glue regexp finite_der equiv)