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). ?- atomic(7). true. ?- atomic(y). true. ?- atomic((2+3)). false. ?- atomic(foo(z,w)). false. ?- [algebra]. true. ?- dv(x+3*x+6*x*y+ 11*x*x, x, D). D = 1+(x*0+3*1)+(y*(x*0+6*1)+6*x*0)+(x*(x*0+11*1)+11*x*1) ; false. ?- [algebra]. true. ?- dv(x+3*x+6*x*y+ 11*x*x, x, D), smp(D,E). D = 1+(x*0+3*1)+(y*(x*0+6*1)+6*x*0)+(x*(x*0+11*1)+11*x*1), E = 1+3+y*6+(x*11+11*x) . ?- dv(x+3*x+6*x*y+ 11*x*x, x, D), smp(D,E),dv(E,y,DY),smp(DY,SY). D = 1+(x*0+3*1)+(y*(x*0+6*1)+6*x*0)+(x*(x*0+11*1)+11*x*1), E = 1+3+y*6+(x*11+11*x), DY = 0+0+(6*1+y*0)+(11*0+x*0+(x*0+11*0)), SY = 6 . ?- append(X,[a,b,c],Y). X = [], Y = [a, b, c] . ?- append([the,cat],X,Y). Y = [the, cat|X]. ?- Y = [the, cat|X], X = [sat,on|Z]. Y = [the, cat, sat, on|Z], X = [sat, on|Z]. ?-