The Art of prolog:advanced programming techniques "translated"

Source: Internet
Author: User

Disclaimer: This text is translated, only for the study Exchange trial, do not use for commercial purposes, cause all consequences I am not responsible, reproduced please explain. My English skill is still shallow, the translation mostly relies on the translation tool, if has the mistake, welcome correction.

  Introduction to Logic Programs

A logic program is a set of axioms or rules that define the relationships between objects. The calculation of the logic program is deducted from the consequences of the plan. A program defines a set of consequences, which is what it means. The art of logical programming is to construct a scheme with the necessary meaning of simplicity and generosity.

  Prolog basic structure

  Logical programming, the basic structure of terms and declarations, inherits from logic. There are three basic statements: facts, rules, and queries. There is a single data structure: a logical term. The simplest kind of statement is the truth. The fact is that the device that describes the relationship between objects is established.

As an example,

Father (ABRAHAM,ISAAC). This fact says that Abraham is the father of Isaac, or that Father relations are established between Abraham and Isaac individuals. Another name for the relationship is called judgment. The name of an individual is called an atom.

Similarly, plus (2,3,5). The relationship of expression is 2 plus 3 is 5.

Familiarity with add-on relationships can be achieved through a set of facts that define the addition table. The initial segment of the table is

Plus (0,0,0). Plus (1,0,1).

Plus (0,1,1). Plus (1,1,2).

Plus (0,2,2). Plus (for all).

Plus (0,3,3). Plus (1,3,4).

The table is exactly a legitimate logic program and will be assumed to be the definition of the relationship in this chapter. The grammar conventions used throughout the book are described as needed. The first is such an agreement. This is an important name.

The Art of prolog:advanced programming techniques "translated"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.