Sunday, February 16, 2025

4. Write a Prolog program to implement append for two lists.

 

Write a Prolog program to implement append for two lists.

% Write a Prolog program to implement append for two lists.


/*concatenate*/
conc([],L,L).
conc([X|M],N,[X|Q]):-
 conc(M,N,Q). 

% Output
Prolog program to implement append for two lists
                      Prolog program to implement append for two lists

No comments:

Post a Comment

15. Write a Prolog program to implement two predicates evenlength(List) and oddlength(List) so that they are true if their argument is a list of even or odd length respectively.

  Write a Prolog program to implement two predicates evenlength(List) and oddlength(List) so that they are true if their argument is a list ...