Concept of Programming Languages – Chapter 16 (Logic Programming Languages)

CHAPTER 16

Lecturer: Mr. Tri Djoko Wahjono, Ir, M.Sc.

REVIEW QUESTION:

 

2. What are the two parts of a compound term?

A compound term is composed of two parts: a functor, which is the function symbol that names the relation, and an ordered list of parameters, which

together represent an element of the relation. A compound term with a single

parameter is a 1-tuple; one with two parameters is a 2-tuple, and so forth.

7. What are the forms of Horn Clauses?

Horn clauses can be in only two forms: They have either a single atomic proposition on the left side or an empty left side.1

8. What is the basic concept of declarative semantics?

The basic concept of this semantics is that there is a simple way to determine the meaning of each statement, and it does not depend on how the statement might be used to solve a problem

10. What are the three forms of Prolog term?

Constant, variable or structure.

13. What is a conjunction?

Conjunctions contain multiple terms that are separated by logical AND operations.

PROBLEM SET:

1.”All predicate calculus propositions can be algorithmically converted to clausal form”. Is this statement true or false?

True.

2. Describe how a logic programming language is different from a general programming language.

Programming that uses a form of symbolic logic as a programming language, unlike other general programming language, is often called logic programming; languages based on symbolic logic are called logic programming languages, or declarative languages.

6. Explain in which the arithmetic processing capabilities of LISP and Prolog are similar.

Arithmetic processing is simple to implement in LISP and Prolog.

7. In what way are the arithmetic processing capabilities of LISP and Prolog different?

LISP uses prefix operator in arithmetic processing, unlike Prolog.

Leave a comment