2 ms·
What is magical apart from pattern matching is how you can invocate it with mixed ground terms and variables, and it computes values that makes the relationship
by junke 6y ago
What is magical apart from pattern matching is how you can invocate it with mixed ground terms and variables, and it computes values that makes the relationship holds. For example:
[eclipse 2]: concat(A,[_,_],[0,1,2,3,4]).
A = [0, 1, 2]
Yes (0.00s cpu, solution 1, maybe more) ? ;
No (0.00s cpu)
Or iterate over all lists that concatenate as [0,1,2]
[eclipse 3]: concat(A,B,[0,1,2]).
A = []
B = [0, 1, 2]
Yes (0.00s cpu, solution 1, maybe more) ? ;
A = [0]
B = [1, 2]
Yes (0.00s cpu, solution 2, maybe more) ? ;
A = [0, 1]
B = [2]
Yes (0.00s cpu, solution 3, maybe more) ? ;
A = [0, 1, 2]
B = []
Yes (0.00s cpu, solution 4)