Stream: Elpi users & devs

Topic: Execution order with spilling


view this post on Zulip Enzo Crance (May 05 2023 at 11:49):

Hello. I have difficulties reasoning about spills. I have a block of Elpi predicates to be called under a condition, and this block contains spills. Are they desugared to calls before the if or inside the branch?

For instance, does

if Condition (F {x}) Other

desugar to

if Condition (x A, F A) Other

or

x A, if Condition (F A) Other

?

view this post on Zulip Enrico Tassi (May 05 2023 at 13:26):

The rule is not very satisfactory, but here it is: the spilled term is grafted just before the first term of type prop going from its position outward.

In your case, if F _ is a prop, then F {x} is rewritten to (x TMP, F TMP).

view this post on Zulip Enrico Tassi (May 05 2023 at 13:28):

You can use Elpi Print some_elpi_command_name to see the actual program, or if you are in plain elpi there is something like -print-ast


Last updated: Oct 13 2024 at 01:02 UTC