12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455moduleM=Api.MetamoduleT=Kernel.TermmoduleU=Universestypetheory=(U.pred*bool)listtypetheory_maker=int->theoryletrecenumerate:int->U.univlist=funi->ifi=0then[]elseU.Enum(i-1)::enumerate(i-1)(** [is_true meta p] check if the predicate [p] is true in the original theory. *)letis_true(meta:M.cfg)p=lett=U.term_of_predpinlett'=M.mk_termmetatinT.term_eq(U.true_())t'(** [is_true_axiom meta s s'] check if the predicate [Axiom s s'] is true in the original theory. *)letis_true_axiommetass'=letp=U.Axiom(s,s')in(p,is_truemetap)(** [is_true_cumul meta s s'] check if the predicate [Cumul s s'] is true in the original theory. *)letis_true_cumulmetass'=letp=U.Cumul(s,s')in(p,is_truemetap)(** [is_true_rule meta s s' s''] check if the predicate [Rule s s' s''] is true in the original theory. *)letis_true_rulemetass's''=letp=U.Rule(s,s',s'')in(p,is_truemetap)moduleUtil=structletcartesian2fll'=List.concat(List.map(fune->List.map(fune'->fee')l')l)letcartesian3fll'l''=List.concat(List.map(fune->List.concat(List.map(fune'->List.map(fune''->fee'e'')l'')l'))l)end(* FIXME: can be optimized. *)(** [mk_theory meta i] computes a theory for the universes up to [i]. A theory is an array for each predicate that tells if the predicate holds. The array is index by universes and its dimension is the arity of the predicate. *)letmk_theory:M.cfg->int->theory=funmetai->letu=enumerateiinletmodel_ax=Util.cartesian2(funlr->is_true_axiommetalr)uuinletmodel_cu=Util.cartesian2(funlr->is_true_cumulmetalr)uuinletmodel_ru=Util.cartesian3(funlmr->is_true_rulemetalmr)uuuinmodel_ax@model_cu@model_ru