NEW
Font size
WorksheetsFUNCTIONAL VS LOGIC
Total questions: 15
Worksheet time: 15mins
Functional paradigm is based on ____________
predicate lambda
predicate calculus
lambda calculus
list calculus
Logic programs are ____________ which means that only the specifications of the desired results are stated rather than detailed procedures for producing them.
non procedural
procedural
declarative
functional
The function (car (cdr (cdr (cdr ‘ ( Allah Melihat Anda Jangan! Meniru! ))))) in Scheme will return
Melihat
Anda
Meniru!
Jangan!
A compound term with two parameters is called as __________
2-tuple
bi-tuple
dwi-tuple
twin-tuple
What will be the output of the following Scheme expressions?
(- 100 + ((* 6 5) (* 8 3)))
-46
-154
46
154
Choose the right output for below statement
(sqr (car (cdr( cdr ‘(1 2 3 4)))))
3
6
9
12
Choose the FALSE statement about logic paradigm
Unification is a process of attempting to re-satisfy goals by finding alternative
A term can be constant, variable or structure
Variable is similar to constant except that it starts with uppercase letter
Instantiation is allowing temporary value being assigned to variable
Given the following Prolog statements. What is the value of printN(3)?
printN(N):- M is N + 3 * 2, write(M).
7
8
9
10
The meaning of the given proposition can be concisely determined from the statement itself is called _____________
appropriate predicate
declarative semantics
compound term
general statement
Give up the attempt to use this particular clause and try another clause instead is the process in the ___________
unification
backtracking
instantiation
matching
Which of the following statement is FALSE about functional programming?
Mathematic calculus is functional programming basic
Function is defined to solve mathematical problem
Functional programming relies on recursion to perform loops or iterative operations
Selection control structures are available in functional programming
A function that takes another function as an argument or computes another function as its result is a __________
recursive function
user-defined function
built-in function
higher-order function
Which of the following statement is FALSE about logic programming paradigm?
It uses the declarative semantic method
It consists of declarations rather than assignment and control flow statements
It is used when the application needs to match certain patterns with backtracking search
It is based on the lambda-calculus expression
In Prolog, a(n) _________________ is a string of letters, digits and underscores that begins with an uppercase letter
variable
atom
structure
list
Functional programming applies ____________
normal-order evaluation
eager evaluation
lazy evaluation
strict evaluation
