Is this Prolog terminology correct? (fact, rule, procedure, predicate, …)

前端 未结 3 834
时光取名叫无心
时光取名叫无心 2020-12-19 07:43

Getting the terminology correct is part of the success to communicating a concept and when the wrong terminology is used here at SO with the Prolog tag the respondents nicel

3条回答
  •  佛祖请我去吃肉
    2020-12-19 08:29

    ISO glossary is a little suble. It has also an entry:

    3.133 predication : A predicate with arity N and a sequence of N arguments .

    Since control constructs such as (’,’)/2, etc… are also predicates in Prolog, the above, i.e. the notion predication, is not a prime formula, and this here is correct:

    3.81 goal : A predication which is to be executed (see body , query , and 7.7.3).`

    This differs considerable from the first order logic vocabulary, where logical connectives such as conjunction (∧) are not considered predicates and are therefore not part of the language signature. This ISO core standard specific language, has to do with the homoiconicity of Prolog. Basically we can freely switch between terms, with for example (’,’)/2 as functor and goals which have the same functor. Here is an example what can be done in Prolog:

    ?- expand_goal(H, G), G.
    

    The later is not available in first order logic, since first order logic doesn’t allow this kind of “meta-programming”. There was an attempt by John W. Lloyd to create a different language, Prolog inspired language, which would also handle “meta-programming” a different way. The language was:

    Gödel’s meta-logical facilities provide support for meta-programs that do analysis, transformation, compilation, verification, and debugging, among other tasks. https://en.wikipedia.org/wiki/G%C3%B6del_(programming_language)

    The ISO core standard should be seen in this context, that it reflects the very specific capabilities of Prolog concerning “meta-programming”, which is remote from first order logic. This means the terminology in the ISO core standard belongs to an artificial vocabulary, respectively constructed terminology, especially created for Prolog and the ISO core standard.

    Its not a language that is found elsewhere in computer science, mathematical logic or the real world. In as far there is nothing to correct or tweak, since it is a terminology created for the purpose of the ISO core standard, and every ammendment with respect to some use elsewhere in computer science, mathematical logic or the real world is simply baseless.

    A similar constructed terminology emerged for the DCG draft standard, the many years people were working on it, up to the point that the beloved “push back” was replaced by “semi context”. :-( :-) Since Ulrich Neumerkel saved all versions of the DCG draft standard, you can watch the evolution of the constructed terminology.

    I don’t know whether its possible to dig up a document collection that would show the evolution of the terminology in the ISO core standard. Predicate indicator is a Prolog term of the form N/A, predicate is not a Prolog term, but abstractly the pair . 3.133 predication is a nice example that can be easier formulated with predicate than with predicate indicator.

提交回复
热议问题