Skip to content

Commit

Permalink
resolve ambiguous coercion path (classifier >-> Funclass)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Doczkal committed Nov 25, 2019
1 parent 6357075 commit ee126ab
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions theories/myhill_nerode.v
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ Record classifier := Classifier {
classifier_classes : finType;
classifier_fun :> word -> classifier_classes }.

(** We register an additional coercion. So we can write
- [x:E] => x is a class of E
- [E w] => the class of w
- [#|E|] => the cardinality of the index type *)
Notation classes_of := classifier_classes.

(** It would be desirable to have classifiers also coerce to [finType]
(to be able to write #|E| for the number of classes). However, this
introduces an ambiguity since [finType] already coerces to Funclass
(as the universally true predicate). *)

Coercion classifier_classes : classifier >-> finType.

Definition right_congruent (X : eqType) (E : word -> X) :=
forall u v a, E u = E v -> E (u ++ [::a]) = E (v ++ [::a]).
Expand Down Expand Up @@ -66,7 +67,7 @@ Section DFAtoClassifier.
cf_congruent := delta_s_right_congruent;
cf_refines := delta_s_refines |}.

Lemma dfa_to_cf_size : #|A| = #|dfa_to_cf|. by []. Qed.
Lemma dfa_to_cf_size : #|A| = #|classes_of dfa_to_cf|. by []. Qed.
End DFAtoClassifier.


Expand Down Expand Up @@ -193,4 +194,4 @@ Section mDFAtoMG.
nerodeP := minimal_nerode |}.
End mDFAtoMG.

End Clasifiers.
End Clasifiers.

0 comments on commit ee126ab

Please sign in to comment.