LPCIC / elpi

Embeddable Lambda Prolog Interpreter
GNU Lesser General Public License v2.1
283 stars 35 forks source link

Declaring a predicate `prop` in a namespace causes a typecheck failure #194

Open pi8027 opened 1 year ago

pi8027 commented 1 year ago

Example:

From elpi Require Import elpi.

Elpi Command test.
Elpi Accumulate lp:{{

namespace ns {

pred pred1.

pred prop.

}

pred pred2.
pred2 :- ns.pred1.

}}.
Fail Elpi Typecheck.

Declaring pred prop in namespace ns seems to have the effect of changing the return type of the other predicates in the namespace, i.e., pred1, to ns.prop. It results in the following error message.

The command has indeed failed with message:
At least one of the following errors holds: 
File "(stdin)", line 12, column 0, character 58: ns.pred1 has type ns.prop but is used with type prop
File "(stdin)", line 12, column 0, character 58: ns.pred1 has type ns.prop but is used with type goal-ctx
gares commented 1 year ago

oops ;-) prop should be a keyword (hence not usable for a predicate name).