1 of 92
Term
Given the Scheme code as follows. What is the output?
(define not-gate (lambda(x) (if (= x 0) 1 0)))
(define onescomplement (lambda (a-list) (map not-gate a-list)))
(onescomplement '(0 1 0 2 0 3))
Give this one a try later!
, (1) 18
infix notation
(2) 22
(1 0 1 0 1 0) procedures are first class objects.
Don't know?
2 of 92
Term
A higher order function is a function that takes the
Give this one a try later!
operator of a function as an
type of a function as a data structure.
argument.
applies a predicate to all elements of
result of a function as its output.
a list.
Don't know?
3 of 92
Term
,We apply an anonymous variable in the definition of a rule if we
Give this one a try later!
are trying to create a loop that do not want to obtain a return
continuously updates the variable. value to the variable.
want to ensure that the variable is
need to store the result for future use.
always bound to a value.
Don't know?
4 of 92
Term
What is the best way of writing a Prolog rule that gives you all the
possible coin combinations adding to a dollar?
Give this one a try later!
Use membership rules and
Use nested repeat rules.
arithmetic conditions.
Do not want to obtain a return value May cause an infinite loop for certain
to the variable. goals.
, Don't know?
5 of 92
Definition
searching the built-in database consisting of facts and rules.
Give this one a try later!
Using a cut (!) in a rule can A Prolog variable represents a
A Prolog program finds a
Filter is a higher-order function that
solution by
Don't know?
6 of 92
Term
Consider C++'s typing system. C++ uses (Select all correct answers)
Give this one a try later!
Term
Given the Scheme code as follows. What is the output?
(define not-gate (lambda(x) (if (= x 0) 1 0)))
(define onescomplement (lambda (a-list) (map not-gate a-list)))
(onescomplement '(0 1 0 2 0 3))
Give this one a try later!
, (1) 18
infix notation
(2) 22
(1 0 1 0 1 0) procedures are first class objects.
Don't know?
2 of 92
Term
A higher order function is a function that takes the
Give this one a try later!
operator of a function as an
type of a function as a data structure.
argument.
applies a predicate to all elements of
result of a function as its output.
a list.
Don't know?
3 of 92
Term
,We apply an anonymous variable in the definition of a rule if we
Give this one a try later!
are trying to create a loop that do not want to obtain a return
continuously updates the variable. value to the variable.
want to ensure that the variable is
need to store the result for future use.
always bound to a value.
Don't know?
4 of 92
Term
What is the best way of writing a Prolog rule that gives you all the
possible coin combinations adding to a dollar?
Give this one a try later!
Use membership rules and
Use nested repeat rules.
arithmetic conditions.
Do not want to obtain a return value May cause an infinite loop for certain
to the variable. goals.
, Don't know?
5 of 92
Definition
searching the built-in database consisting of facts and rules.
Give this one a try later!
Using a cut (!) in a rule can A Prolog variable represents a
A Prolog program finds a
Filter is a higher-order function that
solution by
Don't know?
6 of 92
Term
Consider C++'s typing system. C++ uses (Select all correct answers)
Give this one a try later!