28
The 30 Years War (1618–1648) Leibniz Logic in Practice ILP Logics of Action Wheeler Ruml (UNH) Lecture 14, CS 730 – 1 / 25 reduction in German population 15–30% in some terrirories 3/4 of the population died male population reduced by almost half population of Czech lands reduced by 1/3

Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

The 30 Years War (1618–1648)

Leibniz

Logic in Practice

ILP

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 1 / 25

■ reduction in German population 15–30%■ in some terrirories 3/4 of the population died■ male population reduced by almost half■ population of Czech lands reduced by 1/3

Page 2: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Gottfried Wilhelm Leibniz (1646-1716)

Leibniz

Logic in Practice

ILP

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 2 / 25

Leibniz’s dream:

”a general method in which all truths of thereason would be reduced to a kind of cal-culation. At the same time this would bea sort of universal language or script, but in-finitely different from all those projected hith-erto; for the symbols and even the words in itwould direct reason; and errors, except thoseof fact, would be mere mistakes in calcula-tion.”

If controversies were to arise, ”there would be no more need ofdisputation between two philosophers than between twoaccountants. For it would suffice to take their pencils in theirhands, and say to each other: Let us calculate.”Dissertio de Arte Combinatoria, 1666

Page 3: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

CS 730/830: Intro AI

Leibniz

Logic in Practice

ILP

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 3 / 25

Page 4: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Logic in Practice

Leibniz

Logic in Practice

■ Natural Deduction

■ Inference Rules

■ Horn Clauses

■ Semantic Nets

■ Description Logic

■ Example DL

■ Break

ILP

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 4 / 25

Page 5: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Natural Deduction

Leibniz

Logic in Practice

■ Natural Deduction

■ Inference Rules

■ Horn Clauses

■ Semantic Nets

■ Description Logic

■ Example DL

■ Break

ILP

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 5 / 25

1. given ∃, can introduce new constant2. given sentence with ground expresion, can introduce ∃3. given ∀, can introduce new constant4. given sentence, can introduce ∀ over new free variable

∧ elimination/introduction:∨ introduction:¬¬ elimination:

Page 6: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Inference Rules

Leibniz

Logic in Practice

■ Natural Deduction

■ Inference Rules

■ Horn Clauses

■ Semantic Nets

■ Description Logic

■ Example DL

■ Break

ILP

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 6 / 25

Modus Ponens:

Resolution:

Abduction:

Induction:

mathematical induction 6= inductive reasoning

Page 7: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Alfred Horn (1951)

Leibniz

Logic in Practice

■ Natural Deduction

■ Inference Rules

■ Horn Clauses

■ Semantic Nets

■ Description Logic

■ Example DL

■ Break

ILP

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 7 / 25

x ∧ y → z

Page 8: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Alfred Horn (1951)

Leibniz

Logic in Practice

■ Natural Deduction

■ Inference Rules

■ Horn Clauses

■ Semantic Nets

■ Description Logic

■ Example DL

■ Break

ILP

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 7 / 25

x ∧ y → z ≡ ¬x ∨ ¬y ∨ z

at most one positive literal (eaxctly one = ‘definite clause’)Cat(x) :- Furry(x), Meows(x).

Cat(y) :- Feline(y).

Furry(A).

Meows(A).

? Cat(z).

Still semi-decidable in first-order case.

Propositional: Unit resolution (Modus Ponens) is sound andcomplete in linear time for Horn theories: ‘forward chaining’.Each rule ‘fires’ at most once, each variable ‘processed’ at mostonce

‘expert systems’

Page 9: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Semantic Networks

Leibniz

Logic in Practice

■ Natural Deduction

■ Inference Rules

■ Horn Clauses

■ Semantic Nets

■ Description Logic

■ Example DL

■ Break

ILP

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 8 / 25

Mammals

JohnMary

Persons

MalePersons

FemalePersons

1

2

SubsetOf

SubsetOfSubsetOf

MemberOf MemberOf

SisterOf Legs

LegsHasMother

Page 10: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Semantic Networks

Leibniz

Logic in Practice

■ Natural Deduction

■ Inference Rules

■ Horn Clauses

■ Semantic Nets

■ Description Logic

■ Example DL

■ Break

ILP

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 9 / 25

Multiple aspects:

