friguzzi / cplint

cplint is a suite of programs for reasoning with probabilistic logic programs
Other
68 stars 13 forks source link

Problems with master branch #27

Closed hakank closed 5 years ago

hakank commented 5 years ago

Updated to the latest master branch using swipl version 8.1.6:

?- pack_upgrade(cplint). ?- pack_rebuild(cplint). ?- pack_upgrade(bddem). ?- pack_build(bddem).

No problems so far.

However, now most models give some errors. Here's the result from the test suite: ?- [library(cplint_test/test)]. """ Warning: /home/hakank/lib/swipl/pack/cplint/prolog/kbest.pl:539: Warning: Local definition of kbest:average/2 overrides weak import from cplint_util ERROR: /home/hakank/lib/swipl/pack/cplint/prolog/examples/lemur/mach.pl:71: ERROR: assert/1: No permission to modify static procedure plunit_mach_lm:fold/2' ERROR: Defined at /home/hakank/lib/swipl/pack/cplint/prolog/examples/lemur/mach.pl:62 Warning: /home/hakank/lib/swipl/pack/cplint/prolog/examples/lemur/mach.pl:71: Warning: Goal (directive) failed: plunit_mach_lm:(fold(all,_3760),sample(10,_3760,_3824,_3846),assert(fold(rand_train,_3824)),assert(fold(rand_test,_3846))) ERROR: /home/hakank/lib/swipl/pack/cplint/prolog/examples/lemur/registration.pl:166: ERROR: assert/1: No permission to modify static procedureplunit_registration_lm:fold/2' ERROR: Defined at /home/hakank/lib/swipl/pack/cplint/prolog/examples/lemur/registration.pl:80 Warning: /home/hakank/lib/swipl/pack/cplint/prolog/examples/lemur/registration.pl:166: Warning: Goal (directive) failed: plunit_registration_lm:(fold(all,_6886),sample(4,_6886,_6950,_6972),assert(fold(rand_train,_6950)),assert(fold(rand_test,_6972))) cplint test suite. To run all tests run ?- test. """

And then ?- test. """ ?- test. % PL-Unit: coin prob(heads(coin),A),close_to(A,0.51). % 209 inferences, 0.000 CPU in 0.000 seconds (100% CPU, 906815 Lips) ERROR: /home/hakank/lib/swipl/pack/cplint/prolog/cplint_test/test_pita.pl:87: test h_c: received error: reset/3: Undefined procedure: plunit_coin:'toss tabled'/3 (prob(heads(coin),A),bar(A,B)),close_to(A,0.51),is_dict(B). % 199 inferences, 0.000 CPU in 0.000 seconds (100% CPU, 1633102 Lips) ERROR: /home/hakank/lib/swipl/pack/cplint/prolog/cplint_test/test_pita.pl:89: test h_c_b: received error: reset/3: Undefined procedure: plunit_coin:'toss tabled'/3 (prob(heads(coin),A),bar1(A,B)),close_to(A,0.51),is_dict(B). % 199 inferences, 0.000 CPU in 0.000 seconds (100% CPU, 1906550 Lips) ERROR: /home/hakank/lib/swipl/pack/cplint/prolog/cplint_test/test_pita.pl:91: test h_c_b2: received error: reset/3: Undefined procedure: plunit_coin:'toss tabled'/3 .... """

