Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

1. Which procedure is used as key element in a backward chaining algorithm?
a) Matching
b) Unification matching
c) Verification
d) None of the mentioned

Answer: b [Reason:] The unification matching procedure is a key element in a backward chaining.

2. What is the way of expressing an ordinary expression in terms of bits?
a) Datum
b) Data
c) Manipulation
d) Verification

Answer: a [Reason:] The process of expressing an ordinary expression in terms of bits is called datum.

3. What is the name of elements present in patterns?
a) Variables
b) Patterns
c) Pattern variables
d) Pattern elements

Answer: c [Reason:] Patterns can contain elements called pattern variables.

4. Which keeps variable binding on an association list?
a) Match
b) Compare
c) Equal
d) None of the mentioned

Answer: a [Reason:] Match keeps variables bindings on an association list.

5. Which is used to compare patterns and datums element by element?
a) Procedure
b) Compare
c) Equal
d) Matching

Answer: d [Reason:] None.

6. What is the output of the given statement?

```span class="sy0"> * (setf pattern-variable-expression '(? x))
* (setf datum 'apple)
* (setf bindings '((y red)))
* (second pattern-variable-expression)```

a) X
b) Red
c) Apple
d) None of the mentioned

Answer: a [Reason:] The result will be x because the second element is referred in pattern. Output: X

7. What is the output of the given statement?

```span class="sy0"> * (setf pattern-variable-expression '(? x))
* (setf datum 'apple)
* (setf bindings '((y red)))
* (list (second pattern-variable-expression) datum)```

a) x
b) Y
c) Apple
d) Both x & Apple

Answer: d [Reason:] The elements from the given list is listed using the given statement. Output: (X APPLE)

8. What is the output of the given statement?

`span class="sy0"> * (cons (list (second pattern-variable-expression) datum) bindings)`

a) (X apple)
b) (Y orange)
c) (X apple) (Y orange)
d) None of the mentioned

Answer: c [Reason:] This statement will list all the elements in datum and bindings. Output: ((X APPLE) (Y RED))

9. What is the output of the given statement?

```span class="sy0"> * (defun add-binding (pattern-variable-expression datum bindings)
(if (eq '_ (extract-variable pattern-variable-expression)) bindings (cons
(make-binding (extract-variable pattern-variable-expression) datum) bindings)))
* (add-binding '(? _) 'apple '((y red)))```

a) X
b) Y
c) (X apple)
d) (Y red)

Answer: d [Reason:] This statement is used for adding a binding in the pattern. Output: ((Y RED))

10. What is the output of the given statement?

```span class="sy0"> * (defun find-binding (pattern-variable-expression binding)
(unless (eq '_(extract-variable pattern-variable-expression))
(assoc (extract-variable pattern-variable-expression) binding)))
* (find-binding '(? _) '((x apple) (y red)))```

a) X
b) Apple
c) T
d) Nil