@@ -96,19 +96,26 @@ kind asset type.
9696type asset-mixin asset.
9797type asset-factory asset.
9898
99+ pred check-key-attribute-consistency i:id.
100+ check-key-attribute-consistency _ :- not(get-option "key" _), !.
101+ check-key-attribute-consistency ID :- get-option "key" ID, !.
102+ check-key-attribute-consistency ID :- get-option "key" ID1,
103+ coq.error "HB:" {calc ("The #[key=\"" ^ ID1 ^ "\"] attribute")}
104+ "does not match the selected subject" ID.
105+
99106pred is-key i:indt-decl.
100107pred is-key i:arity.
101108pred is-key i:context-decl.
102- is-key (parameter _ _ _ _\ record _ _ _ _) :- !.
103- is-key (parameter _ _ _ _\ inductive _ _ _ _) :- !.
104- is-key (parameter _ _ _ _\ arity _) :- !.
105- is-key (context-item _ _ _ _ _\ context-end) :- !.
109+ is-key (parameter ID _ _ _\ record _ _ _ _) :- !, check-key-attribute-consistency ID .
110+ is-key (parameter ID _ _ _\ inductive _ _ _ _) :- !, check-key-attribute-consistency ID .
111+ is-key (parameter ID _ _ _\ arity _) :- !, check-key-attribute-consistency ID .
112+ is-key (context-item ID _ _ _ _\ context-end) :- !, check-key-attribute-consistency ID .
106113is-key (parameter ID _ _ _) :- get-option "key" ID, !.
107114is-key (context-item ID _ _ _ _) :- get-option "key" ID, !.
108- is-key (parameter _ _ _ p\ parameter _ _ (M p) _) :-
109- pi p\ factory? (M p) _, !.
110- is-key (context-item _ _ _ _ p\ context-item _ _ (M p) _ _) :-
111- pi p\ factory? (M p) _, !.
115+ is-key (parameter ID _ _ p\ parameter _ _ (M p) _) :-
116+ pi p\ factory? (M p) _, !, check-key-attribute-consistency ID .
117+ is-key (context-item ID _ _ _ p\ context-item _ _ (M p) _ _) :-
118+ pi p\ factory? (M p) _, !, check-key-attribute-consistency ID .
112119
113120pred mixin-decl-w-mixins i:string, i:string, i:term, i:(term -> A),
114121 i:(A -> pair (list (w-args mixinname)) A -> prop),
0 commit comments