Chapter 4 Programming Language Principles and Practice

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

A variable introduced by a quantifier is said to be free and not bound by the quantifier

False

Every logical statement can be turned into Horn clauses.

False

Horn clauses cannot be given a procedural interpretation.

False

In Prolog, you can specify the head and tail of a list using a backslash.

False

Logic programming uses second-order predicate calculus.

False

Prolog completely satisfies the original goal of logic programming.

False

Resolution is an especially inefficient inference rule for Horn clauses.

False

The ISO standard for Prolog standardized the responses from a Prolog interpreter.

False

The existential quantifier is used to represent all things in the universe that exist.

False

The kind of logic used in logic programming is lambda calculus.

False

A logic programming language is a notational system for writing logical statements together with specified algorithms for implementing inference rules.

True

An example of a Horn clause is a1 and a2 and a3 → b.

True

Automated deduction systems have difficulty handling all of first-order predicate calculus.

True

Horn clauses can be viewed as specifications of procedures rather than strictly as implementations.

True

In Prolog, arithmetic terms can be written in either infix notation or prefix notation.

True

Logical statements can be either true or false.

True

Logical statements can be used as formal specifications for the required behavior of programs.

True

Most Prolog systems are run as interpreters, not compilers.

True

Prolog applies resolution in a strictly linear fashion, replacing goals from left to right.

True

Prolog is the most widely used logic programming language.

True

Prolog is vulnerable to infinite loops because it uses a depth-first search.

True

Statements that can be derived from the logic program are known as queries or goals.

True

The process of unification can be used to shorten clauses

True

The statements a → b and b → c then a → c are an example of a typical inference rule.

True

Theorems are derived from axioms

True

____ is the process of pattern matching to make statements identical. a. Unification c. Instantiation b. Resolution d. Equalization

a. Unification

Prolog programs use a particular kind of grammar rules called ____. a. definite clause grammars c. axiom clause grammars b. procedural clause grammars d. reverse clause grammars

a. definite clause grammars

____ are statements that are assumed to be true and from which other true statements can be proved. a. Axioms c. Logical statements b. Predicates d. Universal statements

a. Axioms

A(n) ____ quantifier states that a predicate is true of at least one thing in the universe, indicated by the variable. a. existential c. global b. universal d. logical

a. existential

In Prolog, the cut operator is used to ____. a. stop a search of a tree c. remove a node from a tree b. move a node from one tree to another d. prune duplicates from a tree

a. stop a search of a tree

In the Horn clause a1 and a2 and a3 → b, the portion a1 and a2 and a3 is called the ____. a. head c. tail b. body d. query

b. body

Variables set equal to patterns are said to be ____. a. unified c. initialized b. instantiated d. resolved

b. instantiated

The semantics of programming language constructs is called ____. a. logic statements c. syntax b. axiomatic semantics d. specifications

b. axiomatic semantics

Logic programming systems are sometimes referred to as ____. a. logic queries c. derivative databases b. deductive databases d. successional databases

b. deductive databases

To force Prolog to perform loops and repetitive searches, we must force backtracking even when a solution is found by using the built-in predicate ____. a. is c. parent b. fail d. repeat

b. fail

A list is written in Prolog using ____ to enclose the items. a. curly braces c. single quotes b. square brackets d. double quotes

b. square brackets

The ____ quantifier represents all things in the universe named by the variable. a. existential c. global b. universal d. general

b. universal

Prolog uses ____. a. lowercase for variable names, and uppercase for constants and functions b. uppercase for variable names, and lowercase for constants and functions c. lowercase for variable names and constants, and uppercase for functions d. uppercase for variable names and constants, and lowercase for functions

b. uppercase for variable names, and lowercase for constants and functions

The set of logical statements that are taken to be axioms can be viewed as the ____. a. baseline c. theorem b. logic program d. control statement

c. theorem

____ takes the perspective that a program describes what the solution to a problem is, not how that problem is solved. a. Interpretive programming c. Declarative programming b. Resolution d. Unification

c. Declarative programming

Most logic programming systems restrict themselves to a particular subset of predicate calculus called ____. a. axiomatic clauses c. Horn clauses b. algorithms d. control clauses

c. Horn clauses

The specific path that an automatic deduction system chooses to derive a statement is the ____ for a logic programming system. a. axiom c. control problem b. theorem d. deductive database

c. control problem

The closed-world assumption is that all solutions ____ or are assumed false. a. must be finite c. must be proved true b. must be rational d. must be limited to a closed solution set

c. must be proved true

In predicate calculus, arguments to predicates and functions can only be terms — that is, combinations of ____. a. predicates and connectives b. constants and predicates c. variables, constants, and functions d. predicates, quantifiers, and connectives

c. variables, constants, and functions

____ Prolog was used as the basis for the Prolog ISO standard. a. Resolution c. Unification b. Horn d. Edinburgh

d. Edinburgh

Horn clauses of the form →b are sometimes referred to as ____. a. queries c. connectives b. axioms d. facts

d. facts

To force evaluation of an arithmetic term in Prolog, you must use the built-in predicate ____. a. force c. equals b. evaluate d. is

d. is

Nonmonotonic reasoning is that adding information to a system can ____. a. decrease the complexity b. alter the previous information c. change the order of execution d. reduce the number of things that can be proved

d. reduce the number of things that can be proved

Programs known as automatic deduction systems ____. a. solve logic questions c. make choices based on input data b. determine equality d. turn proofs into computation

d. turn proofs into computation


Kaugnay na mga set ng pag-aaral

Nutrition Mastery Quiz RNSG 1324

View Set

Macro Test 4- Chapters 15, 16, 17, 18

View Set

3. Interpretation of Literary Texts

View Set

Chapter 9: Language and Thought; Chapter 11: Motivation and Emotion

View Set

NC Accident and Health or Sickness Exam Prep (Group 4)

View Set