Listing all constraints in Eclipse CLP in a readable form -


i have eclipse script goal encode problem set of arithmetic constraints. in repl, list of delayed goals looks 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 predicate give me similar readable list of constraints in constraint store?

delayed_goals gives library-specific constraints (like prop_ic_con(ic_con(... <some special characters> etc )) rather clean output in above listing. need output file shell script, not interactive loop hides delayed goals default.

the translation internal goal readable 1 performed goal-portray-transformation. output predicates printf , write_term can optionally invoke translation, e.g.

?- 3*x+6*y #> 9, delayed_goals([g]), printf("%gmw", [g]), nl. 6 * y{-1.0inf .. 1.0inf} + 3 * x{-1.0inf .. 1.0inf} #> 9  ?- 3*x+6*y #> 9, delayed_goals([g]), write_term(g, [as(goal)]), nl. 6 * y{-1.0inf .. 1.0inf} + 3 * x{-1.0inf .. 1.0inf} #> 9 

you can invoke translation explicitly using portray_term/3:

?- 3*x+6*y #> 9, delayed_goals([g]), portray_term(g, p, goal). g = prop_ic_con(ic_con(...)) p = (6 * y{-1.0inf .. 1.0inf} + 3 * x{-1.0inf .. 1.0inf} #> 9) 

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -