Tabling for a function with out parameters

12 views
Skip to first unread message

Woosuk Kwak (Bubbler)

unread,
Jun 6, 2026, 8:20:15 AM (11 days ago) Jun 6
to Picat

The following code does not print “Done” in the current version:

main => C = func(1, B), println("Done"). table(+,-) func(N, M) = N * 2 => M = N.

“Done” is normally printed when I remove the table declaration, or when I remove the only call to func.

It seems that Picat just exits when such function is called the first time. No error message, and the exit code is 0. If this combination being not allowed is intentional, I think it should at least throw an error, and the fact should be mentioned in the docs.

Neng-Fa Zhou

unread,
Jun 6, 2026, 10:39:00 AM (11 days ago) Jun 6
to Picat
You never want to use table modes on functions because all the arguments of a function are supposed to be inputs. Picat translates functions to predicates. It should report an error if table modes are used on functions.

Cheers,
NF

Reply all
Reply to author
Forward
0 new messages