■ A visual notation■ A restricted logic■ A set of implementation tricks

Typically:

■ Efficient indexing■ Precomputation■ Methods for defaults or typicality

Aka: frames, inheritence networks, semantic graphs, descriptionlogics, terminological logics, ontologies

Page 11: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Description Logic

Leibniz

Logic in Practice

■ Natural Deduction

■ Inference Rules

■ Horn Clauses

■ Semantic Nets

■ Description Logic

■ Example DL

■ Break

ILP

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 10 / 25

computing categories and membershipincluding:

1. subsumption2. classification3. inheritance

missing:

1. negation2. disjunction3. nested functions4. existentials5. intractability

Page 12: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Example DL

Leibniz

Logic in Practice

■ Natural Deduction

■ Inference Rules

■ Horn Clauses

■ Semantic Nets

■ Description Logic

■ Example DL

■ Break

ILP

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 11 / 25

1. concepts (primitive and derived), instances2. roles (definitional) and properties (assertional)3. subsumption: subsumes (x, y) iff

(a) x is a concept, and(b) same primitive concept ancestor, and(c) for each role of x with restriction rx

i. y has same role with restriction ry, andii. rx subsumes ry

Page 13: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Break

Leibniz

Logic in Practice

■ Natural Deduction

■ Inference Rules

■ Horn Clauses

■ Semantic Nets

■ Description Logic

■ Example DL

■ Break

ILP

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 12 / 25

■ assts 6, 7■ asst 8■ preliminary proposals due next class

Page 14: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Inductive Logic Programming

Leibniz

Logic in Practice

ILP

■ Learning

■ ILP

■ Input

■ FOIL

■ Example

■ Specializing

■ ILP Applications

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 13 / 25

Page 15: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Learning

Leibniz

Logic in Practice

ILP

■ Learning

■ ILP

■ Input

■ FOIL

■ Example

■ Specializing

■ ILP Applications

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 14 / 25

Three types:

Supervised: classification (= prediction of class)Unsupervised: compression (= prediction of actual value)Reinforcement: sequence of decisions with occasional reward

Each can be on-line (incremental) or off-line (batch).

Terminology:

1. Hypothesis space2. Training data (vs test data, for off-line case)3. Performance metric (often on validation data)

Page 16: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Inductive Logic Programming

Leibniz

Logic in Practice

ILP

■ Learning

■ ILP

■ Input

■ FOIL

■ Example

■ Specializing

■ ILP Applications

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 15 / 25

Given: ground facts and background definitionsFind: short (almost Horn) clauses that cover positive examplesand not negative ones

Background ∧ Hypothesis ∧Descriptions |= Classifications

Page 17: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Input

Leibniz

Logic in Practice

ILP

■ Learning

■ ILP

■ Input

■ FOIL

■ Example

■ Specializing

■ ILP Applications

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 16 / 25

Descriptions:Father(Philip, Charles) Father(Philip, Anne)Mother(Mum, Margaret) Mother(Mum, Elizabeth)Married(Diana, Charles) Married(Elizabeth, Philip)Male(Philip) Male(Charles)Female(Beatrice) Female(Margaret)

Classifications:Grandparent(Mum, Charles) Grandparent(Elizabeth, Beatrice)¬Grandparent(Mum,Harry) ¬Grandparent(Spencer,Peter)

Background: Parent(x,y) ↔ Mother(x,y) ∨ Father(x,y)

Target: Grandparent(x,y) ↔ ∃ z Parent(x,z) ∧ Parent(z,y)

Page 18: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

FOIL

Leibniz

Logic in Practice

ILP

■ Learning

■ ILP

■ Input

■ FOIL

■ Example

■ Specializing

■ ILP Applications

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 17 / 25

Given: ground facts and background definitionsFind: short (almost Horn) clauses that cover positive examplesand not negative ones

Sequential covering (‘FOIL’)rules ← { }Until no remaining positives (or good enough):

new ← empty ruleWhile false positives (eg, covers any negatives):

Add best single literal preconditionAdd new to rulesRemove positive examples covered by new

Page 19: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Example

Leibniz

Logic in Practice

ILP

■ Learning

■ ILP

■ Input

■ FOIL

■ Example

■ Specializing

■ ILP Applications

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 18 / 25

