Symbol (programming) - Support - Prolog - Examples

Examples

The following example demonstrates two facts (describing what father is) and one rule (describing the meaining of sibling). These three sentences use symbols (father, zeus, hermes, perseus and sibling) and some abstract variables (X, Y and Z). The mother relationship has been omitted for clarity.

father (zeus, hermes). father (zeus, perseus). sibling (X, Y) :- father (Z, X), father (Z, Y).

Read more about this topic:  Symbol (programming), Support, Prolog

Famous quotes containing the word examples:

    In the examples that I here bring in of what I have [read], heard, done or said, I have refrained from daring to alter even the smallest and most indifferent circumstances. My conscience falsifies not an iota; for my knowledge I cannot answer.
    Michel de Montaigne (1533–1592)

    There are many examples of women that have excelled in learning, and even in war, but this is no reason we should bring ‘em all up to Latin and Greek or else military discipline, instead of needle-work and housewifry.
    Bernard Mandeville (1670–1733)

    No rules exist, and examples are simply life-savers answering the appeals of rules making vain attempts to exist.
    André Breton (1896–1966)