There are many ways to express relations in programming, where a ''relation'' is defined herein as a (mathematical) function of 1 or more arguments (zero if you count the trivial relations "true" and "false") which returns a boolean as a result. (Some systems may allow states besides "true" and "false"--"unknown" and "contradiction" are often found; see ThreeValuedLogic). The restriction on returning booleans isn't really that much of a restriction (though it's a pain when you ''implement'' relational system); a ''k''-ary function returning an arbitrary value can be ReFactor''''''ed easily into a (''k+1'')-ary relation which does return a boolean. There are many techniques that ComputerScience has come up with to express relations; each with their advantages and disadvantages: * Enumeratively: by storing elements of the relation in a RelationalDatabase table or other appropriate data structure. (In most such systems, the ClosedWorldAssumption is used: if a corresponding entry in a table appears then the answer is true, otherwise it's false). * Imperatively: providing an algorithm (procedure) to compute the relation. * Declaratively: by providing ''rules'' to compute the relation based on other relations, use of a TheoremProvingSystem to solve an arbitrary query. The first technique has the advantage of always terminating (assuming the data structure used is finite), and is an excellent way of representing arbitrary facts (which is one reason that RelationalDatabase''''''s are in such wide use). Plus you get (potentially) all the other advantages of an RDBMS. The second technique is what programmers are used to (though most programmers aren't used to expressing arbitrary functions as relations). Arbitrary functions might not halt, of course, though many programmers are skilled in the art of avoiding this situation. The third technique is (coupled with the first) the hallmark of ConstraintProgramming and LogicProgramming systems. In general, TheoremProvingSystem''''''s may not halt, but there are important subsets (such as those based on Horn clauses) for which theorem-proving is decidable. (PrologLanguage is based on this). I'm aware of numerous programming systems which provide two of the three (well); I'm not aware of many that provide all three. ---- See also DatabaseIsRepresenterOfFacts