→ Grandfather(x,y)

Page 20: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Example

Leibniz

Logic in Practice

ILP

■ Learning

■ ILP

■ Input

■ FOIL

■ Example

■ Specializing

■ ILP Applications

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 18 / 25

→ Grandfather(x,y)

Father(x,y) → Grandfather(x,y) (always wrong)Parent(x,y) → Grandfather(x,y) (many false +)Father(x,z) → Grandfather(x,y) (selected)

Page 21: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Example

Leibniz

Logic in Practice

ILP

■ Learning

■ ILP

■ Input

■ FOIL

■ Example

■ Specializing

■ ILP Applications

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 18 / 25

→ Grandfather(x,y)

Father(x,y) → Grandfather(x,y) (always wrong)Parent(x,y) → Grandfather(x,y) (many false +)Father(x,z) → Grandfather(x,y) (selected)

Father(x,z) ∧ Parent(z,y) → Grandfather(x,y) (target)

Page 22: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Specializing

Leibniz

Logic in Practice

ILP

■ Learning

■ ILP

■ Input

■ FOIL

■ Example

■ Specializing

■ ILP Applications

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 19 / 25

New literals:

1. Any predicate over any variables, where at least one of thevariables is in previous literal or head

2. Equal(x, y), where x and y are already in rule3. Negation of any of the above

Best: maximizes ‘information gain’

Clause must be shorter than positives it explains (cf Ockham’srazor).

Page 23: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

ILP Applications

Leibniz

Logic in Practice

ILP

■ Learning

■ ILP

■ Input

■ FOIL

■ Example

■ Specializing

■ ILP Applications

Logics of Action

Wheeler Ruml (UNH) Lecture 14, CS 730 – 20 / 25

1. Mutagenesis2. Toxicity3. Rules of chess4. Protein structure5. Parsers

Page 24: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Logics of Action

Leibniz

Logic in Practice

ILP

Logics of Action

■ Event Calculus

■ Situation Calculus

■ Problems

■ EOLQs

Wheeler Ruml (UNH) Lecture 14, CS 730 – 21 / 25

Page 25: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Event Calculus

Leibniz

Logic in Practice

ILP

Logics of Action

■ Event Calculus

■ Situation Calculus

■ Problems

■ EOLQs

Wheeler Ruml (UNH) Lecture 14, CS 730 – 22 / 25

Events and fluents are reified:

Member(E23,Flyings)∧Agent(E23, John)∧Happens(E23, I7) . . .

T (At(John,KN133 ), t1)∧Terminates(E23,At(John,KN133 ), t2) . .

Page 26: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Situation Calculus

Leibniz

Logic in Practice

ILP

Logics of Action

■ Event Calculus

■ Situation Calculus

■ Problems

■ EOLQs

Wheeler Ruml (UNH) Lecture 14, CS 730 – 23 / 25

World state (= situation) is reified:

Result(GoForward, s0) = s1

Result(Turn(right), s1) = s2

∀s, a, bClear(a, s)∧Clear(b, s)→ On(a, b,Result(PutOn(a, b), s))

Page 27: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

Problems with Logic

Leibniz

Logic in Practice

ILP

Logics of Action

■ Event Calculus

■ Situation Calculus

■ Problems

■ EOLQs

Wheeler Ruml (UNH) Lecture 14, CS 730 – 24 / 25

Defaults: hard to have coherent semantics and efficientinference (default logics, answer set programming, probabilisticlogic)

Ramification problem: choosing what to infer (specializedsystems)

Retraction: when previous truth becomes false (truthmaintenance systems)

Qualification problem: making rules correct (probabilisticlogic)

Page 28: Leibniz reduction in German population 15–30% in some ...ruml/cs730/slides/lecture-14-other-logic.pdf · The 30 Years War (1618–1648) Leibniz LogicinPractice ILP LogicsofAction

EOLQs

Leibniz

Logic in Practice

ILP

Logics of Action

■ Event Calculus

■ Situation Calculus

■ Problems

■ EOLQs

Wheeler Ruml (UNH) Lecture 14, CS 730 – 25 / 25

■ What question didn’t you get to ask today?■ What’s still confusing?■ What would you like to hear more about?

Please write down your most pressing question about AI and putit in the box on your way out.Thanks!