Welcome ProgSchedule villagers, our AI Team has been working in a couple of First-order logic challenges, which are a very approach to how would machines make their own deductions, applying inference rules, through a formal system. Let’s have a brainstorm to get in the context:
- Inference is the act of deriving logical conclusions from premises known or assumed to be true.
EX: a->b b->c Therefore, a->c
- First-order logic is the standard for the formalization of mathematics into axioms. A theory about some topic is usually first-order logic. It’s formal syntax includes:
- Logical connectives ^ “and”, v “or”, ~ “not”, → “imples”…
- Quantifier symbols ∀ “for all”, ∃ “there exists”
- Parentheses, brackets, variables, equality symbol…
With this in mind, let’s assume we are ready for the challenges:
#1 THE FAMILY TREE
Could you fill the tree above using the following clauses?
- Miguel and Alejandro call “dad”and “son” among them.
- Fernando has an older brother.
- Alejandro is the brother of Carmen.
- Alberto is the grandfather of Marcos.
- María only has 2 children, just as Carmen and Alberto.
- Tomás is the brother in law of Lucía
- Berta is the youger sister of her sister, but is older than her brother.
- Patricia is the niece of Carmen.
#2 THE EINSTEIN LOGIC PROBLEM
There are five houses in a row and in five different colors.
In each house lives a person from a different country.
Each person drinks a certain drink, plays a certain sport, and keeps a certain pet.
No two people drink the same drink, play the same sport, or keep the same pet.
- The Brit lives in a red house
- The Swede keeps dogs
- The Dane drinks tea
- The green house is on the left of the white house
- The green house owner drinks coffee
- The person who plays polo rears birds
- The owner of the yellow house plays hockey
- The man living in the house right in the center drinks milk
- The Norwegian lives in the first house
- The man who plays baseball lives next to the man who keeps cats
- The man who keeps horses lives next to the one who plays hockey
- The man who plays billiards drinks beer
- The German plays soccer
- The Norwegian lives next to the blue house
- The man who plays baseball has a neighbor who drinks water.
Question: Who owns the fish?
WARNING!!!
ANSWERS COME BELOW
#1 THE FAMILY TREE
#2 THE EINSTEIN LOGIC PROBLEM
R# | ||||
1 | ∀ ( i , j ) | nacionality(i)!=nacionality(j) | ||
2 | ∀ ( i , j ) | color(i)!=color(j) | ||
3 | ∀ ( i , j ) | pet(i)!=pet(j) | ||
4 | ∀ ( i , j ) | cigarrete(i)!=cigarrete(j) | ||
5 | ∀ ( i , j ) | drink(i)!=drink(j) | ||
6 | ∀ ( i , j ) | link(i,j) | -> | (j=i+1 ^ j<=5) V (j=i-1 ^ j>=1) |
7 | ∀ ( i ) | i == 1 | -> | nacionality(i)= Norwegian |
8 | ∀ ( i , j ) | i==1 ^ color(j)==blue | -> | link(i,j) |
9 | ∀ ( i ) | i == 3 | -> | drink(i)= milk |
10 | ∀ ( i ) | color(i) == red | -> | nacionality(i)= Brit |
11 | ∀ ( i ) | pet(i) == dog | -> | nacionality(i)= Swede |
12 | ∀ ( i ) | drink(i) == tea | -> | nacionality(i)= Dane |
13 | ∀ ( i , j ) | color(i)==white^ color(j)==green | -> | j = i+1 |
14 | ∀ ( i ) | drink(i) == brown | -> | color(i)= green |
15 | ∀ ( i ) | cigarrete(i) == pallmall | -> | pet(i)= birds |
16 | ∀ ( i ) | cigarrete(i) == dunhill | -> | color(i)= yellow |
17 | ∀ ( i , j ) | cigarrete(i)==blend ^ pet(j)==cats | -> | link(i,j) |
18 | ∀ ( i , j ) | cigarrete(i)==dunhill ^ pet(j)==horses | -> | link(i,j) |
19 | ∀ ( i ) | cigarrete(i) == bluemaster | -> | drink(i)= beer |
20 | ∀ ( i ) | cigarrete(i) == prince | -> | nacionality(i)= German |
21 | ∀ ( i , j ) | cigarrete(i)==blend ^ drink(j)==water | -> | link(i,j) |
Color | Nacionality | Pet | Cigarrete | Drink |
yellow | Norwegian | cats | Dunhill | water |
blue | Dane | horses | Blend | tea |
red | Brit | birds | Pallmall | milk |
green | German | Prince | coffe | |
white | Swede | dog | Blue Master | beer |
Answer: Not the Norwegian, nor the Dane, nor the Brit, not the Swede