You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
std.map2 BL ML (factory-provides.one Params T) MLwP,
98
98
].
99
99
100
-
pred factory-provides.one i:list term, i:term, i:term, i:mixinname, o:w-args mixinname.
101
-
factory-provides.one Params T B M (triple M PL T) :- std.do! [
102
-
std.assert-ok! (coq.typecheck B Ty) "Builder illtyped",
100
+
pred factory-provides.one i:list term, i:term, i:gref-or-primitive, i:mixinname, o:w-args mixinname.
101
+
factory-provides.one Params T (gref B) M (triple M PL T) :- std.do! [
102
+
coq.env.typeof B Ty,
103
103
subst-prod [T] {subst-prod Params Ty} TyParams,
104
104
std.assert! (extract-conclusion-params T TyParams PL) "The conclusion of a builder is a mixin whose parameters depend on other mixins",
105
105
].
106
+
factory-provides.one Params T (primitive (pr P N)) M (triple M PL T) :- std.do! [
107
+
coq.mk-app {coq.mk-app (global M) Params} [T] TyM, % fine since M is the class hence no extra arg needed
108
+
std.assert-ok! (d\@pi-decl `m` TyM m\coq.typecheck (app[primitive(proj P N),m]) (TyParams m) d) "Builder illtyped",
109
+
@pi-decl `m` TyM m\
110
+
std.assert! (extract-conclusion-params T (TyParams m) PL) "The conclusion of a primitive projection is a mixin whose parameters depend on other mixins"
111
+
].
106
112
107
113
pred extract-conclusion-params i:term, i:term, o:list term.
108
114
extract-conclusion-params TheType (prod _ S T) R :- !,
0 commit comments