4 ms·
Yeah, Prolog's unification operator really blows your mind the first few times you experience it. You left the best part out of that last example: ?- appen
by OskarS 9y ago
Yeah, Prolog's unification operator really blows your mind the first few times you experience it. You left the best part out of that last example:
?- append(X, Y, [1,2,3]).
X = [],
Y = [1, 2, 3] ;
X = [1],
Y = [2, 3] ;
X = [1, 2],
Y = [3] ;
X = [1, 2, 3],
Y = [] ;
false.
(a few newlines added for clarity)