c laus b rabrand inference systems j an 27, 2009 i nference s ystems claus brabrand [email protected]...

22
CLAUS BRABRAND Inference Systems JAN 27, 2009 INFERENCE SYSTEMS Claus Brabrand [email protected] IT University of Copenhagen [ http://www.itu.dk/people/brabrand/ ]

Post on 20-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

CLAUS BRABRAND Inference Systems JAN 27, 2009

INFERENCE SYSTEMS

Claus [email protected]

IT University of Copenhagen

[ http://www.itu.dk/people/brabrand/ ]

[ 2 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Monty Python

"Monty Python and the Holy Grail" (1974) Scene V: "The Witch":

[ 3 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

The Monty Python Reasoning:

"Axioms" (aka. "Facts"):

"Rules":

female(girl) %- by observation -----

floats(duck) %- King Arthur -----

sameweight(girl,duck) %- by experiment -----

witch(X) female(X) burns(X)

burns(X) wooden(X)

wooden(X) floats(X)

floats(X) sameweight(X,Y) floats(Y)

[ 4 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Deduction vs. Induction

Deduction: whole parts:

(aka. “top-down reasoning”) abstract concrete general specific

Induction: parts whole:

(aka. “bottom-up reasoning”) concrete abstract specific general

Just two different ways of reasoning: Deduction Induction (just swap directions of arrows)

whole

A B C

whole

A B C

[ 5 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Deductive Reasoning: witch(girl)

"Deduction":

witch(girl)

burns(girl)female(girl)

wooden(girl)

floats(girl)

floats(duck)sameweight(girl,duck)

%- by observation -----

%- by experiment ----- %- King Arthur -----

floats(X) sameweight(X,Y) floats(Y)

witch(X) female(X) burns(X)

burns(X) wooden(X)

wooden(X) floats(X)

(aka. ”top-down reasoning”)

[ 6 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Inductive Reasoning: witch(girl)

"Induction":

witch(girl)

burns(girl)female(girl)

wooden(girl)

floats(girl)

floats(duck)sameweight(girl,duck)

%- by observation -----

%- by experiment ----- %- King Arthur -----

floats(X) sameweight(X,Y) floats(Y)

witch(X) female(X) burns(X)

burns(X) wooden(X)

wooden(X) floats(X)

(aka. ”bottom-up reasoning”)

[ 7 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Deduction vs. Induction

Deduction whole parts:

Induction parts whole:

Just two different ways of reasoning: Deduction Induction (just swap directions of arrows)

[ 8 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Hearing: Nomination of CIA Director, General Michael Hayden (USAF).

LEVIN:

"You in my office discussed, I think, a very interesting approach, which is the difference between starting with a conclusion and trying to prove it and instead starting with digging into all the facts and seeing where they take you.

Would you just describe for us that difference and why [...]?"

LEVIN: U.S. SENATOR CARL LEVIN (D-MI)HAYDEN: GENERAL MICHAEL B. HAYDEN (USAF), NOMINEE TO BE DIRECTOR OF CIA

CQ TranscriptionsThursday, May 18, 2006; 11:41 AM

"DEDUCTIVE vs. INDUCTIVE REASONING"

HAYDEN:

"Yes, sir. And I actually think I prefaced that with both of these are legitimate forms of reasoning,

that you've got deductive [...] in which you begin with, first, [general] principles and then you work your way down the specifics.

And then there's an inductive approach to the world in which you start out there with all the data and work yourself up to general principles.

They are both legitimate."

CLAUS BRABRAND Inference Systems JAN 27, 2009

INFERENCE SYSTEMS

Keywords:

relations, axioms, rules

[ 10 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Relations

Example1: “even” relation: Written as: as a short-hand for:

… and as: as a short-hand for:

Example2: “equals” relation: Written as: as a short-hand for:

… and as: as a short-hand for:

Example3: “road” relation: Written as: as a s-h for:

… and as: as a s-h for:

|_even N

|_even 4

|_even 5

4 |_even

5 |_even

2 3 (2,3) ‘=’

‘=’ N N

(2,2) ‘=’2 = 2

‘’ CITY N CITY

KBH Aarhus305(KBH, 305, Aarhus) ‘’

KBH NewYorkx(KBH, x, New York) ‘’

[ 11 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Inference System

Inference System: is used for specifying relations consists of axioms and rules

Example: Axiom:

“0 (zero) is even”!

Rule: “If n is even, then m is even (where m = n+2)”

|_even 0

|_even n

|_even m

m = n+2

|_even N

[ 12 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Terminology

Interpretation: Deductive:

“m is even, if n is even (where m = n+2)” Inductive:

“If n is even, then m is even (where m = n+2)”; or

|_even n

|_even m

m = n+2

premise(s)

conclusion

side-condition(s)

[ 13 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Abbreviation

Often, rules are abbreviated:

Rule: “m is even, if n is even (where m = n+2)”

Abbreviated rule: “n+2 is even, if n is even”

|_even n

|_even n+2

|_even n

|_even m

m = n+2Even so; this is what we mean

[ 14 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Relation Membership? xR

Axiom: “0 (zero) is even”!

Rule: “n+2 is even, if n is even”

Is 6 even?!?

The inference tree proves that:

|_even 0

|_even n

|_even n+2

|_even 0

|_even 2

|_even 4

|_even 6

[rule1]

[rule1]

[rule1][axiom1]

inference tree

6 |_even

?

|_even 6

written:

[ 15 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Example: “less-than-or-equal-to”

Relation:

Is ”1 2” ? (why/why not)!? [activation exercise]

Yes, because there exists an inference tree: In fact, it has two inference trees:

0 0 n mn m+1

[rule1][axiom1]

‘’ N N

n mn+1 m+1

[rule2]

0 00 11 2

[rule2]

[rule1][axiom1] 0 0

1 11 2

[rule1]

[rule2][axiom1]

[ 16 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Activation Exercise 1

Activation Exercise: 1. Specify the signature of the relation: '<<'

x << y "y is-double-that-of x"

2. Specify the relation via an inference system i.e. axioms and rules

3. Prove that indeed: 3 << 6 "6 is-double-that-of 3"

[ 17 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Activation Exercise 2

Activation Exercise: 1. Specify the signature of the relation: '//'

x // y "x is-half-that-of y"

2. Specify the relation via an inference system i.e. axioms and rules

3. Prove that indeed: 3 // 6 "3 is-half-that-of 6"

Syntactically different:‘<<‘ vs. ‘//’

Semantically the same relation:‘<<‘ = ‘//’ = {(1,2), (2,4), …}

[ 18 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Example: “add”

Relation:

Is ”2 + 2 = 4” ?!? Yes, because there exists an inf. tree for "+(2,2,4)":

+(0,m,m)[axiom1]

‘+’ N N N

+(n,m,r)+(n+1,m,r+1)

[rule1]

+(0,2,2)+(1,2,3)+(2,2,4)

[rule1]

[rule1][axiom1]

[ 19 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Example: “add” (cont’d)

Relation:

Note: Many different inf. sys.’s may exist for same relation:

+(0,m,m)[axiom1]

‘+’ N N N

+(n,m,r)+(n+1,m,r+1)

[rule1]

+(0,m,m)[axiom1] +(n,m,r)+(n+2,m,r+2)

[rule1]

+(1,m,m+1)[axiom2]

[ 20 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Relation vs. Function

A function...

...is a relation

...with the special requirement:

i.e., "the result", b, is uniquely determined from "the argument", a.

f : A B

Rf A B

aA, b1,b2B: Rf(a,b1) Rf(a,b2) => b1 = b2

[ 21 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Relation vs. Function (Example)

The (2-argument) function '+'...

...induces a (3-argument) relation

...that obeys:

i.e., "the result", r, is uniquely determined from "the arguments", n and m

+ : N N N

R+ N N N

n,mN, r1,r2N: R+(n,m,r1) R+(n,m,r2) => r1 = r2

[ 22 ]CLAUS BRABRAND JAN 27, 2009Inference Systems

Exercises

For each of the following relations…: a) Determine signature of the odd relation b) Define the relation formally using an inf.sys. c) Use the inference system to etablish that…

1) “Odd” (written “|-odd”): c) …5 is-odd; i.e., “|-odd 5”

2) “Double-or-more” (written “x >2> y”): c) …5 is-double-or-more-than 2; i.e., “5 >2> 2”

3) “Sum-from-zero” (wr. “i = y” or “x y”): c) …4 sum-from-zero-is 10; i.e., “4 10”

x

i=0