append(, L, L). append([H|T], L2, [H|L3]) :- append(T, L2, L3). ?- appendx([1,2],[3,4],X). X = [1, 2, 3, 4]. ?- appendx([1,2],X,[1,2,3,4]). X = [3, 4]. ?- appendx(X,[3,4],[1,2,3,4]). X = [1, 2].
Get better at programming through fun, rewarding coding exercises that test your understanding of concepts with Exercism.
Given a DNA string, compute how many times each nucleotide occurs in the string.
Given a year, report if it is a leap year.
Rebuild binary trees from pre-order and in-order traversals.
SWI-Prolog offers a comprehensive set of built-in predicates, covering many established standards.
A single language element, called a clause, is the basis of all prolog relations and programs.
Prolog focuses on what holds true about solutions, rather than how it is implemented.
Prolog is based on the rules of logic, with execution being a form of logical resolution.
Prolog programs are also valid prolog terms, programs can interact with other prolog programs.
Implementations exist for Unix/Linux, Windows, MacOS platforms with targets to WebAssembly (WASM).
Every language has its own way of doing things. Prolog is no different. Our mentors will help you learn to think like a Prolog developer and how to write idiomatic code in Prolog. Once you've solved an exercise, submit it to our volunteer team, and they'll give you hints, ideas, and feedback on how to make it feel more like what you'd normally see in Prolog - they'll help you discover the things you don't know that you don't know.Learn more about mentoring
The Prolog track on Exercism has 19 exercises to help you write better code. Discover new exercises as you progress and get engrossed in learning new concepts and improving the way you currently write.See all Prolog exercises
The best part, it’s 100% free for everyone.