Questions tagged [steadfastness]

Steadfastness denotes a desirable property of Prolog programs. Intuitively, it means that instantiations of predicate arguments do not change the meaning of the relation.

The notion of steadfastness was coined by Richard O'Keefe. It occurs in several Usenet postings and in his book, The Craft of Prolog (1990).

A predicate is called steadfast if it does not give wrong answers even when the query has an unexpected form. Typically, this means cases where arguments that we think of as output arguments are already instantiated.

As stated by Richard in 1987:

It is tempting to try to fix some of these problems by adding cuts. That can make some problems worse (steadfastness, inverse correctness). Very often it turns out that the way to eliminate the problems is to make your code purer.

Many of the "classical" cases where this property was easily violated can nowadays be more elegantly expressed by pure Prolog features that have since become more widely available. These features preserve steadfastness more naturally than was possible in early Prolog systems, and at the same time yield more general programs.

See for more information.

1 questions
14
votes
1 answer

Steadfastness: Definition and its relation to logical purity and termination

So far, I have always taken steadfastness in Prolog programs to mean: If, for a query Q, there is a subterm S, such that there is a term T that makes ?- S=T, Q. succeed although ?- Q, S=T. fails, then one of the predicates invoked by Q is not…
mat
  • 40,498
  • 3
  • 51
  • 78