Stream: Elpi users & devs

Topic: Question on error message "Evaluation of a non closed term"


view this post on Zulip Théo Laurent (Jul 19 2022 at 14:43):

Hi, I am fairly new to elpi, I hope this in the right place to ask newbie questions.
What's the meaning of the error message "Evaluation of a non closed term (maybe delay)"?

view this post on Zulip Enrico Tassi (Jul 19 2022 at 14:45):

Hello, the place is absolutely right.

view this post on Zulip Enrico Tassi (Jul 19 2022 at 14:46):

This program raises that error

main :- X is A + 1.

indeed A has no value

view this post on Zulip Enrico Tassi (Jul 19 2022 at 14:47):

The maybe delay part is because X is A + 1, A = 0 could still work if one suspends the first part until the second executes

view this post on Zulip Théo Laurent (Jul 19 2022 at 14:50):

Ok.. I don't think I see what I am doing wrong.
So I defined a predicate

    pred p i:int.
    p K :- K > 0.

and I would like elpi to find me such a K when I do p K, coq.say K

view this post on Zulip Enrico Tassi (Jul 19 2022 at 19:23):

Well, > is a builtin which does not "generate", it only tests.
Also note that you defined p taking the argument in input (it plays no role here, but is fishy).

What are you trying to do actually, the big picture.

view this post on Zulip Théo Laurent (Jul 20 2022 at 06:04):

I was trying to figure out how to write a sudoku solver.

view this post on Zulip Enrico Tassi (Jul 20 2022 at 07:16):

so, elpi is not a constraint solver. your integers are a finite domain, so I see why it made sense.
you can still write something like

pred p o:int.
p 1.
p 2.
p 3.
 ... etc ....
main :- p K, coq.say "pick" K, K < 3, K >1, coq.say "result" K.

and there elpi will try with any of these, when you ask p K.


Last updated: Oct 13 2024 at 01:02 UTC