6.4 Facts

Introduction

A fact expresses something static, e.g., a graph or a structure.

A rule expresses something dynamic, i.e., something that can be computed.

Facts

Syntax

A consists of a term followed by a period:

term.

The term can be any kind of term, except a variable or a number.

Examples

Consider the following facts:

// A structure
graph(graph1, [Cat]).
graph(graph2, [Dog]).

// A string
"It is raining.".

// An identifier
AlfredWasWise.

Structures are the most useful kind of terms to be used for facts.


PrevLite: 6.3 Variables
NextLite: 6.5 Rules, Goals and Subgoals

Prev: 6.3 Variables
Up: 6 Prolog for CG users
Next: 6.5 Rules, Goals and Subgoals