And here's the result of good old alarm.pl: $ swipl alarm.pl ?- prob(alarm(t),Prob). """ ERROR: Undefined procedure: 'burg tabled'/3 ERROR: In: ERROR: [34] 'burg tabled'(t,1547324,_11126) ERROR: [33] reset(user:'burg tabled'(t,1547324,_11168),_11152,_11154) at /usr/lib/swi-prolog/boot/init.pl:400 ERROR: [32] '$tabling':moded_delim(user:burg(t,1547324,_11220),user:'$burg$1'(t,1547324),user:'burg tabled'(t,1547324,_11246),1559724,[]) at /usr/lib/swi-prolog/boot/tabling.pl:332 ERROR: [31] '$tabling':moded_activate(user:burg(t,1547324,_11300),user:'$burg$1'(t,1547324),_11280,user:'burg tabled'(t,1547324,_11326),(0x55f54c1f3110),1559724) at /usr/lib/swi-prolog/boot/tabling.pl:320 ERROR: [30] '$tabling':run_leader(user:burg(t,1547324,_11382),user:'$burg$1'(t,1547324),_11360,user:'burg tabled'(t,1547324,_11408),(0x55f54c1f3110),1559696,_11368) at /usr/lib/swi-prolog/boot/tabling.pl:301 ERROR: [29] setup_call_catcher_cleanup('$tabling':true,'$tabling':run_leader(...,...,_11458,...,(0x55f54c1f3110),1559696,_11466),_11436,'$tabling':finished_leader(_11476,1559696,...)) at /usr/lib/swi-prolog/boot/init.pl:468 ERROR: [28] '$tabling':start_tabling(user:burg(t,1547324,_11530),user:'burg tabled'(t,1547324,_11544),user:'$burg$1'(t,1547324),_11516) at /usr/lib/swi-prolog/boot/tabling.pl:269 ERROR: [27] burg(t,1547324,_11584) at /home/hakank/cplint/cplint/prolog/examples/alarm.pl:17 ERROR: [26] 'alarm tabled'(t,1547324,_11612) at /home/hakank/cplint/cplint/prolog/examples/alarm.pl:23 ERROR: [25] reset(user:'alarm tabled'(t,1547324,_11654),_11638,_11640) at /usr/lib/swi-prolog/boot/init.pl:400 ERROR: [24] '$tabling':moded_delim(user:alarm(t,1547324,_11706),user:'$alarm$1'(t,1547324),user:'alarm tabled'(t,1547324,_11732),1559308,[]) at /usr/lib/swi-prolog/boot/tabling.pl:332 ERROR: [23] '$tabling':moded_activate(user:alarm(t,1547324,_11786),user:'$alarm$1'(t,1547324),_11766,user:'alarm tabled'(t,1547324,_11812),(0x55f54c1f29f0),1559308) at /usr/lib/swi-prolog/boot/tabling.pl:320 ERROR: [22] '$tabling':run_leader(user:alarm(t,1547324,_11868),user:'$alarm$1'(t,1547324),_11846,user:'alarm tabled'(t,1547324,_11894),(0x55f54c1f29f0),1559260,_11854) at /usr/lib/swi-prolog/boot/tabling.pl:301 ERROR: [21] setup_call_catcher_cleanup('$tabling':true,'$tabling':run_leader(...,...,_11944,...,(0x55f54c1f29f0),1559260,_11952),_11922,'$tabling':finished_leader(_11962,1559260,...)) at /usr/lib/swi-prolog/boot/init.pl:468 ERROR: [20] '$tabling':start_tabling(user:alarm(t,1547324,_12016),user:'alarm tabled'(t,1547324,_12030),user:'$alarm$1'(t,1547324),_12002) at /usr/lib/swi-prolog/boot/tabling.pl:269 ERROR: [19] alarm(t,1547324,_12070) at /home/hakank/cplint/cplint/prolog/examples/alarm.pl:21 ERROR: [18] '$goal0'(1547324,_12096) 1-st clause of '$goal0'/2 ERROR: [17] pita:get_node(user:'$goal0',1547324,_12130) at /home/hakank/lib/swipl/pack/cplint/prolog/pita.pl:701 ERROR: [16] pita:get_p(user:'$goal0',1547324,_12170) at /home/hakank/lib/swipl/pack/cplint/prolog/pita.pl:663 ERROR: [15] '$bags':findall_loop((alarm(t),_12218),pita:get_p(...,1547324,_12236),_12210,[]) at /usr/lib/swi-prolog/boot/bags.pl:98 """

friguzzi commented 5 years ago

Thanks, there was a bug in kbest.pl and lemur..pl, please upgrade cplint again. As regards the tests, they currently run fine when run individually but not when running them throuhg test.pl. i will investigate

Il giorno mer 5 giu 2019 alle ore 18:25 Hakan Kjellerstrand < notifications@github.com> ha scritto:

Updated to the latest master branch using swipl version 8.1.6:

?- pack_upgrade(cplint). ?- pack_rebuild(cplint). ?- pack_upgrade(bddem). ?- pack_build(bddem).

No problems so far.

