This set of LISP Multiple Choice Questions & Answers (MCQs) focuses on “Constraint Propagation”.
1. Which have the ability to propagate numbers through arithmetic boxes?
a) Condition
b) Constraint
c) Logic
d) None of the mentioned
View Answer
Explanation: Constraint propagate numbers through arithmetic boxes.
2. Which is used to represent assertions and logical constraints?
a) Logic
b) Methods
c) Controls
d) Class
View Answer
Explanation: Classes represent assertions and logical constraints.
3. What is the process of combining assertions and logical constraints?
a) List
b) Net
c) Inference net
d) Inference
View Answer
Explanation: When a group of assertions and logical constraints are combined, they form inference net.
4. Which propagate probability bounds through logic boxes?
a) Constraint
b) Condition
c) List
d) Inference
View Answer
Explanation: Constraints propagate probability bounds through logic boxes.
5. Which functions are used to enforce constraints?
a) Conditional
b) Generic functions
c) Functions
d) None of the mentioned
View Answer
Explanation: Generic functions are used to enforce constraints.
6. What is the output of the given statement?
span class="sy0"> * (defclass assertion () ((name :accessor assertion-name :initarg :name) (lower-bound :accessor assertion-lower-bound :initform 0) (upper-bound :accessor assertion-upper-bound :initform 1) (constraints :accessor assertion-constraints :initform nil)))
a) Constraints
b) Class
c) Standard-class assertion
d) Standard-class
View Answer
Explanation: This statement will output class named assertion with a constraint.
Output:
#<STANDARD-CLASS ASSERTION>
7. What is the output of the given statement?
span class="sy0"> * (defclass constraint () ((name :accessor constraint-name :initarg :name) (output :accessor constraint-output))) * (defclass binary-constraint (constraint) ((input :accessor constraint-input))) * (defclass ternary-constraint (constraint) ((input-a :accessor constraint-input-a) (input-b :accessor constraint-input-b))) * (defclass not-box (binary-constraint) ()) * (defclass or-box (ternary-constraint) ()) * (defclass and-box (ternary-constraint) ())
a) And-box
b) Or-box
c) Not-box
d) None of the mentioned
View Answer
Explanation: This statement will create a list of classes for constraint manipulation.
Output:
#<STANDARD-CLASS BINARY-CONSTRAINT>
#<STANDARD-CLASS TERNARY-CONSTRAINT> #<STANDARD-CLASS NOT-BOX>
#<STANDARD-CLASS OR-BOX> #<STANDARD-CLASS AND-BOX>
8. What is the output of the given statement?
span class="sy0"> * (defmethod connect2 ((c constraint) (i assertion) (o assertion)) (setf (constraint-input c) i) (setf (constraint-output c) o) (push c (assertion-constraints i)) (push c (assertion-constraints o)))
a) Connect2
b) Defmethod
c) Constraint
d) None of the mentioned
View Answer
Explanation: This statement will create a method named connect2 with input and output constraint.
Output:
#
9. What is the output of the given statement?
span class="sy0"> * (let ((assertions (list (make-instance 'assertion :name 'broker1) (make-instance 'assertion :name 'broker2) (make-instance 'assertion :name 'broker-opinion) (constraints (list (make-instance 'or-box :name 'broker-constraint))
a) Assertion
b) Broker
c) Both Assertion & Broker
d) Error
View Answer
Explanation: This statement will create an error because of misplacing and unsatisfied arguments.
10. Which constraint has the parameter that identifies where the constraint is coming from?
a) Binary
b) Secondary
c) Ternary
d) None of the mentioned
View Answer
Explanation: None.
Sanfoundry Global Education & Learning Series – LISP Programming Language.
To practice all areas of LISP, here is complete set of 250+ Multiple Choice Questions and Answers on LISP Programming Language.
If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]
- Check Computer Science Books
- Check LISP Books
- Apply for Computer Science Internship
- Practice Computer Science MCQs