# LISP Questions & Answers – Constraint Propagation

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

Answer: b
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

Answer: d
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

Answer: c
Explanation: When a group of assertions and logical constraints are combined, they form inference net.
advertisement
advertisement

4. Which propagate probability bounds through logic boxes?
a) Constraint
b) Condition
c) List
d) Inference
View Answer

Answer: a
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

Answer: b
Explanation: Generic functions are used to enforce constraints.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

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

Answer: c
Explanation: This statement will output class named assertion with a constraint.
Output:
#<STANDARD-CLASS ASSERTION>
advertisement

7. What is the output of the given statement?

advertisement
```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

Answer: a
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

Answer: d
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

Answer: d
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

Answer: c
Explanation: None.

Sanfoundry Global Education & Learning Series – LISP Programming Language.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.