However, now most models give some errors. Here's the result from the test suite: ?- [library(cplint_test/test)]. """ Warning: /home/hakank/lib/swipl/pack/cplint/prolog/kbest.pl:539: Warning: Local definition of kbest:average/2 overrides weak import from cplint_util ERROR: /home/hakank/lib/swipl/pack/cplint/prolog/examples/lemur/mach.pl:71 : ERROR: assert/1: No permission to modify static procedure plunit_mach_lm:fold/2' ERROR: Defined at /home/hakank/lib/swipl/pack/cplint/prolog/examples/lemur/ mach.pl:62 Warning: /home/hakank/lib/swipl/pack/cplint/prolog/examples/lemur/mach.pl:71: Warning: Goal (directive) failed: plunit_mach_lm:(fold(all,_3760),sample(10,_3760,_3824,_3846),assert(fold(rand_train,_3824)),assert(fold(rand_test,_3846))) ERROR: /home/hakank/lib/swipl/pack/cplint/prolog/examples/lemur/ registration.pl:166: ERROR: assert/1: No permission to modify static procedure plunit_registration_lm:fold/2' ERROR: Defined at /home/hakank/lib/swipl/pack/cplint/prolog/examples/lemur/ registration.pl:80 Warning: /home/hakank/lib/swipl/pack/cplint/prolog/examples/lemur/ registration.pl:166: Warning: Goal (directive) failed: plunit_registration_lm:(fold(all,_6886),sample(4,_6886,_6950,_6972),assert(fold(rand_train,_6950)),assert(fold(rand_test,_6972))) cplint test suite. To run all tests run ?- test. """

And then ?- test. """ ?- test. % PL-Unit: coin prob(heads(coin),A),close_to(A,0.51). % 209 inferences, 0.000 CPU in 0.000 seconds (100% CPU, 906815 Lips) ERROR: /home/hakank/lib/swipl/pack/cplint/prolog/cplint_test/ test_pita.pl:87: test h_c: received error: reset/3: Undefined procedure: plunit_coin:'toss tabled'/3 (prob(heads(coin),A),bar(A,B)),close_to(A,0.51),is_dict(B). % 199 inferences, 0.000 CPU in 0.000 seconds (100% CPU, 1633102 Lips) ERROR: /home/hakank/lib/swipl/pack/cplint/prolog/cplint_test/ test_pita.pl:89: test h_c_b: received error: reset/3: Undefined procedure: plunit_coin:'toss tabled'/3 (prob(heads(coin),A),bar1(A,B)),close_to(A,0.51),is_dict(B). % 199 inferences, 0.000 CPU in 0.000 seconds (100% CPU, 1906550 Lips) ERROR: /home/hakank/lib/swipl/pack/cplint/prolog/cplint_test/ test_pita.pl:91: test h_c_b2: received error: reset/3: Undefined procedure: plunit_coin:'toss tabled'/3 .... """

And here's the result of good old alarm.pl: $ swipl alarm.pl ?- prob(alarm(t),Prob). """ ERROR: Undefined procedure: 'burg tabled'/3 ERROR: In: ERROR: [34] 'burg tabled'(t,1547324,_11126) ERROR: [33] reset(user:'burg tabled'(t,1547324,_11168),_11152,_11154) at /usr/lib/swi-prolog/boot/init.pl:400 ERROR: [32] '$tabling':moded_delim(user:burg(t,1547324,_11220),user:'$burg$1'(t,1547324),user:'burg tabled'(t,1547324,_11246),1559724,[]) at /usr/lib/swi-prolog/boot/ tabling.pl:332 ERROR: [31] '$tabling':moded_activate(user:burg(t,1547324,_11300),user:'$burg$1'(t,1547324),_11280,user:'burg tabled'(t,1547324,_11326),(0x55f54c1f3110),1559724) at /usr/lib/swi-prolog/boot/tabling.pl:320 ERROR: [30] '$tabling':run_leader(user:burg(t,1547324,_11382),user:'$burg$1'(t,1547324),_11360,user:'burg tabled'(t,1547324,_11408),(0x55f54c1f3110),1559696,_11368) at /usr/lib/swi-prolog/boot/tabling.pl:301 ERROR: [29] setup_call_catcher_cleanup('$tabling':true,'$tabling':run_leader(...,...,_11458,...,(0x55f54c1f3110),1559696,_11466),_11436,'$tabling':finished_leader(_11476,1559696,...)) at /usr/lib/swi-prolog/boot/init.pl:468 ERROR: [28] '$tabling':start_tabling(user:burg(t,1547324,_11530),user:'burg tabled'(t,1547324,_11544),user:'$burg$1'(t,1547324),_11516) at /usr/lib/swi-prolog/boot/tabling.pl:269 ERROR: [27] burg(t,1547324,_11584) at /home/hakank/cplint/cplint/prolog/examples/alarm.pl:17 ERROR: [26] 'alarm tabled'(t,1547324,_11612) at /home/hakank/cplint/cplint/prolog/examples/alarm.pl:23 ERROR: [25] reset(user:'alarm tabled'(t,1547324,_11654),_11638,_11640) at /usr/lib/swi-prolog/boot/init.pl:400 ERROR: [24] '$tabling':moded_delim(user:alarm(t,1547324,_11706),user:'$alarm$1'(t,1547324),user:'alarm tabled'(t,1547324,_11732),1559308,[]) at /usr/lib/swi-prolog/boot/ tabling.pl:332 ERROR: [23] '$tabling':moded_activate(user:alarm(t,1547324,_11786),user:'$alarm$1'(t,1547324),_11766,user:'alarm tabled'(t,1547324,_11812),(0x55f54c1f29f0),1559308) at /usr/lib/swi-prolog/boot/tabling.pl:320 ERROR: [22] '$tabling':run_leader(user:alarm(t,1547324,_11868),user:'$alarm$1'(t,1547324),_11846,user:'alarm tabled'(t,1547324,_11894),(0x55f54c1f29f0),1559260,_11854) at /usr/lib/swi-prolog/boot/tabling.pl:301 ERROR: [21] setup_call_catcher_cleanup('$tabling':true,'$tabling':run_leader(...,...,_11944,...,(0x55f54c1f29f0),1559260,_11952),_11922,'$tabling':finished_leader(_11962,1559260,...)) at /usr/lib/swi-prolog/boot/init.pl:468 ERROR: [20] '$tabling':start_tabling(user:alarm(t,1547324,_12016),user:'alarm tabled'(t,1547324,_12030),user:'$alarm$1'(t,1547324),_12002) at /usr/lib/swi-prolog/boot/tabling.pl:269 ERROR: [19] alarm(t,1547324,_12070) at /home/hakank/cplint/cplint/prolog/examples/alarm.pl:21 ERROR: [18] '$goal0'(1547324,_12096) 1-st clause of '$goal0'/2 ERROR: [17] pita:get_node(user:'$goal0',1547324,_12130) at /home/hakank/lib/swipl/pack/cplint/prolog/pita.pl:701 ERROR: [16] pita:get_p(user:'$goal0',1547324,_12170) at /home/hakank/lib/swipl/pack/cplint/prolog/pita.pl:663 ERROR: [15] '$bags':findall_loop((alarm(t),_12218),pita:get_p(...,1547324,_12236),_12210,[]) at /usr/lib/swi-prolog/boot/bags.pl:98 """

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/friguzzi/cplint/issues/27?email_source=notifications&email_token=ACJRCBEI3C3S3OPFDL2R4KDPY7SHVA5CNFSM4HT6HNKKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GX2C4KA, or mute the thread https://github.com/notifications/unsubscribe-auth/ACJRCBHBLHF7OZ5RKPZFIETPY7SHVANCNFSM4HT6HNKA .

