Hello. I would like a bit more information about the implication =>
in Elpi. What is the preferred syntax to add several clauses to the context? What is the scope of this arrow? Do I need to use parentheses so that the context is updated for several subsequent goals, or is the context updated until the end of the current declaration (the next final .
)?
Thanks.
The precedence of =>
w.r.t. ,
is a pitfall: A => (B , C), D
here D
does not see A
, while C
does.
To add multiple clauses you can use [C1, C2] => P
or (C1, C2) => P
. The difference is that the former is easier to synthesize, it's a list for example you can obtain it by std.append
. And the list reads C2 => C1 => P
while the conjunction reads C1 => C2 => P
, recall the last introduced clause takes precedence.
Last updated: Oct 13 2024 at 01:02 UTC