Difference between prefix and postfix notation for sum in constraints - why?

7 views
Skip to first unread message

C. G.

unread,
Dec 23, 2025, 5:43:12 AM (2 days ago) Dec 23
to Picat
Picat> X::0..1,Y::0..1, Z#=[X,Y].sum.

*** error(instantiation_error,sum)


Picat> X::0..1,Y::0..1, Z#=sum([X,Y]).
X = DV_0139a0_0..1
Y = DV_013a40_0..1
Z = DV_013ac0_0..2
yes

Tested in 3.9.

best regards,
C.G.

Neng-Fa Zhou

unread,
Dec 23, 2025, 10:00:29 AM (2 days ago) Dec 23
to C. G., Picat
There is a note in the Users' Guide: "Also note that functions in dot notation are always evaluated eagerly, and therefore should not be used in term constructs or constraint expressions." This design decision does make sense because the dot notation is for chaining function calls, and it's impossible to construct a term with the dot notation.

Cheers,
NF

--
You received this message because you are subscribed to the Google Groups "Picat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picat-lang+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/picat-lang/6ba5d6c7-d016-4a67-9ff8-92d8c07d9f83n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages