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

前端 未结 3 826
时光取名叫无心
时光取名叫无心 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:21

    Addendum concerning the usage of the term rule ... "is it cool to use rule?":

    The ISO Prolog Standard defines rule on page 8:

    3.154 rule: A clause whose body is not the goal true. During execution, if the body is true for some substitution, then the head is also true for that substitution. A rule is represented in Prolog text by a term whose principal functor is (:-)/2 where the first argument is converted to the head, and the second argument is converted to the body.

    So "rule" is cool.

    It is true the "rule" invokes mainly a piece of declarative knowledge known as the production rule used in forward-chaining (possibly backward-chaining) expert systems like CLIPS, Jess or Drools, where they can have a

    • bottom-up logical/deduction interpretation or
    • a non-logical state space trajectory interpretation

    ...possibly with "search". There are also the "Constraint Handling Rules", which are very much forward-chaining rules that can be compiled into Prolog programs and smoothly integrate with Prolog.

    P.S.

    For an appeal to authority, below is a citation from a blogpost by Robert Kowalski at RuleML.org, written in 2014:

    The Sad State Concerning the Relationships between Logic, Rules and Logic Programming

    He seems to use:

    • production rule for a forward chaining rule,
    • reactive rule for an action-inducing rule (which can be given a logical interpretation in an Abductive Logic Programming framework) and
    • logic programming clause for, well, the logic programming clause.

    Confusions about the relationships between logic, rules and logic programming are endemic in the world of computing.

    ...

    I am particularly sensitive to the claim about the difference between deduction and search, because two of my earliest papers (1, 2) investigated the relationship between deduction and search. In my 2011 book (3), I discuss Thagard’s (4) various claims about logic and rules, and I argue that there are three varieties of production rules:

    1. Rules like IF you pass forty Arts courses, THEN you graduate with a B.A. These are logic programming clauses, used to reason forwards from conditions to conclusions.
    2. Rules like IF you want to go home for the weekend, and you have the bus fare, THEN you can catch a bus. These are “forward chaining” rules, used to simulate backward reasoning with logic programming clauses, such as, you go home for the weekend, if you have the bus fare, and you catch a bus.
    3. Rules like IF you are hungry THEN eat something. These are reactive rules, used to make the conclusion of the rule true whenever the condition of the rule becomes true.

    In the book, I argue that reactive rules have a more general syntax than logic programming clauses, and they are also more fundamental.

    1. Kowalski, R. (1970), "Search Strategies for Theorem-proving" PDF.
    2. Kowalski, R. (1972), "And-or Graphs, Theorem-proving Graphs and Bi-directional Search" PDF.
    3. Kowalski, R. (2011) Computational Logic and Human Thinking: How to be Artificially Intelligent, Cambridge University Press. PDF of draft. Worldcat.
    4. Thagard, P. (2005) Mind: Introduction to cognitive science. MIT press.

提交回复
热议问题