Prolog CH4 Flashcards

1
Q

Prolog

A

short for “programming logic” associated with AI and computational linguistics
- its based on the concepts of predicate logic
- logical inference engine

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

The basic elements of Prolog

A
  1. Facts - fundamental assertions that represent truths about the world
  2. Rules - define logical relationships and allow for inference
  3. Queries - are questions posed to extract info based on the available facts and rules
  4. Variables - can represent any prolog term
  5. Lists - important data structures to store sequences of elements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Elements of prolog P2

A
  1. Arithmetic Operators - mathematical elements
  2. Predicates - building blocks of prolog programs
  3. Recursions - a powerful concept in prolog, where a rule can call different arguments
  4. Backtracking - tries different possibilities automatically
  5. Cut Operator - is used to control backtracking
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

parent(john, paul) John is Paul’s parent.
What example is this

A

Facts

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

% Sibling rule
sibling(x,y)
what example is this

A

Rules

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

dog(fido)
cat(whiskers)
bird(tweety)
examples of what?

A

Facts and Queries

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

parent(alice,bob) alice is bob’s parent
parent(bob,carol) bob is carol’s parent
examples of what?

A

Recursion
- can handle recursive relationships

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

member(bob, [alice,bob,carol])
examples of?

A

Lists and Operations

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