friguzzi/cplint

Missing definition of add_decision_var and compute_best_strategy

Closed this issue · 2 comments

I just updated cplint using pack_upgrade(cplint) and pack_rebuild(cpling) to play with the new Dtproblog, but it seems that it's not complete.

$ swipl
?- pack_upgrade(cplint).
% Running "git fetch" in '/home/hakank/lib/swipl/pack/cplint'
% Package "cplint" is up-to-date
true.

?- pack_rebuild(cplint).
true.

Testing with prolog/examples/dt_rock_papers_scissors.pl

$ swipl dt_rock_paper_scissors.pl
In swipl:
?- dt_solve(Strategy,Value).
Warning: Undefined procedure: pita:add_decision_var/3
Warning: Undefined procedure: pita:add_decision_var/3
Warning: Undefined procedure: pita:add_decision_var/3
Warning: Undefined procedure: pita:compute_best_strategy/5
false.

Searching for the definitions of add_decision_var and compute_best_strategy find just the calls, not the predicate definition:

$ cd /home/hakank/lib/swipl/pack/cplint
$ git grep add_decision_var
prolog/pita.pl: add_decision_var(Env,R,V),

$ git grep compute_best_strategy
prolog/pita.pl: compute_best_strategy(Env,LBDD,LUtils,St,Cost),

Hi. add_decision_var/3 (and also other predicates) are defined in package bddem. In order to use it, you need to run pack_upgrade(bddem). then pack_rebuild(bddem).
Let me know if you have other issues.

Thanks!

It worked after some tweaks:

pack_upgrade(bddem) give the following error:
"""
?- pack_upgrade(bddem).
% Running "git fetch" in '/home/hakank/lib/swipl/pack/bddem'
% From https://github.com/friguzzi/bddem
% 457ee1e..404b4cb master -> origin/master
% * [new branch] automake-1.14 -> origin/automake-1.14
% * [new branch] dtproblog -> origin/dtproblog
% * [new branch] noconf -> origin/noconf
% * [new tag] v4.3.0 -> v4.3.0
% * [new tag] v4.3.1 -> v4.3.1
Upgrade "bddem" from 457ee1e-DIRTY to 404b4cb-DIRTY Y/n?
ERROR: error: Your local changes to the following files would be overwritten by merge:
ERROR: cudd-3.0.0/Makefile.in
ERROR: cudd-3.0.0/aclocal.m4
ERROR: cudd-3.0.0/configure
ERROR: lib/x86_64-linux/bddem.so
ERROR: Please commit your changes or stash them before you merge.
ERROR: Aborting
"""

I had to do a pack_remove(bddem) and then pack_install(bddem) to make it work.