fix flatten/2: it would not create variable elements.
This commit is contained in:
parent
8169ef0343
commit
6f0b3cf2f5
@ -345,7 +345,7 @@ list_concat([H|T], [H|Lf], Li) :-
|
||||
%
|
||||
flatten(X,Y) :- flatten_list(X,Y,[]).
|
||||
|
||||
flatten_list(V) --> {var(V)}, !.
|
||||
flatten_list(V) --> {var(V)}, !, [V].
|
||||
flatten_list([]) --> !.
|
||||
flatten_list([H|T]) --> !, flatten_list(H),flatten_list(T).
|
||||
flatten_list(H) --> [H].
|
||||
|
Reference in New Issue
Block a user