MCQ Bank
Which of the following is not required to write a program in PROLOG?
- A) Fact
- B) Logical Relationship
- C) Algorithm
- D) Rule
The head and tail of a list in PROLOG is separated by:
- A) Semicolon (;)
- B) Colon (:)
- C) Comma (,)
- D) Vertical bar (|)
The unchanging information about objects and their relationships in PROLOG is known as:
- A) Fact
- B) Clause
- C) Atom
- D) Query
In the context of PROLOG language, which problem(s) may mostly occur in backward chaining algorithm?
- A) Complexity
- B) Readiness
- C) Completeness
- D) Repetition
In the process of removing consecutive duplicates of list elements in PROLOG, the order of elements should:
- A) be Reversed
- B) be in alphabetical order
- C) not be changed
- D) be in reverse alphabetical order
________ in PROLOG are loosely typed.
- A) Variables
- B) Records
- C) Constants
- D) Atoms
How many elements are in the following PROLOG list? [[a,list,of,lists], and, numbers,[1,2,3]]
- A) 2
- B) 4
- C) 9
- D) 6
The function that is used to remove all properties of a symbol in LISP is:
- A) terminate-all
- B) remprop
- C) REMOVE
- D) NULLP
What is the objective of following statement in LISP?
>(setf (get 'w 'age) 20)
- A) It sets the age property of symbol w as 20
- B) It assigns value 20 to setf and gets the values of variables w and age
- C) It simply sets the value of ‘get’, ‘w’ and ‘age’ as 20
- D) It gets the age of symbol w and assigns it to setf after 20 milliseconds
Which of the following programming language is very effective in solving complex puzzles?
- A) C/C++
- B) PROLOG
- C) FORTRAN
- D) ALGOL
The property list in LISP is a substitute of _____________.
- A) C/C++ structure
- B) Compiler
- C) C/C++ pointer
- D) Java interfaces
To create a two-dimensional array in LISP, ________ index values are used.
- A) Six
- B) Two
- C) Three
- D) Four
Prolog database is based upon __________.
- A) Facts and queries
- B) Facts and rules
- C) Facts
- D) Rules and queries
Which of the following is a correct variable name in PROLOG?
- A) marks
- B) percentage
- C) roll_No.
- D) Age
If the following statement eliminates duplicate elements of a list in PROLOG, then after elimination, what will be the final state of list? ?- compress([z,z,z,z,y,x,x,z,z,w,w,w,n,n], X)
- A) X = [y,z,n,x,w]
- B) X = [z,y,x,z,w,n]
- C) X = [z,w,y,x,n]
- D) X = [n,w,z,x,z]
Following statement in PROLOG is considered as ______________________. "should_take(nadia, Drug)"
- A) Fact
- B) Variable
- C) Rule
- D) Goal
Which of the following are the types of constants in PROLOG?
- A) atoms and numbers
- B) float and numbers
- C) single and decimal
- D) short and char
Which of the following is treated as an atom and not as a list data type in PROLOG?
- A) [a]
- B) [ ]
- C) [a, b, c]
- D) [a, t, o, m]
A query given to a PROLOG system:
- A) cannot contain variables
- B) does not involve database
- C) is a pattern matching exercise
- D) is treated an object
How many times the value of a PROLOG variable can be changed after first assignment?
- A) Twice
- B) Many times
- C) Zero (Can not be changed)
- D) Once