MCQ Bank
Which of the following represents a valid Integer in CLIPS?
- A) (person john)
- B) -10
- C) "temperature"
- D) 3.14
Which CLIPS function is used to combine two or more strings?
- A) str-link
- B) str-com
- C) str-join
- D) str-cat
What does the exit command do in CLIPS?
- A) Initializes the system with facts.
- B) Shuts down the CLIPS environment.
- C) Adds a new fact to the working memory.
- D) Defines a template for structured facts.
The correct way to call the following function in CLIPS is ______________. (deffunction add (?num1 ?num2) (return (+ ?num1 ?num2)) )
- A) (call add 5 10)
- B) (execute add(5, 10))
- C) (add 5 10)
- D) (invoke add 5 10)
If you want to convert a list into a string in CLIPS, which function would you use?
- A) implode$
- B) exclude$
- C) explode$
- D) include$
What data type does the value 3.14 represent in CLIPS?
- A) String
- B) List
- C) Float
- D) Integer
Which of the following functions is used to return the first element of a list in CLIPS?
- A) length$
- B) rest$
- C) implode$
- D) first$
What does the str-index function in CLIPS do?
- A) Returns the length of a string
- B) Converts a string into a list
- C) Concatenates two or more strings
- D) Finds the position of a substring within a string
If you want to compare two String values for equality in CLIPS, which function would you use?
- A) eq
- B) equal
- C) equ
- D) equa
Which of the following is a valid List in CLIPS?
- A) 42
- B) (3 14 15)
- C) TRUE
- D) "apple"
Which function in CLIPS returns the absolute value of a number?
- A) index
- B) abs
- C) length
- D) sqrt
Which of the following CLIPS functions is used to find the square root of a number?
- A) mod
- B) sqrt
- C) abs
- D) length
What is the purpose of the length$ function in CLIPS?
- A) To concatenate two strings
- B) To get the number of elements in a list
- C) To convert a string to a list
- D) To find the length of a string
What does the run command do in CLIPS?
- A) Exits the CLIPS environment.
- B) Initializes the system with facts.
- C) Adds a new fact to the system's working memory.
- D) Starts executing a CLIPS program.
In CLIPS, which data type is used for a sequence of characters enclosed in double quotes?
- A) Symbol
- B) Boolean
- C) List
- D) String
What is the purpose of the reset command in CLIPS?
- A) Stops the current execution without exiting CLIPS.
- B) Defines a function in CLIPS.
- C) Shuts down the CLIPS environment.
- D) Initializes the system with facts.
What is the correct syntax for defining a user-defined function in CLIPS?
- A) (deffunction function-name (parameters) body)
- B) (define function-name (parameters) body)
- C) (deffunction function-name parameters body)
- D) (define function-name parameters body)
Which of the following is NOT a valid data type in CLIPS?
- A) Integer
- B) Void
- C) String
- D) Tuple
What does the mod function in CLIPS return?
- A) The square root of a number
- B) The result of division
- C) The absolute value of a number
- D) The remainder when dividing two numbers
In a CLIPS rule, what does the symbol "=>" represent?
- A) Separator between condition and action
- B) Logical AND
- C) Rule name
- D) Conflict resolution operator