hakank commented 5 years ago

Sorry, but I updated cplint (pack_upgrade(cplint) and pack_rebuild(cplint)) but there are still problems.

?- [library(cplint_test/test)]. ?- test.

?- test.
% PL-Unit: coin prob(heads(coin),A),close_to(A,0.51).
% 206 inferences, 0.000 CPU in 0.000 seconds (100% CPU, 1205517 Lips)
ERROR: /home/hakank/lib/swipl/pack/cplint/prolog/cplint_test/test_pita.pl:87:
    test h_c: received error: reset/3: Undefined procedure: plunit_coin:'toss tabled'/3
(prob(heads(coin),A),bar(A,B)),close_to(A,0.51),is_dict(B).
% 204 inferences, 0.000 CPU in 0.000 seconds (100% CPU, 1270316 Lips)
ERROR: /home/hakank/lib/swipl/pack/cplint/prolog/cplint_test/test_pita.pl:89:
    test h_c_b: received error: reset/3: Undefined procedure: plunit_coin:'toss tabled'/3
(prob(heads(coin),A),bar1(A,B)),close_to(A,0.51),is_dict(B).
% 204 inferences, 0.000 CPU in 0.000 seconds (100% CPU, 1380851 Lips)
ERROR: /home/hakank/lib/swipl/pack/cplint/prolog/cplint_test/test_pita.pl:91:
    test h_c_b2: received error: reset/3: Undefined procedure: plunit_coin:'toss tabled'/3
prob((heads(coin),biased(coin)),A),close_to(A,0.06).
% 274 inferences, 0.000 CPU in 0.000 seconds (100% CPU, 1663176 Lips)
ERROR: /home/hakank/lib/swipl/pack/cplint/prolog/cplint_test/test_pita.pl:93:
    test h_c_b_c: received error: reset/3: Undefined procedure: plunit_coin:'toss tabled'/3
....

Also, the alarm.pl program still give errors: $ swipl alarm.pl ?- prob(alarm(t),Prob).

