Understanding Prolog: Facts, Rules, Queries

Understanding Prolog: Facts, Rules, Queries

12th Grade

15 Qs

quiz-placeholder

Similar activities

IT Quiz

IT Quiz

11th - 12th Grade

10 Qs

Lesson Plan 2.2

Lesson Plan 2.2

9th - 12th Grade

16 Qs

PRELIMINARY LEVEL QUIZ

PRELIMINARY LEVEL QUIZ

1st Grade - University

20 Qs

Programming Paradigm

Programming Paradigm

12th Grade

19 Qs

Strings, Lists & Tuples

Strings, Lists & Tuples

9th - 12th Grade

20 Qs

Python variables and Data types

Python variables and Data types

10th - 12th Grade

10 Qs

JavaScript Knowledge & Skills

JavaScript Knowledge & Skills

9th - 12th Grade

15 Qs

ICT in Advertising

ICT in Advertising

KG - University

10 Qs

Understanding Prolog: Facts, Rules, Queries

Understanding Prolog: Facts, Rules, Queries

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Matthew Wemyss

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a fact in Prolog?

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?