QGraphmodule ElimTable : sig ... endtype quality_inconsistency = (Sorts.QVar.t -> Pp.t) option * (Sorts.ElimConstraint.kind * Sorts.Quality.t * Sorts.Quality.t * explanation option)type elimination_error = | IllegalConstraint |
| CreatesForbiddenPath of Sorts.Quality.t * Sorts.Quality.t |
| MultipleDominance of Sorts.Quality.t * Sorts.Quality.t * Sorts.Quality.t |
| QualityInconsistency of quality_inconsistency |
exception EliminationError of elimination_errorval add_quality : Sorts.Quality.t -> t -> tAlways call this function on a quality before trying to enforce or check a constraint or calling eliminates_to. Forces Type to eliminate to this quality.
val merge_constraints : constraint_source -> Sorts.ElimConstraints.t -> t -> tval update_dominance_if_valid : t -> Sorts.ElimConstraint.t -> t optionChecks if the given constraint satisfies the dominance condition: Let q1 ~> q2 be the given constraint, with q2 a sort variable. Then q1 (or the dominant sort of q1) should be related to the dominant sort of q2, i.e., dom*(q1) ~> dom(q2) or dom(q2) ~> dom*(q1).
Returns None if the dominance *is not valid*, i.e., if the dominant sorts are not related. Otherwise, returns Some g where g is the updated graph.
val check_constraint : t -> Sorts.ElimConstraint.t -> boolval check_constraints : Sorts.ElimConstraints.t -> t -> boolval enforce_eliminates_to : constraint_source -> Sorts.Quality.t -> Sorts.Quality.t -> t -> tSet the first quality to eliminate to the second one in the graph.
If this constraint creates a cycle that violates the constraints, QualityInconsistency is raised. On an Internal enforcement, it also checks whether a path is created between two ground/global sorts. The Rigid constraint_source should be used for constraints entered by the user. It allows to create paths between ground/global sorts, but disables path creation between two ground sorts. No additional check is performed on a Static constraint.
val enforce_eq : Sorts.Quality.t -> Sorts.Quality.t -> t -> tSet the first quality equal to the second one in the graph. If it's impossible, raise QualityInconsistency.
val initial_graph : tGraph with the constant quality elimination constraints found in Quality.Constants.eliminates_to.
val eliminates_to : t -> Sorts.Quality.t -> Sorts.Quality.t -> boolval eliminates_to_prop : t -> Sorts.Quality.t -> boolval check_eq : t -> Sorts.Quality.t -> Sorts.Quality.t -> boolval domain : t -> Sorts.Quality.Set.tval qvar_domain : t -> Sorts.QVar.Set.tval is_empty : t -> boolval pr_qualities : (Sorts.Quality.t -> Pp.t) -> t -> Pp.tval explain_quality_inconsistency : (Sorts.QVar.t -> Pp.t) -> explanation option -> Pp.tval explain_elimination_error : (Sorts.QVar.t -> Pp.t) -> elimination_error -> Pp.t