Prolog matching

Prolog matches male(X) with male(jan), thereby instantiating the variable X to jan. There are three types of terms: Constants. These can either be atoms (such as jan) or numbers (such as 24). Variables. Complex terms. These have the form: functor(term_1,…,term_n).   Two terms match, if they are equal or if they contain variables that can […]

Prolog custom operators

Operator definitions in Prolog look like this:

There are the following possibilities for what Type may look like: infix xfx, xfy, yfx prefix fx, fy suffix xf, yf   x stands for an argument with lower precedence than operator f y stands for an argument with lower or equal precedence than operator f