What is a fact in Prolog?

Understanding Prolog: Facts, Rules, Queries

Quiz
•
Computers
•
12th Grade
•
Hard

Matthew Wemyss
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A statement that defines a condition that must be true.
A statement that is always true and represents basic assertions about the world.
A statement that defines a relationship between two or more facts.
A statement that asks a question about the facts and rules.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is an example of a Prolog fact?
`likes(john, pizza).`
`likes(X, Y) :- loves(X, Y).`
`?- likes(john, pizza).`
`if likes(john, pizza) then true.`
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a rule in Prolog?
A statement that is always true and represents basic assertions about the world.
A statement that defines a relationship between facts and can be used to infer new information.
A statement that asks a question about the facts and rules.
A statement that defines a condition that must be true.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is an example of a Prolog rule?
`likes(john, pizza).`
`likes(X, Y) :- loves(X, Y).`
`?- likes(john, pizza).`
`if likes(john, pizza) then true.`
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a query in Prolog?
A statement that is always true and represents basic assertions about the world.
A statement that defines a relationship between facts and can be used to infer new information.
A statement that asks a question about the facts and rules.
A statement that defines a condition that must be true.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is an example of a Prolog query?
`likes(john, pizza).`
`likes(X, Y) :- loves(X, Y).`
`?- likes(john, pizza).`
`if likes(john, pizza) then true.`
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Prolog, how would you express that "John likes anyone who loves pizza"?
`likes(john, X) :- loves(X, pizza).`
`loves(john, X) :- likes(X, pizza).`
`likes(X, john) :- loves(pizza, X).`
`loves(X, pizza) :- likes(john, X).`
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
Viral, Memes, & #hashtags

Quiz
•
8th - 12th Grade
10 questions
Unit 1 Post Test: Basic Python

Quiz
•
9th - 12th Grade
10 questions
JSPS Competition Hackathon - Scratch Language - Grade 1

Quiz
•
2nd Grade - University
20 questions
20.1 Programming Paradigms Cambridge iA 9618

Quiz
•
12th Grade
20 questions
Algoritma kelas 8

Quiz
•
12th Grade
16 questions
Lesson Plan 2.2

Quiz
•
9th - 12th Grade
20 questions
Python Basics (CodeHS)

Quiz
•
7th - 12th Grade
11 questions
python basics

Quiz
•
9th - 12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University