ai-krml-uoft / indigolog

High-level programming language with incremental execution and local search
http://www.cs.toronto.edu/cogrobo/main/systems/index.html
MIT License
6 stars 2 forks source link

Issues Running Examples in elevator_simple #6

Closed angelo-casciani closed 1 month ago

angelo-casciani commented 1 month ago

Hi,

I have encountered issues while attempting to run the provided examples in the elevator_simple folder, following the instructions outlined in the corresponding README file. Even though I followed the steps in the documentation, the examples don’t run as expected.

To help with troubleshooting, I have attached the full stack traces from my attempts. Let me know if you need any more information.

############################################################################################

Elevator simple: Example 1

angelo@hercules:~/Downloads/SitCalc/indigolog-main$ swipl config.pl examples/elevator_simple/main_01.pl Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:49: Warning: Redefined static procedure indigolog/1 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog.pl:197 Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:134: Warning: Redefined static procedure findpath/3 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-search.pl:44 Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:160: Warning: Redefined static procedure expand_interrupts/2 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:67 Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:179: Warning: Redefined static procedure subv/4 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/lib/common.pl:13 Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:182: Warning: Redefined static procedure subvl/4 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/lib/common.pl:18 Welcome to SWI-Prolog (threaded, 64 bits, version 9.2.6) SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software. Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- main(basic). ERROR: Unknown procedure: calc_arg/3 ERROR: In: ERROR: [26] calc_arg(down,_328,[]) ERROR: [25] trans(down,[],[],[_364]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:142 ERROR: [23] trans(while(neg(...),if(...,up,down)),[],[[],...],[_430]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:121 ERROR: [21] trans([go_floor(2),open|...],[],[[[]|...],open|...],[_500]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:110 ERROR: [18] trans([[],...],[],[[[]|...],open|...],[_566]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:108 ERROR: [17] trans([[[]|...],...],[],[[...|...],...],[_638]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:110 ERROR: [16] trans([[...|...],...|...],[],[[...|...],...|...],[_710]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:110 ERROR: [15] indigo([[...|...],...|...],[]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:56 ERROR: [11] toplevel_call(user:user: ...) at /usr/lib/swi-prolog/boot/toplevel.pl:1317 ERROR: ERROR: Note: some frames are missing due to last-call optimization. ERROR: Re-run your program in debug mode (:- debug.) to get more detail. Exception: (26) calc_arg(down, _260, []) ?

The solution to the first problem was to run the script with "main." and not "main(basic)". In this case, I got:

angelo@hercules:~/Downloads/SitCalc/indigolog-main$ swipl config.pl examples/elevator_simple/main_01.pl Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:49: Warning: Redefined static procedure indigolog/1 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog.pl:197 Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:134: Warning: Redefined static procedure findpath/3 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-search.pl:44 Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:160: Warning: Redefined static procedure expand_interrupts/2 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:67 Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:179: Warning: Redefined static procedure subv/4 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/lib/common.pl:13 Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:182: Warning: Redefined static procedure subvl/4 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/lib/common.pl:18 Welcome to SWI-Prolog (threaded, 64 bits, version 9.2.6) SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software. Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- main. Controllers available: [basic,dumb,smart] Select controller: basic |: .

Executing controller: basic ERROR: Unknown procedure: calc_arg/3 ERROR: In: ERROR: [26] calc_arg(down,_16804,[]) ERROR: [25] trans(down,[],[],[_16840]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:142 ERROR: [23] trans(while(neg(...),if(...,up,down)),[],[[],...],[_16906]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:121 ERROR: [21] trans([go_floor(2),open|...],[],[[[]|...],open|...],[_16976]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:110 ERROR: [18] trans([[],...],[],[[[]|...],open|...],[_17042]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:108 ERROR: [17] trans([[[]|...],...],[],[[...|...],...],[_17114]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:110 ERROR: [16] trans([[...|...],...|...],[],[[...|...],...|...],[_17186]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:110 ERROR: [15] indigo([[...|...],...|...],[]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:56 ERROR: [11] toplevel_call(user:user:main) at /usr/lib/swi-prolog/boot/toplevel.pl:1317 ERROR: ERROR: Note: some frames are missing due to last-call optimization. ERROR: Re-run your program in debug mode (:- debug.) to get more detail. Exception: (26) calc_arg(down, _256, []) ? creep Exception: (25) trans(down, [], _238, _156) ?

############################################################################################

Elevator simple: Example 2

angelo@hercules:~/Downloads/SitCalc/indigolog-main$ swipl config.pl examples/elevator_simple/main_02.pl Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:49: Warning: Redefined static procedure indigolog/1 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog.pl:197 Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:134: Warning: Redefined static procedure findpath/3 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-search.pl:44 Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:160: Warning: Redefined static procedure expand_interrupts/2 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:67 Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:179: Warning: Redefined static procedure subv/4 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/lib/common.pl:13 Warning: /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:182: Warning: Redefined static procedure subvl/4 Warning: Previously defined at /home/angelo/Downloads/SitCalc/indigolog-main/lib/common.pl:18 Welcome to SWI-Prolog (threaded, 64 bits, version 9.2.6) SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software. Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- main. Controllers available: [basic(1),basic(2),concurrent] Selec(1)ontroller: basic(1 |: .

Executing controller: basic(1) Exogenous input (ending with "."): |: heat. Exogenous input (ending with "."): |: nil.

ERROR: Unknown procedure: calc_arg/3 ERROR: In: ERROR: [21] calc_arg(look(1),_20378,[heat]) ERROR: [20] trans(look(1),[heat],[],[_20434,heat]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:142 ERROR: [19] trans([look(1),...|...],[heat],[[],...|...],[_20510,heat]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:110 ERROR: [17] trans([check_buttons,...],[heat],[[[]|...],...],[_20588,heat]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/transfinal-congolog.pl:110 ERROR: [15] indigo(control(basic(1)),[heat]) at /home/angelo/Downloads/SitCalc/indigolog-main/interpreters/indigolog_plain.pl:56 ERROR: [11] toplevel_call(user:user:main) at /usr/lib/swi-prolog/boot/toplevel.pl:1317 ERROR: ERROR: Note: some frames are missing due to last-call optimization. ERROR: Re-run your program in debug mode (:- debug.) to get more detail. Exception: (21) calc_arg(look(1), _9984, [heat]) ? creep Exception: (20) trans(look(1), [heat], _9978, _9824) ?

ssardina commented 1 month ago

Found what is happening with the plain interpreter; there are clashes on the predicates. easy fix, will do it.

ssardina commented 1 month ago

@angelo-casciani I believe I have fixed the clashes that you were getting. :+1: