1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | % Author: % Date: 1/17/2012 word([m,a,n]). word([w,o,m,a,n]). word([h,e,l,l,o]). correct(A,B):-word(X),oneletter(X,A,B). oneletter([],[],[]). oneletter([A|B],[C|D],[X|T]):-A\=C,X=A,oneletteroh(B,D,T). oneletter([A|B],[C|D],[X|T]):-A==C,X=A,oneletter(B,D,T). oneletteroh([],[],[]). oneletteroh([A|B],[C|D],[X|T]):-A==C,X=A,oneletteroh(B,D,T). twist([A|B],[C|D],[X|T]):-A\=C,X=A,twisttwo(B,D,T,C). twist([A|B],[C|D],[X|T]):-A==C,X=A,twist(B,D,T). twisttwo([],[],[]). twisttwo([A|B],[C|D],[X|T],F):-A==C,X=A,twisttwo(B,D,T,F). twisttwo([A|B],[C|D],[X|T],F):-A\=C,X=A,C==F,oneletteroh(B,D,T). |
JSBBdXRob3I6CiUgRGF0ZTogMS8xNy8yMDEyCndvcmQoW20sYSxuXSkuCndvcmQoW3csbyxtLGEsbl0pLgp3b3JkKFtoLGUsbCxsLG9dKS4KCmNvcnJlY3QoQSxCKTotd29yZChYKSxvbmVsZXR0ZXIoWCxBLEIpLgoKb25lbGV0dGVyKFtdLFtdLFtdKS4Kb25lbGV0dGVyKFtBfEJdLFtDfERdLFtYfFRdKTotQVw9QyxYPUEsb25lbGV0dGVyb2goQixELFQpLgpvbmVsZXR0ZXIoW0F8Ql0sW0N8RF0sW1h8VF0pOi1BPT1DLFg9QSxvbmVsZXR0ZXIoQixELFQpLgoKb25lbGV0dGVyb2goW10sW10sW10pLgpvbmVsZXR0ZXJvaChbQXxCXSxbQ3xEXSxbWHxUXSk6LUE9PUMsWD1BLG9uZWxldHRlcm9oKEIsRCxUKS4KCnR3aXN0KFtBfEJdLFtDfERdLFtYfFRdKTotQVw9QyxYPUEsdHdpc3R0d28oQixELFQsQykuCnR3aXN0KFtBfEJdLFtDfERdLFtYfFRdKTotQT09QyxYPUEsdHdpc3QoQixELFQpLgoKdHdpc3R0d28oW10sW10sW10pLgp0d2lzdHR3byhbQXxCXSxbQ3xEXSxbWHxUXSxGKTotQT09QyxYPUEsdHdpc3R0d28oQixELFQsRikuCnR3aXN0dHdvKFtBfEJdLFtDfERdLFtYfFRdLEYpOi1BXD1DLFg9QSxDPT1GLG9uZWxldHRlcm9oKEIsRCxUKS4=
-
upload with new input
-
result: Success time: 0.03s memory: 6204 kB returned value: 0
% Author: % Date: 1/17/2012 word([m,a,n]). word([w,o,m,a,n]). word([h,e,l,l,o]). correct(A,B):-word(X),oneletter(X,A,B). oneletter([],[],[]). oneletter([A|B],[C|D],[X|T]):-A\=C,X=A,oneletteroh(B,D,T). oneletter([A|B],[C|D],[X|T]):-A==C,X=A,oneletter(B,D,T). oneletteroh([],[],[]). oneletteroh([A|B],[C|D],[X|T]):-A==C,X=A,oneletteroh(B,D,T). twist([A|B],[C|D],[X|T]):-A\=C,X=A,twisttwo(B,D,T,C). twist([A|B],[C|D],[X|T]):-A==C,X=A,twist(B,D,T). twisttwo([],[],[]). twisttwo([A|B],[C|D],[X|T],F):-A==C,X=A,twisttwo(B,D,T,F). twisttwo([A|B],[C|D],[X|T],F):-A\=C,X=A,C==F,oneletteroh(B,D,T). ?- correct([n,a,m],X).
true true true ERROR: toplevel: Undefined procedure: (:-)/2 (DWIM could not correct goal) true. ERROR: toplevel: Undefined procedure: (:-)/2 (DWIM could not correct goal) ERROR: toplevel: Undefined procedure: (:-)/2 (DWIM could not correct goal) true. ERROR: toplevel: Undefined procedure: (:-)/2 (DWIM could not correct goal) ERROR: toplevel: Undefined procedure: (:-)/2 (DWIM could not correct goal) ERROR: toplevel: Undefined procedure: (:-)/2 (DWIM could not correct goal) true. ERROR: toplevel: Undefined procedure: (:-)/2 (DWIM could not correct goal) ERROR: toplevel: Undefined procedure: (:-)/2 (DWIM could not correct goal) ERROR: toplevel: Undefined procedure: (?-)/1 (DWIM could not correct goal)
-
result: Success time: 0.03s memory: 6204 kB returned value: 0
?- correct([n,a,m],X).
ERROR: toplevel: Undefined procedure: (?-)/1 (DWIM could not correct goal)
-
result: Success time: 0.02s memory: 6204 kB returned value: 0