ERROR: Undefined procedure: 'burg tabled'/3
ERROR: In:
ERROR:   [34] 'burg tabled'(t,1340476,_11126)
ERROR:   [33] reset(user:'burg tabled'(t,1340476,_11168),_11152,_11154) at /usr/lib/swi-prolog/boot/init.pl:400
ERROR:   [32] '$tabling':moded_delim(user:burg(t,1340476,_11220),user:'$burg$1'(t,1340476),user:'burg tabled'(t,1340476,_11246),1353220,[]) at /usr/lib/swi-prolog/boot/tabling.pl:332
ERROR:   [31] '$tabling':moded_activate(user:burg(t,1340476,_11300),user:'$burg$1'(t,1340476),_11280,user:'burg tabled'(t,1340476,_11326),<trie>(0x55d473c29670),1353220) at /usr/lib/swi-prolog/boot/tabling.pl:320
ERROR:   [30] '$tabling':run_leader(user:burg(t,1340476,_11382),user:'$burg$1'(t,1340476),_11360,user:'burg tabled'(t,1340476,_11408),<trie>(0x55d473c29670),1353192,_11368) at /usr/lib/swi-prolog/boot/tabling.pl:301
ERROR:   [29] setup_call_catcher_cleanup('$tabling':true,'$tabling':run_leader(...,...,_11458,...,<trie>(0x55d473c29670),1353192,_11466),_11436,'$tabling':finished_leader(_11476,1353192,...)) at /usr/lib/swi-prolog/boot/init.pl:468
ERROR:   [28] '$tabling':start_tabling(user:burg(t,1340476,_11530),user:'burg tabled'(t,1340476,_11544),user:'$burg$1'(t,1340476),_11516) at /usr/lib/swi-prolog/boot/tabling.pl:269
ERROR:   [27] burg(t,1340476,_11584) at /home/hakank/cplint/cplint/prolog/examples/alarm.pl:17
ERROR:   [26] 'alarm tabled'(t,1340476,_11612) at /home/hakank/cplint/cplint/prolog/examples/alarm.pl:23
ERROR:   [25] reset(user:'alarm tabled'(t,1340476,_11654),_11638,_11640) at /usr/lib/swi-prolog/boot/init.pl:400
ERROR:   [24] '$tabling':moded_delim(user:alarm(t,1340476,_11706),user:'$alarm$1'(t,1340476),user:'alarm tabled'(t,1340476,_11732),1352804,[]) at /usr/lib/swi-prolog/boot/tabling.pl:332
ERROR:   [23] '$tabling':moded_activate(user:alarm(t,1340476,_11786),user:'$alarm$1'(t,1340476),_11766,user:'alarm tabled'(t,1340476,_11812),<trie>(0x55d473c28f50),1352804) at /usr/lib/swi-prolog/boot/tabling.pl:320
ERROR:   [22] '$tabling':run_leader(user:alarm(t,1340476,_11868),user:'$alarm$1'(t,1340476),_11846,user:'alarm tabled'(t,1340476,_11894),<trie>(0x55d473c28f50),1352756,_11854) at /usr/lib/swi-prolog/boot/tabling.pl:301
ERROR:   [21] setup_call_catcher_cleanup('$tabling':true,'$tabling':run_leader(...,...,_11944,...,<trie>(0x55d473c28f50),1352756,_11952),_11922,'$tabling':finished_leader(_11962,1352756,...)) at /usr/lib/swi-prolog/boot/init.pl:468
ERROR:   [20] '$tabling':start_tabling(user:alarm(t,1340476,_12016),user:'alarm tabled'(t,1340476,_12030),user:'$alarm$1'(t,1340476),_12002) at /usr/lib/swi-prolog/boot/tabling.pl:269
ERROR:   [19] alarm(t,1340476,_12070) at /home/hakank/cplint/cplint/prolog/examples/alarm.pl:21
ERROR:   [18] '$goal0'(1340476,_12096) 1-st clause of '$goal0'/2 <no source>
ERROR:   [17] pita:get_node(user:'$goal0',1340476,_12130) at /home/hakank/lib/swipl/pack/cplint/prolog/pita.pl:701
ERROR:   [16] pita:get_p(user:'$goal0',1340476,_12170) at /home/hakank/lib/swipl/pack/cplint/prolog/pita.pl:663
ERROR:   [15] '$bags':findall_loop((alarm(t),_12218),pita:get_p(...,1340476,_12236),_12210,[]) at /usr/lib/swi-prolog/boot/bags.pl:98
damianoazzolini commented 5 years ago

@hakank everything shoul be fixed now. Try to update both cplint and bddem. Then try $ swipl prolog/cplint_test/test.pl and ?- test.

hakank commented 5 years ago

Excellent! Thanks.