Prolog using examples – Part 4

In this part of this practical tutorial, we are going to do some coding involving facts, rules, recursion, and lists. Example 1: Obtain the head of the list, obtain the tail of the list. /* Get the head of the list */ get_head(Head, [Head|_]). /* Get the tail of the list */ get_tail(Tail, [_|Tail]). ?- […]

Share

Prolog using Examples – Part 1

Prolog is a programming language which works around relations not functions. Prolog is homoiconic due the structure of its clauses and database that provide it the ability to represent itself. Note: A language is homoiconic when the language is self-defined. This means that if we run on the interpreter a copy of itself, it should […]

Share