Podcast
Questions and Answers
Which of the following arithmetic functions is available in Prolog?
Which of the following arithmetic functions is available in Prolog?
- Square root (correct)
- Sorting
- String concatenation
- File input/output
In Prolog, what must be true for variables appearing in an arithmetic expression?
In Prolog, what must be true for variables appearing in an arithmetic expression?
- They must be constants
- They must already be bound with values (correct)
- They must be unbound
- They must be declared as strings
What is the result of the arithmetic expression in Prolog: $Y = 10, Z = Y + 1$?
What is the result of the arithmetic expression in Prolog: $Y = 10, Z = Y + 1$?
- Y=11, Z=11
- Y=10, Z=10
- Y=11, Z=10
- Y=10, Z=11 (correct)
Which of the following is an arithmetic operator in Prolog?
Which of the following is an arithmetic operator in Prolog?
What does Prolog use to specify the order of operations in arithmetic expressions?
What does Prolog use to specify the order of operations in arithmetic expressions?
Which of the following is a relational operator in Prolog?
Which of the following is a relational operator in Prolog?
What is the value of X when X = 10 mod 4?
What is the value of X when X = 10 mod 4?
What is the solution when X = 30, Y = 5, and Z = X + Y + X*Y?
What is the solution when X = 30, Y = 5, and Z = X + Y + X*Y?
What is the result of the arithmetic expression 6+4?
What is the result of the arithmetic expression 6+4?
What is the outcome of the append operation append([1,2,3,4],[5,6,7,8,9],L)?
What is the outcome of the append operation append([1,2,3,4],[5,6,7,8,9],L)?
What is the value of sqrt(36)?
What is the value of sqrt(36)?
What does the predicate 'prefix(P,L):append(P,_,L)' define?
What does the predicate 'prefix(P,L):append(P,_,L)' define?
What are the values of L1 and L2 in the operation append(L1,L2,[1,2,3])?
What are the values of L1 and L2 in the operation append(L1,L2,[1,2,3])?
What is the value of X when X = 1 + 2?
What is the value of X when X = 1 + 2?
What does the statement 'If the first two arguments L1,L2 are lists and the third argument is an variable, the third argument is bound to a list comprising the first two lists concatenated' describe?
What does the statement 'If the first two arguments L1,L2 are lists and the third argument is an variable, the third argument is bound to a list comprising the first two lists concatenated' describe?
Flashcards
Prolog Arithmetic Expression Variables
Prolog Arithmetic Expression Variables
Variables in arithmetic expressions must have pre-assigned values (be bound).
Prolog Arithmetic Operator Example
Prolog Arithmetic Operator Example
Division ("/") is an arithmetic operator in Prolog.
Prolog Arithmetic Expression Order
Prolog Arithmetic Expression Order
Prolog uses parentheses to determine the order of operations in arithmetic expressions.
Prolog Relational Operator Example
Prolog Relational Operator Example
Signup and view all the flashcards
Prolog Modulo Operator Example
Prolog Modulo Operator Example
Signup and view all the flashcards
Prolog Arithmetic Expression Result
Prolog Arithmetic Expression Result
Signup and view all the flashcards
Prolog Simple Arithmetic Example
Prolog Simple Arithmetic Example
Signup and view all the flashcards
Appending Lists in Prolog
Appending Lists in Prolog
Signup and view all the flashcards
Prolog Square Root Function
Prolog Square Root Function
Signup and view all the flashcards
Prolog Predicate prefix(P,L)
Prolog Predicate prefix(P,L)
Signup and view all the flashcards
Prolog Empty and Full Lists append
Prolog Empty and Full Lists append
Signup and view all the flashcards
Prolog Simple Addition Example
Prolog Simple Addition Example
Signup and view all the flashcards
Prolog List Appending
Prolog List Appending
Signup and view all the flashcards
Prolog List Appending Detail
Prolog List Appending Detail
Signup and view all the flashcards