Кіріспе
Формалды логикаға негізделген бағдарламалау парадигмасы
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
Логикалық бағдарламалау – формалды логикаға негізделген бағдарламалау, деректер базасы және білімді ұсыну парадигмасы. Логикалық бағдарлама – белгілі бір проблемалық домен туралы білімді көрсететін логикалық формадағы сөйлемдер жиынтығы. Есептеулер осы білімге логикалық қорытынды шығару арқылы, домендегі проблемаларды шешу үшін жүзеге асырылады. Басты логикалық бағдарламалау тілдерінің отбасыларына Prolog, Answer Set Programming (ASP) және Datalog жатады. Бұл тілдердің барлығында ережелер клауза түрінде жазылады:
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
A : B1, …, Bn. және логикалық формада декларативтік сөйлемдер ретінде оқылады:
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
A if B1 and … and Bn. A ереженің басы, B1, …, Bn – денесі, ал Bi – литералдар немесе шарттар деп аталады. n = 0 болғанда ереже факті деп аталады және қарапайымдалған формада жазылады:
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
A.
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
Сұраулар (немесе мақсаттар) ережелердің денелерімен бірдей синтаксиске ие және әдетте мынадай формада жазылады:
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
? B1, …, Bn. Хорн клаузаларының (немесе «анықталған» клаузалардың) ең қарапайым жағдайында, A, B1, …, Bn-нің барлығы p(t1, …, tm) формасындағы атомдық формулалар болады, мұнда p – «аналық» сияқты қатынасты атаудың предикат символы, ал ti – нысандарды (немесе жеке тұлғаларды) атаушы термдер. Термдер «чарльз» сияқты тұрақтылар мен X сияқты айнымалыларды қамтиды, олар үлкен әріппен басталады. Мысалы, келесі Хорн клаузалық бағдарламаны қарастырайық:
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
mother(child(elizabeth, charles)).
father(child(charles, william)).
father(child(charles, harry)).
parent(child(X, Y)) : mother(child(X, Y)).
parent(child(X, Y)) : father(child(X, Y)).
grandparent(child(X, Y)) : parent(child(X, Z)), parent(child(Z, Y)).
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
Сұрау берілген жағдайда, бағдарлама жауаптарды шығарады. Мысалы, ? parent(child(X, william)) сұрауына жалғыз жауап:
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
X = charles.
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
Түрлі сұраулар қойылуы мүмкін. Мысалы, бағдарламадан ата-аналарды және немерелерді табуға сұрау жасауға болады. Ол тіпті немерелер мен ата-аналардың барлық жұптарын құруға немесе берілген жұптың осындай жұп екенін тексеруге қолданылуы мүмкін:
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
? grandparent(child(X, william)). X = elizabeth.
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
? grandparent(child(elizabeth, Y)). Y = william; Y = harry.
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
? grandparent(child(X, Y)). X = elizabeth, Y = william; X = elizabeth, Y = harry.
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
? grandparent(child(william, harry)). no.
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
? grandparent(child(elizabeth, harry)). yes.
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
Хорн клаузалық логикалық бағдарламалар Тьюринг толық болғанымен, көптеген практикалық қолданыстар үшін Хорн клаузалық бағдарламаларды теріс шарттары бар «қалыпты» логикалық бағдарламаларға кеңейту қажет. Мысалы, бауырластың анықтамасы теріс шартты қолданады, мұнда предикат = X = X клаузасымен анықталады:
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
sibling(X, Y) : parent(child(Z, X)), parent(child(Z, Y)), not(X = Y).
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
Теріс шарттарды қамтитын логикалық бағдарламалау тілдерінің монотонды емес логиканың білімді ұсыну мүмкіндіктері бар. ASP және Datalog-та логикалық бағдарламалардың тек декларативтік оқылымы болады, ал олардың орындалуы дәлелдеу процедурасы немесе модель генераторы арқылы жүзеге асырылады, оның мінез-құлқы бағдарламашымен бақыланбайды. Алайда, Prolog тілдер отбасында логикалық бағдарламалардың процессуалдық түсіндірмесі де бар, яғни мақсатты азайту процедуралары. Осы тұрғыдан алғанда, A : B1, …, Bn клаузасы:
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
A-ны шешу үшін, B1-ді және …, Bn-ді шеш деп түсініледі.
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
Клаузалардың денелеріндегі теріс шарттардың да процессуалдық түсіндірмесі бар, ол сәтсіздік ретінде теріске шығару деп аталады: B емес теріс литералы тек және тек қана оң литерал B сәтсіз болған жағдайда ғана дұрыс деп есептеледі. Логикалық бағдарламалау саласындағы зерттеулердің көп бөлігі сәтсіздік ретінде теріске шығару үшін логикалық семантиканы әзірлеуге және басқа семантиканы және теріске шығарудың басқа іске асырылуын әзірлеуге бағытталған. Бұл жетістіктер, өз кезегінде, логикаға негізделген бағдарламаны тексеру және бағдарламаны түрлендірудің ресми әдістерін әзірлеуді қолдау үшін маңызды болды.
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
A : B1, , Bn. and are read as declarative sentences in logical form:
A if B1 and and Bn. A is called the head of the rule, B1, , Bn is called the body, and the Bi are called literals or conditions. When n = 0, the rule is called a fact and is written in the simplified form:
A.
Queries (or goals) have the same syntax as the bodies of rules and are commonly written in the form:
? B1, , Bn. In the simplest case of Horn clauses (or "definite" clauses), all of the A, B1, , Bn are atomic formulae of the form p(t1 , , tm), where p is a predicate symbol naming a relation, like "motherhood", and the ti are terms naming objects (or individuals). Terms include both constant symbols, like "charles", and variables, such as X, which start with an upper case letter. Consider, for example, the following Horn clause program:
mother child(elizabeth, charles). father child(charles, william). father child(charles, harry). parent child(X, Y) :
mother child(X, Y). parent child(X, Y) :
father child(X, Y). grandparent child(X, Y) :
parent child(X, Z),
parent child(Z, Y). Given a query, the program produces answers. For instance for a query ? parent child(X, william), the single answer is
X = charles
Various queries can be asked. For instance
the program can be queried both to generate grandparents and to generate grandchildren. It can even be used to generate all pairs of grandchildren and grandparents, or simply to check if a given pair is such a pair:
grandparent child(X, william). X = elizabeth
? grandparent child(elizabeth, Y). Y = william;
Y = harry. ? grandparent child(X, Y). X = elizabeth
Y = william;
X = elizabeth
Y = harry. ? grandparent child(william, harry). no
? grandparent child(elizabeth, harry). yes
Although Horn clause logic programs are Turing complete, for most practical applications, Horn clause programs need to be extended to "normal" logic programs with negative conditions. For example, the definition of sibling uses a negative condition, where the predicate = is defined by the clause X = X:
sibling(X, Y) :
parent child(Z, X),
parent child(Z, Y),
not(X = Y). Logic programming languages that include negative conditions have the knowledge representation capabilities of a non monotonic logic. In ASP and Datalog, logic programs have only a declarative reading, and their execution is performed by means of a proof procedure or model generator whose behaviour is not meant to be controlled by the programmer. However, in the Prolog family of languages, logic programs also have a procedural interpretation as goal reduction procedures. From this point of view, clause A : B1, ,Bn is understood as:
to solve A, solve B1, and and solve Bn. Negative conditions in the bodies of clauses also have a procedural interpretation, known as negation as failure: A negative literal not B is deemed to hold if and only if the positive literal B fails to hold. Much of the research in the field of logic programming has been concerned with trying to develop a logical semantics for negation as failure and with developing other semantics and other implementations for negation. These developments have been important, in turn, for supporting the development of formal methods for logic based program verification and program transformation.
Тарих
Математикалық логиканы компьютерлік бағдарламаларды бейнелеу және орындау үшін пайдалану 1930-шы жылдары Алонзо Черч дамытқан ламбдалық есептеудің де ерекшелігі болып табылады. Дегенмен, компьютерлік бағдарламаларды бейнелеу үшін логиканың клаузалық түрін қолдану туралы алғашқы ұсынысты Корделл Грин жасады. Ол LISP-тің кіші жиынтығының аксиоматизациясын, енгізу-шығыс қатынасын бейнелеумен бірге пайдаланды, LISP-те бағдарламаның орындалуын симуляциялау арқылы қатынасты есептеді. Фостер мен Элкоктың Absys, керісінше, операциялардың орындалу ретіне ешқандай шектеу қоймайтын, ассерциялық бағдарламалау тілінде теңдеулер мен ламбдалық есептеулердің комбинациясын қолданды. Логикалық бағдарламалау, қазіргі фактілер мен ережелердің синтаксисімен, 1960-шы жылдардың соңы мен 1970-шы жылдардың басында жасанды интеллекттегі білімнің декларативтік және процедуралық бейнелеуі туралы пікірталастарға қатысты. Декларативтік бейнелеуді жақтағандар Стэнфордта Джон Маккарти, Бертрам Рафаэль және Корделл Гринмен, ал Эдинбургте Джон Алан Робинсонмен (Сиракуза университетінің академиялық қонағы), Пэт Хейс және Роберт Ковальскимен жұмыс істеді. Процедуралық бейнелеуді қолдаушылар негізінен MIT-де Марвин Мински мен Сеймур Паперттің басшылығымен болды. Логиканың дәлелдеу әдістеріне негізделгенімен, Карл Хьюитт MIT-де дамытқан Планер осы процедуралық парадигма аясында пайда болған алғашқы тіл болды. Планер мақсаттардан (яғни мақсатты азайту немесе кері тізбектеу) және ассерциялардан (яғни алға тізбектеу) процедуралық жоспарларды үлгілік түрде шақыруды ұсынды. Планердің ең ықпалды іске асырылуы Джерри Суссман, Юджин Чарняк және Терри Виноград іске асырған Планердің микропланер деп аталатын кіші жиынтығы болды. Виноград SHRDLU табиғи тілді түсіну бағдарламасын іске асыру үшін Микропланерді пайдаланды. Тиімділік үшін Планер бір уақытта тек бір ғана ықтимал есептеу жолын сақтау үшін кері бақылау құрылымын қолданды. Планер QA4, Popler, Conniver, QLISP және бір мезгілде қолданылатын Ether бағдарламалау тілдерін тудырды. Эдинбургтегі Хейс пен Ковальски білімді бейнелеуге логикаға негізделген декларативтік тәсілді Планердің процедуралық тәсілімен үйлестіруге тырысты. Хейз (1973) теореманы дәлелдеушінің мінез-құлқын өзгерту арқылы әр түрлі процедураларды алуға болатын Golux теңдеу тілін жасады. Осы уақытта Ален Колмерауэр Марсельде табиғи тілді түсінуді, семантиканы бейнелеу үшін логиканы және сұрақ-жауап үшін шешімді қолдануды зерттеді. 1971 жылдың жазында Колмерауэр Ковальскиді Марсельге шақырды, олар логиканың клаузалық түрін ресми грамматиканы бейнелеу үшін және шешім теоремаларын дәлелдеушілерді талдау үшін пайдалануға болатынын анықтады. Олар кейбір теорема дәлелдеушілердің, мысалы гиперрезолюция, төменнен жоғары қарай талдаушы ретінде, ал SL resolution (1971) сияқты басқалары жоғарыдан төмен қарай талдаушы ретінде әрекет ететінін байқады. 1972 жылдың келесі жазында Ковальски, тағы да Колмерауэрмен жұмыс істеп, клаузалық түріндегі импликациялардың процедуралық интерпретациясын жасады. Сондай-ақ, мұндай клаузалар нақты клаузаларға немесе Хорн клаузаларына ғана шектелуі мүмкін екендігі және SL шешімі SLD шешіміне ғана (және жалпыланған) шектелуі мүмкін екендігі анық болды. Ковальскидің процедуралық интерпретациясы мен SLD 1974 жылы жарияланған 1973 жылғы меморандумда сипатталған. Колмерауэр Филипп Руссельмен бірге 1972 жылдың жазы мен күзінде іске асырылған Prolog негізін процедуралық интерпретация ретінде пайдаланды. Бірінші Prolog бағдарламасы, сондай-ақ 1972 жылы жазылған және Марсельде іске асырылған, француз сұрақ-жауап жүйесі болды. Prolog-ты практикалық бағдарламалау тілі ретінде қолдану 1977 жылы Эдинбургте Дэвид Х. Д. Уорреннің компиляторын жасауынан үлкен серпін алды. Тәжірибелер Эдинбург Prolog-тың Lisp сияқты басқа символикалық бағдарламалау тілдерінің өңдеу жылдамдығымен бәсекелесе алатынын көрсетті. Эдинбург Prolog де-факто стандартқа айналды және ISO Prolog стандартының анықтамасына күшті әсер етті. Логикалық бағдарламалау 1980-ші жылдары Жапонияның Халықаралық сауда және өнеркәсіп министрлігі бесінші буын компьютерлік жүйелер (FGCS) жобасы үшін бағдарламалық жасақтаманы әзірлеу үшін таңдаған кезде халықаралық назарға ие болды. FGCS жобасы логикалық бағдарламалауды пайдалану арқылы жаппай параллельді компьютерлерде жасанды интеллекттің озық қосымшаларын әзірлеуді көздеді. Жоба бастапқыда Prolog-ты пайдалануды зерттегенмен, кейіннен FGCS компьютерлік архитектурасына жақынырақ болғандықтан, бір мезгілде қолданылатын логикалық бағдарламалауды қабылдады. Дегенмен, бір мезгілде қолданылатын логикалық бағдарламалаудың міндетті таңдау мүмкіндігі тілдің логикалық семантикасына және білімді бейнелеу және мәселелерді шешуге қабілетіне кедергі келтірді. Сонымен қатар, жобада әзірленген параллельді компьютерлік жүйелер көбірек дәстүрлі, жалпы мақсаттағы компьютерлердің дамуымен бәсекелесе алмады. Бұл екі мәселе FGCS жобасының мақсаттарына жетуіне кедергі келтірді. Логикалық бағдарламалау мен жасанды интеллектке қызығушылық әлемдік деңгейде төмендеді. Осы уақытта Prolog негізіндегілерді қоса алғанда, көбірек декларативтік логикалық бағдарламалау тәсілдері FGCS жобасынан тәуелсіз түрде прогреске жете берді. Атап айтқанда, Prolog білімнің декларативтік және процедуралық бейнелеуін біріктіру үшін әзіртелгенімен, логикалық бағдарламалардың таза декларативтік интерпретациясы дедуктивтік базалар саласындағы қосымшаларға басымдық берді. Бұл сала 1977 жыл шамасында, Эрве Галлайр мен Джек Минкер Тулузада логика және базалар жөнінде семинар ұйымдастырған кезде маңызды болды. Бұл сала ақыры Datalog деп аталды. Логикалық бағдарламалардың логикалық, декларативтік оқылуына назар аудару 1980-ші жылдарда шектеулі логикалық бағдарламалау және 1990-шы жылдарда Жауапты жиынтық бағдарламалау дамуымен одан әрі күшейді. Prolog-тың соңғы қолданыстарында да жаңадан басымдық берілуде.
Логикалық бағдарламалауды ілгерілету үшін 1986 жылы Логикалық бағдарламалау қауымдастығы (ALP) құрылды. Оның 2000 жылға дейінгі ресми журналы Логикалық бағдарламалау журналы болды. Оның алғашқы бас редакторы Дж. Алан Робинсон болды. 2001 жылы журнал Логика және алгебралық бағдарламалау журналы деп аталды, ал ALP-ның ресми журналы Кембридж университетінің баспасынан шығатын Логикалық бағдарламалау теориясы және практикасы болды.
Тұжырымдамалар
Логикалық бағдарламалар семантиканың және мәселелерді шешу әдістерінің кең түрлерімен қатар, бағдарламалау, деректер базалары, білімді ұсыну және мәселелерді шешу салаларында кең қолданылады.
Бір мезгілдегі шектеу логикасын бағдарламалау
Бір мезгілдегі шектеулі логикалық бағдарламалау бір мезгілдегі логикалық бағдарламалау мен шектеулі логикалық бағдарламалауды біріктіреді, бір мезгілделікті басқару үшін шектеулерді пайдаланады. Клаузда сақшы болуы мүмкін, ол клаузаның қолданылуын шектейтін шектеулер жиынтығы. Егер бірнеше клаузаның сақшылары орындалса, бір мезгілдегі шектеулі логикалық бағдарламалау тек біреуін таңдап, соған қатысты шешім қабылдайды.
Жоғары дәрежелі логикалық бағдарламалау
Бірнеше зерттеушілер логикалық бағдарламалауды жоғары ретті логикадан алынған, предикат айнымалылары сияқты жоғары ретті бағдарламалау мүмкіндіктерімен толықтырды. Мұндай тілдердің қатарында Prolog кеңейтімдері HiLog және λProlog бар.
Сызықтық логикалық бағдарламалау
Логикалық бағдарламалауды сызықтық логикаға негіздеу, классикалық логикаға негізделгенге қарағанда әлдеқайда кең мүмкіндіктерге ие логикалық бағдарламалау тілдерін жасауға әкелді. Horn clause бағдарламалары күйдің өзгеруін тек предикаттардың аргументтерінің өзгеруі арқылы ғана бейнелей алады. Сызықтық логикалық бағдарламалауда, күйді өзгертуді қолдау үшін қоршаған сызықтық логиканы пайдалануға болады. Сызықтық логикаға негізделген логикалық бағдарламалау тілдерінің алғашқы үлгілеріне LO, Lolli, ACL және Forum жатады. Forum барлық сызықтық логиканы мақсатқа бағытталған тұрғыдан түсіндіреді.
Нысанға бағдарланған логикалық бағдарламалау
F логикасы нысандармен және фрейм синтаксисімен логикалық бағдарламалауды кеңейтеді. Logtalk Prolog бағдарламалау тілін нысандар, протоколдар және басқа да объектіге бағытталған бағдарламалау (ООP) ұғымдарын қолдау арқылы кеңейтеді. Ол Prolog стандарттарына сәйкес келетін көптеген жүйелерді артқы компилятор ретінде қолдайды.
Транзакциялық логиканы бағдарламалау
Транзакциялық логика жүйесі. Басқа прототиптер де бар.
Басқа дереккөздер
Джон Маккарти. "Жалпы білімге ие бағдарламалар". Ойлау процестерін механикаландыру симпозиумы. Ұлттық физикалық зертхана. Теддингтон, Англия. 1958 жыл. Эхуд Шапиро (редактор). Параллель Prolog. MIT Press. 1987 жыл. Джеймс Слэгл. "Дедуктивті сұрақ-жауап бағдарламасымен тәжірибелер". CACM. 1965 жылдың желтоқсаны. Габбай, Дов М.; Хоггер, Кристофер Джон; Робинсон, Дж. А., ред. (1993–1998). Жасанды интеллект және логикалық бағдарламалау логикасының нұсқаулығы. 1–5 томдар, Оксфорд университетінің баспасы.