Wk 5 : Prolog Flashcards

1
Q

Explain this statement :

“any fact produced by an application of modus ponens can be used as input to further rules.”

A

prolog can get truths about facts and rules that aren’t explicitly stated in the database. They are inferred from the data available. Rules have heads and bodies. If prolog can get the body proved true, it infers the head. this is called modus ponens. If it then encounters a second rule, it can use the truth implied by previous modus ponens to prove this current rule true or false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is a clause?

A

the facts and rules contained in the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What types of things exist in prolog?

A

facts, rules, queries. (facts are rules with empty bodies)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a predicate?

A

kind of like a procedure. it is a concept we find important.

the clauses that we write down concerning them are how we define what they mean and how they inter-relate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is a goal?

A

an item in the body of a rule.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

whats difference between expressing logical conjunction and logical disjunction?

A

logical conjunction (‘and’) happens with a comma between goals on the right side of a rule.

logical disjunction (‘or’) happens by having two rules with the same head….. also the ‘;’ is an option as well, but is tradeoff between prolog simplicity and readability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do we talk about prolog to putting a value in a variable?

A

we say that prolog instantiates it, or binds it. Such as in the case:

“X is binded to Mia”

variables can ‘stand for’ or be ‘unified with’ different things.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the most awesome part of prolog that lies at the heart of its effectiveness?

A

The business of unifying variables with information in the knowledge base is the heart of Prolog. ….it’s Prolog’s ability to perform unification and return the values of the variable bindings to us that is crucial.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly