I have an ECLiPSe script whose goal is to encode my problem into a set of arithmetic constraints. In REPL, I eventually get a list of delayed goals which looks as follows:
-(_2941{4 .. 7}) + _2900{1 .. 4} #=< 0
_2941{4 .. 7} - _2900{1 .. 4} #= 3
-(_3393{7 .. 21}) + _3352{4 .. 18} #=< 0
_3393{7 .. 21} - _3352{4 .. 18} #= 3
_3845{14 .. 17} - _3804{4 .. 7} #= 10
_4297{18 .. 21} - _4256{14 .. 17} #= 4
-(_4749{19 .. 22}) + _4708{18 .. 21} #=< 0
_4749{19 .. 22} - _4708{18 .. 21} #= 1
...
Is there a predicate that would give me a similar readable list of constraints in the constraint store?
delayed_goals
gives some library-specific constraints (like prop_ic_con(ic_con(... <some special characters> etc ))
rather than the clean output as in the above listing. I need to output it to a file from a shell script, not from the interactive loop which hides delayed goals by default.
The translation from an internal goal to a readable one is performed by a goal-portray-transformation. The output predicates printf and write_term can optionally invoke this translation, e.g.
You can also invoke the translation explicitly using portray_term/3: