PROLOG - Part 8
There is logic behind everything and every rule. We sometimes negate this but every thing and every happening has a logic and reason behind it.**
PROLOG Internals
In my last post I wrote about cut, fail and repeat. This time I am going to expand the understanding on internals and data structures.
Terms can be constants, variables or a structure.
- A constant may be an atom or a number - which can be an integer or real number. We defined atom some posts ago. :)
- A variable is a string of letters, digits and / or underscores starting with a upper-case letter or an underscore.
- A structure represents an atomic preposition of predicates. Structures have the form
blub(t1,t2,t3,...,tn)
where blub is our atom and t1,t2,…,tn are our parameters. n is also the arity of our term.
Keep in mind: there is no type declaration in PROLOG. The interpreter will figure it out for you. :)