Welcome to SWI-Prolog (Version 2.7.16) Copyright (c) 1993-1996 University of Amsterdam. All rights reserved. For help, use ?- help(Topic). or ?- apropos(Word). 1 ?- consult('colorsV1.pro'). colorsV1.pro compiled, 0.00 sec, 1,868 bytes. Yes 2 ?- listing. mix(blue, red, purple). mix(red, yellow, orange). mix(blue, yellow, green). secondary(orange). secondary(purple). secondary(green). '$user_query'(2, []) :- listing. other(aqua). other(mauve). primary(red). primary(blue). primary(yellow). Yes 3 ?- primary(purple). No 4 ?- primary(blue). Yes 5 ?- primary(X). X = red ; X = blue ; X = yellow ; No 6 ?- primary(P),write(S),nl,fail. _G246 _G246 _G246 No 7 ?- primary(P),write(S),n1,fail. [WARNING: Undefined predicate: `n1/0'] No 8 ?- primary(P),write(P),nl,fail. red blue yellow No 9 ?- secondary(S),write(S),nl,fail. orange purple green No 10 ?- other(mauve)\ | | other(muave) | | ^C Action (h for help) ? Options: a: abort b: break c: continue e: exit g: goals t: trace h (?): help Action (h for help) ? abort Execution Aborted 10 ?- other(muave) | | . No 11 ?- other(muave) | . No 12 ?- other(muave). No 13 ?- other(mauve). Yes 14 ?- other(blue). No 15 ?- other(magenta). No 16 ?- other(Other),write(Other),nl,fail. aqua mauve No 17 ?- mix(blue,red,Color). Color = purple Yes 18 ?- mix(red,blue,Color). No 19 ?- mix(C1,C2,green). C1 = blue C2 = yellow Yes 20 ?- halt.