poole@CPSC-M-POOLE01 prolog % swipl Welcome to SWI-Prolog (threaded, 64 bits, version 9.0.4) 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). ?- [naf]. true. ?- q. true. ?- \+ s. true. ?- s. false. ?- p. true ; false. ?- trace. true. [trace] ?- p. Call: (10) p ? creep Call: (11) q ? creep Call: (12) s ? creep Call: (13) w ? creep Fail: (13) w ? creep Fail: (12) s ? creep Redo: (11) q ? creep Exit: (11) q ? creep Call: (11) r ? creep Call: (12) t ? creep Exit: (12) t ? creep Fail: (11) r ? creep Redo: (10) p ? creep Exit: (10) p ? creep true . [trace] ?- ^D % halt poole@CPSC-M-POOLE01 prolog % swipl Welcome to SWI-Prolog (threaded, 64 bits, version 9.0.4) 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). ?- [beach]. true. ?- away_from_beach. true. ?- beach_access. false. ?- assert(on_beach). % this dynamically states a fact is true true. ?- away_from_beach. false. ?- beach_access. true. ?- assert(enclosed_bay). true. ?- beach_access. true. ?- swim_at_beach. true. ?- assert(big_city). true. ?- swim_at_beach. false. ?- assert(in_BC). true. ?- swim_at_beach. true. ?- assert(p(a)). ERROR: No permission to modify static procedure `p/1' ERROR: Defined at /Users/poole/World/cs312/2024/prolog/beach.pl:30 ERROR: In: ERROR: [10] assert(p(a)) ERROR: [9] toplevel_call('') at /opt/local/lib/swipl/boot/toplevel.pl:1173 ?- ^D % halt poole@CPSC-M-POOLE01 prolog % swipl Welcome to SWI-Prolog (threaded, 64 bits, version 9.0.4) 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). ?- (3+4)=7. false. ?-