Prolog Programming
,Introduction
4
Prolog
Prolog is a logic programming language. It
has important role in artificial intelligence.
Unlike many other programming languages,
Prolog is intended primarily as a declarative
Prolog
programming language. In prolog, logic is
expressed as relations (called as Facts and
Rules). Core heart of prolog lies at
the logic being applied. Formulation or
Computation is carried out by running a
query over these relations.
, Prolog Programming Basics 5
Prolog program is simply based on predicate
logic known as Horn clause. In prolog, we
compose the program using facts and rules and
we pose a query on query prompt about the
facts and rules we inserted.
Horn Clause : Horn clause consists of head (left hand
side) and body (right hand side). Head can have 0 or 1
predicate and body can have list of predicates. That
means LHS has only single literal and RHS can have
more than one literals.
head:- body.
,Introduction
4
Prolog
Prolog is a logic programming language. It
has important role in artificial intelligence.
Unlike many other programming languages,
Prolog is intended primarily as a declarative
Prolog
programming language. In prolog, logic is
expressed as relations (called as Facts and
Rules). Core heart of prolog lies at
the logic being applied. Formulation or
Computation is carried out by running a
query over these relations.
, Prolog Programming Basics 5
Prolog program is simply based on predicate
logic known as Horn clause. In prolog, we
compose the program using facts and rules and
we pose a query on query prompt about the
facts and rules we inserted.
Horn Clause : Horn clause consists of head (left hand
side) and body (right hand side). Head can have 0 or 1
predicate and body can have list of predicates. That
means LHS has only single literal and RHS can have
more than one literals.
head:- body.