klassische themen der computerwissenschaften artificial

109
Institute for Software Technology Klassische Themen der Computerwissenschaften Artificial Intelligence Prof. Dr. Franz Wotawa [email protected]

Upload: others

Post on 26-May-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Klassische Themen der Computerwissenschaften

Artificial Intelligence

Prof. Dr. Franz Wotawa [email protected]

Page 2: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

History of AI The following slides are an excerpt from http://www.aaai.org/AITopics/bbhist.html#intro

Page 3: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

History of AI §  5th century B.C.

§  Aristotle introduced the syllogistic logic §  16th century

§  Famous story of the Golem who is said to be invented by Rabbi Loew of Prague (1580).

§  17th century §  Pascal created the first mechanical digital calculating

machine (1642). §  Leibniz improved Pascal's machine (1673)

§  19th century §  Mary Shelley published the story Frankenstein (1818). §  George Boole developed a binary algebra §  Charles Babbage & Ada Byron (Lady Lovelace) worked on

programmable mechanical calculating machines.

Page 4: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

History of AI §  20th century - First Half

§  Bertrand Russell and Alfred North Whitehead published Principia Mathematica, which revolutionaized formal logic.

§  Warren McCulloch & Walter Pitts publish "A Logical Calculus of the Ideas Immanent in Nervous Activity" (1943), laying foundations for neural networks.

§  Arturo Rosenblueth, Norbert Wiener & Julian Bigelow coin the term "cybernetics" in a 1943 paper. Wiener's popular book by that name published in 1948.

§  A.M. Turing published "Computing Machinery and Intelligence" (1950).

§  Claude Shannon published detailed analysis of chess playing as search (1950).

Page 5: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

History of AI 1950-59 §  John McCarthy coined the term "artificial

intelligence" as the topic of the Dartmouth Conference, the first conference devoted to the subject.

§  Demonstration of the first running AI program, the Logic Theorist (LT) written by Allan Newell, J.C. Shaw and Herbert Simon

§  The General Problem Solver (GPS) demonstrated by Newell, Shaw & Simon

§  John McCarthy (MIT) invented the Lisp language

Page 6: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

History of AI 1960-69 §  James Slagle (PhD dissertation, MIT) wrote (in Lisp) the first symbolic integration program,

SAINT, which solved calculus problems at the college freshman level §  Thomas Evans' program, ANALOGY, written as part of his PhD work at MIT, demonstrated

that computers can solve the same analogy problems as are given on IQ tests §  Edward A. Feigenbaum & Julian Feldman published Computers and Thought, the first

collection of articles about artificial intelligence §  Danny Bobrow's dissertation at MIT (tech.report #1 from MIT's AI group, Project MAC),

shows that computers can understand natural language well enough to solve algebra word problems correctly

§  J. Alan Robinson invented a mechanical proof procedure, the Resolution Method, which allowed programs to work efficiently with formal logic as a representation language.

§  Joseph Weizenbaum (MIT) built ELIZA, an interactive program that carries on a dialogue in English on any topic. It was a popular toy at AI centers on the ARPA-net when a version that "simulated" the dialogue of a psychotherapist was programmed

§  Dendral program (Edward Feigenbaum, Joshua Lederberg, Bruce Buchanan, Georgia Sutherland at Stanford) demonstrated to interpret mass spectra on organic chemical compounds. First successful knowledge-based program for scientific reasoning

§  Marvin Minsky & Seymour Papert publish Perceptrons, demonstrating limits of simple neural nets

§  SRI robot, Shakey, demonstrated combining locomotion, perception and problem solving

Page 7: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

History of AI 1970-79 §  Terry Winograd's PhD thesis (MIT) demonstrated the ability of computers to

understand English sentences in a restricted world of children's blocks, in a coupling of his language understanding program, SHRDLU, with a robot arm that carried out instructions typed in English.

§  Prolog developed by Alain Colmerauer §  Ted Shortliffe's PhD dissertation on MYCIN (Stanford) demonstrated the power

of rule-based systems for knowledge representation and inference in the domain of medical diagnosis and therapy. Sometimes called the first expert system

§  Marvin Minsky published his widely-read and influential article on Frames as a representation of knowledge, in which many ideas about schemas and semantic links are brought together

§  The Meta-Dendral learning program produced new results in chemistry (some rules of mass spectrometry) the first scientific discoveries by a computer to be published in a refereed journal

§  Randall Davis demonstrated the power of meta-level reasoning in his PhD dissertation at Stanford

§  Drew McDermott & Jon Doyle at MIT, and John McCarthy at Stanford begin publishing work on non-monotonic logics and formal aspects of truth maintenance

Page 8: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

History of AI 1980-89 §  Lisp Machines developed and marketed §  First expert system shells and commercial

applications §  James Allen invents the Interval Calculus, the first

widely used formalization of temporal events §  Neural Networks become widely used with the

Backpropagation algorithm (first described by Werbos in 1974)

§  Marvin Minsky publishes The Society of Mind, a theoretical description of the mind as a collection of cooperating agents

Page 9: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

History of AI 1990- §  Major advances in all areas of AI, with significant

demonstrations in machine learning, intelligent tutoring, case-based reasoning, multi-agent planning, scheduling, uncertain reasoning, data mining, natural language understanding and translation, vision, virtual reality, games, and other topics

§  Rod Brooks' COG Project at MIT, with numerous collaborators, makes significant progress in building a humanoid robot

§  The Deep Blue chess program beats the current world chess champion, Garry Kasparov, in a widely followed match

§  RoboCup series started 1997!! §  Web crawlers and other AI-based information extraction

programs become essential in widespread use of the world-wide-web

§  Interactive robot pets (a.k.a. "smart toys") become commercially available, realizing the vision of the 18th cen. novelty toy makers

Page 10: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

History of AI – RoboCup 2006

Page 11: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

History of AI – Robotic applications

Aus Visa Magazin 4/2006

Page 12: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

New AI Summer is just arriving!

§  IBM Watson §  Google Deep Learning

§  Many practical applications §  Automated driving §  Industry 4.0 §  Web & Apps,…

Page 13: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

IBM Watson (2011)

Page 14: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Google AlphaGo (2016)

Page 15: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Automated driving

§  DARPA Grand Challenge (2004-2007) §  Google Car

Page 16: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

But there are also ethical issues…

See moralmachine.mit.edu!

Page 17: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

References & Links §  AAAI. AI Topics: History of AI at

www.aaai.org/aitopics/html/history.html §  50 Years - Artificial Intelligence Symposium

(www.ki2006.fb3.uni-bremen.de/50years.htm) at KI 2006 (17 June 2006, Bremen). "This year, the Artificial Intelligence community celebrates the golden anniversary of the 1956 Dartmouth Conference that marks the beginning of AI as a research field. This symposium will take stock of the promises and achievements of AI and looks ahead to the next 50 years. The meeting will be moderated by Wilfried Brauer (TU München / U Bremen)."

§  Stuart Russel and Peter Norvig, “Artificial Intelligence: A Modern Approach, 2nd Edition”, Prentice Hall, 2003, ISBN-10:0137903952, ISBN-13:9780137903955

Page 18: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

The Turing Test (TT) �

Page 19: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

The Imitation Game (I)

♀ ♀

♀ ♂ ?

Page 20: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

The Imitation Game (II) ♀ ♀

♀ ♂ ? ♀ ♀

♀ ♂ ?

Page 21: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

The Turing Test (TT)

☺ ☺

☺?

Page 22: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

The Turing Test - Summary §  Testing intelligence by answering the

question “Can machines communicate in natural language in a manner indistinguishable from that of a human being?”

§  Arguments against TT and some replies from Turing (see next slides)

§  References: Ayse Pinar Saygin, Ilyas Cicekli, and Varol Akman, “Turing Test: 50 Years later”, Minds and Machines 10:463-518, Kluwer, 2000.

Page 23: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Arguments against TT (I) §  ‘Heads in the sand’ objection: Thinking

machines are not good because they would share human abilities (e.g. thinking).

§  Mathematical objections: E.g. Gödel’s Theorem (However, maybe intelligent machines can make mistakes)

§  Arguments from consciousness: Machines should be aware about themselves. Extreme point of view ‘Solipsism’: The only way to really know whether a machine (or man) is thinking or not is to be that machine (or man). Also known as ‘other minds problem’.

Page 24: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Arguments against TT (II)

§  Arguments from various disabilities: ‘machines can never do X’ where X is something like ‘have sense of humor’.

§  Lady Lovelace’s objection: A machine cannot originate anything.

§ …

Page 25: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Logic-based AI �

Page 26: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Logic-based AI

§  Use logic for representing knowledge and for reasoning

§  The representation of knowledge has an impact on the reasoning capabilities

§  Explicit versus implicit knowledge §  Declarative versus procedural

knowledge

Page 27: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Explicit vs. implicit knowledge

§  “The output is true if at least one of its inputs is true” o = i1 ∨ … ∨ ik

1 i1 .. ik

o

McCulloch-Pitts Neurons Neural Networks

Page 28: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Knowledge can be distributed

2

2

1

a b c 0 0 0 0 1 1 1 0 1 1 1 0

a

b

c

Page 29: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Procedural vs. declarative knowledge

function prim (n:integer): boolean; var i: integer; begin if n <=1 then prim:=false. else begin i:=2; while (i<=trunc(sqrt(n))+1) and (n mod i <> 0) do i := i+1; prim := (n=2) or (n mod i <> 0) end

end

prim(n) ↔ ( n>1 ∧ ∀m (teilt(m,n) → (m=1 ∨ m=n) ) )

Page 30: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Requirements for knowledge-based systems

§  In Knowledge-based Systems (KBS, Expert Systems) knowledge has to be: §  explicit, and §  declarative

Page 31: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Why logic?

§  Somehow easy way for describing the world

§  Close to natural language §  Almost problem independent §  Example: “When it is raining the streets

are wet” and “It is raining”.

Page 32: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Example function wet (): boolean

begin

if raining then wet=true;

else wet=false;

end

§  Formalising theory: 1.  raining → wet 2.  raining

§  Conlusion: wet

Page 33: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Another example

§  Model: 1.  “birds can fly” 2.  “penguins are birds” 3.  “tweety is a bird” 4.  “tweety is a penguin” 5.  “penguins cannot fly”

But also dead birds cannot fly!

Page 34: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Propositional Logic �

Page 35: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Syntax

§  Set of basic propositions (atoms, atomic formulas): a,b,c,…, p1,…

§  Compound formulas

§  Definition (PL): A well formed formula in the propositional logic is defined as follows:

1.  Every basic proposition is a formula 2.  If P is a formula, then ¬P is a formula 3.  If P and Q are formulas, then (P∧Q), (P∨Q),

(P→Q), (P↔Q) are formulas

Page 36: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Semantics

§  ¬P is true if P is false, and false if P is true. §  (P∧Q) is true if both P and Q are true and

false, otherwise. §  (P∨Q) is true if P or Q is true and false,

otherwise. §  (P→Q) is true if P is false or if both P and Q

are true and false, otherwise. §  (P↔Q) is true if P and Q are both true or

false, and false otherwise.

Page 37: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Interpretation of PL formulas §  Definition (Interpretation): Given a propositional

formula G with atoms A1,..,Ak occurring in G. An interpretation of G is an assignment of truth values to A1,..,Ak in which every Ai is assigned either T or F, but not both.

§  Definition: A formula G is said to be true under an interpretation iff G is evaluated to T in the interpretation. Otherwise, G is said to be false under the interpretation.

§  Definition (Model): Given a formula G and an interpretation I. If G is true under I, then I is called a model (for G).

Page 38: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Checking validity and consistency of PL formulas

§  Use truth tables! §  Definition (valid): A formula G is said to

be valid iff it is true under all its interpretations.

§  Definition (consistent, satisfiable): A formula G is said to be consistent (satisfiable) iff there is at least one interpretation under which G is true.

Page 39: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Some remarks

§  A valid formula G is said to be a TAUTOLOGY, i.e., ⊧ G.

§  An inconsistent formula G is said to be a CONTRADICTION, i.e., ¬ ⊧ G.

§  A valid formula is consistent but not vice versa.

§  An inconsistent formula is invalid but not vice versa.

Page 40: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Logical consequences

§  Definition (Consequence): Given a formula F and G. G is said to be a logical consequence of F iff for any interpretation I in which F is true, G is also true. We write in this case F ⊧ G.

§  Remark: If F ⊧ G, then every model for F is also a model for G.

Page 41: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Some theorems

§  Theorem 1: F ⊧ G iff ⊧ (F→G)

§  Theorem 2: F ⊧ G iff (F∧¬G) is inconsistent

Page 42: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

An example

§  “Given that if the congress refuses to enact new laws, then the strike will not be over unless it lasts more than one year and the president of the firm resigns, will the strike not be over if the congress refuses to act and the strike just starts?”

Page 43: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Abduction – Another form of reasoning

§  Given a theory and observations. Abduction tries to find an explanation for the observations which comes from the theory.

§  Example: §  Theory: T ={ raining → wet } §  Observation: O = { wet } §  Explanation: E = { raining } !

§  T ∪ E ⊧ O and T ∪ E is consistent

Page 44: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Abduction – Another example

§  What happens with our bird example? 1.  “birds can fly” 2.  “penguins are birds” 3.  “tweety is a bird” 4.  “tweety is a penguin” 5.  “penguins cannot fly”

§  Possible explanations for the observation that penguins cannot fly are not consistent with the theory! (Try it)

Page 45: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

References

§  Chang and Lee, “Symbolic Logic and Mechanical Theorem Proving”, Academic Press, 1973.

§  Bauer and Wirsing, “Elementare Aussagenlogik”, Springer-Verlag, 1991.

§  R. Stoll, “Set theory and logic”, Dover, 1979. §  R. Smullyan, “First-order logic”, Dover, 1995.

Page 46: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

PL – Example �

Page 47: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Constructed Wetlands

§  Used in smaller villages to clean their waste water.

Page 48: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Problem description §  The weather, the

position of the in valve, and the membrane have an impact on the water level.

§  The water level impacts the plants.

§  The nitrates and phosphates in the water have an impact on the plants.

Membrane

In valve Plants

Weather

Page 49: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Modelling / Assumeables

§  Position of the input valve: VALVE §  Quality of the water coming in:

WQUALITY §  Weather condition: WEATHER §  Condition of the Membrane:

MEMBRANE

Page 50: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Modelling / Facts, Observables

§  Water level: ok_level §  Water quality: ok_np §  Weather: ok_weather §  Plants color: green, yellow §  Membrane: not_leaking §  Input valve: nom_inflow

Page 51: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Model VALVE → nom_inflow. MEMBRANE → not_leaking. WQUALITY → ok_np. WEATHER → ok_weather. nom_inflow ∧ not_leaking ∧ ok_weather → ok_level. ok_np ∧ ok_level → green. green ∧ yellow → ⊥.

Page 52: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Problems with standard logics

§  Commonsense reasoning → Bird example

§  Explanations from theories → Constructed wetland → Nixon example

Page 53: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

AI objectives

§  Formalize knowledge such that a machine can fulfill a certain task like a human.

§  Find explanations §  Retain consistency §  Explain human intelligence § …

Theory The

solution is…

Page 54: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Klassische Themen der Computerwissenschaften

Artificial Intelligence

Prof. Dr. Franz Wotawa [email protected]

Page 55: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Knowledge representation & reasoning

Page 56: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

KRR

§  Use logic to represent knowledge (e.g., the theory) §  Represent important aspects of a problem! §  Separate different kinds of knowledge

(background knowledge, case-specific knowledge,..)

§  Describe knowledge from Causes to Effects

§  Use logical reasoning to derive new knowledge

Page 57: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Example Force ?

Page 58: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Example (cont.)

§  But also:

Page 59: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Example (formalization)

§  Formalization in propositional logic: §  equalForce → midPosition §  lowerForce → downPosition §  higherForce → upPosition §  break → downPosition

Page 60: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Abductive vs. deductive reasoning

§  Abduction: §  Reasoning from Effects to Causes §  From downPosition follows either break or

lowerForce §  For a definition have a look at previous slides

§  Deduction: §  Reasoning from Causes to Effects §  From break follows downPosition using the

definition of logical consequences

Page 61: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Monotonic vs. Non-monotonic reasoning

§  Monotonic: §  “From new knowledge we can derive more

knowledge” §  If we add

downPosition → shouldHappen to the theory, we can derive shouldHappen when assuming lowerForce.

§  Non-Monotonic: §  “Adding new knowledge leads to a decrease of

knowledge that can be derived”

Page 62: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Non-monotonic reasoning - Inconsistencies

§  What happens when we add: §  ¬(midPosition ∧ downPosition) §  ¬(midPosition ∧ upPosition) §  ¬(upPosition ∧ downPosition)

§  to the theory together with the following observations? §  higherForce ∧ downPosition

§  The theory becomes inconsistent!!!

Page 63: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Consequences of inconsistencies

§  Everything can be derived! §  We cannot derive anything meaningful

anymore!

Page 64: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Solution

§  Change the theory §  Use a different schema for deriving new

knowledge → Allow for removing knowledge in order to retain consistency!

Page 65: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

New formalization

§  New Theory: §  equalForce ∧ ¬break → midPosition §  lowerForce ∧ ¬break → downPosition §  higherForce ∧ ¬break → upPosition §  break → downPosition §  ¬(midPosition ∧ downPosition) §  ¬(midPosition ∧ upPosition) §  ¬(upPosition ∧ downPosition)

Page 66: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Default reasoning

Page 67: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Idea

§  In sentences we have some kind of hidden assumptions, i.e., defaults!

§  Example: §  equalForce ∧ ¬break → midPosition § …

Assumption that the system is not broken, i.e., the system is working as expected.

Page 68: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Idea (cont.)

§  Make hidden assumptions explicit (as always in AI)

§  Introduce defaults, i.e., logical sentences that can only be used unless a contradiction can be derived.

Page 69: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Definition Default

§  Definition (Default): A default δ is any configuration of the form where A, B1,…,Bn, C are logical sentences (A: prerequisite, B1,..,Bn: justifications, C: consequent). We also write (A : B1,…,Bn | C) to express defaults.

A : B1,…,Bn

C

Page 70: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Semantics of defaults

§  Informal semantics: §  If A is true and it is not contradictory to

assume B1,…,Bn, then we can conclude C. §  Given two sets of sentences S and T

and a default δ. By applying δ to T with respect to S (i.e., δ ∇S T), we mean that if A∈T and ¬B1,…, ¬Bn ∉ S, then C∈T. §  S is a set of axioms of T and all

consequences of previously used defaults.

Page 71: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Default theories

§  Definition (Default Theory): A default theory is a pair (ℜ,Δ) where ℜ is a set of logical sentences and Δ is a set of defaults.

§  Example: Δ = { (bird : fly | fly) } and ℜ = { penguin, penguin → bird, penguin → ¬fly }

§  Using (ℜ,Δ) and the fact penguin we cannot longer derive a contradiction!

Page 72: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

How to handle defaults

§  Take all axioms of the theory ℜ and apply defaults.

§  We define this idea by introducing the smallest set of beliefs Λ(ℜ,Δ)(S) that we can derive from the given knowledge and S:

1.  ℜ∈ Λ(ℜ,Δ)(S) 2.  Th(Λ(ℜ,Δ)(S)) = Λ(ℜ,Δ)(S) 3.  If δ∈Δ, then δ ∇S Λ(ℜ,Δ)(S)

Page 73: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Extensions

§  Definition: A set E of sentences is an extension for a default theory (ℜ,Δ) iff E is a fixed point of the operator Λ(ℜ,Δ) (i.e., Λ(ℜ,Δ)(E) = E)

§  Example: The default theory ({R,Q},{(R:¬P|¬P), (Q:P|P)}) has two extensions E1={P} and E2={¬P}

§  Extensions describe “POSSIBLE WORLDS”

Page 74: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Goals / Problems

§  Compute all extensions of default theories

§  This computation is very complex §  Thus we restrict the default theories to

comprise only facts, rules (i.e. implications), and normal defaults.

§  A default is said to be normal iff it is of the form (A : B | B).

Page 75: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

References

§  Philippe Besnard, “An Introduction to Default Logic”, Springer, 1989.

Page 76: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Assumption-based reasoning

Page 77: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Assumption-based reasoning

§  Use special “propositions”, i.e., assumptions that can be either true or false.

§  Use assumptions to retain consistency of theories

§  Afterwards extensions and explanations for inconsistencies can be given

Page 78: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

The coffee machine 1.  Request → request 2.  Water → water 3.  Beans → beans 4.  request ∧ water ∧ beans → coffee 5.  coffee → request 6.  coffee → water 7.  coffee → beans 8.  no_coffee ∧request∧ water→ no_beans 9.  no_coffee ∧request∧ beans→ no_water 10. no_coffee ∧beans∧ water→ no_request 11. beans ∧ no_beans → ⊥ 12. water ∧ no_water → ⊥ 13. request ∧ no_request → ⊥ 14. coffee ∧ no_coffee → ⊥ 15. no_coffee

Coffee-Machine

Coffee

Coffee-FilterWater

Coffee-Mill

Coffee-Container

Water-Tank

Page 79: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

ATMS – Basic ideas

§  Assumption-based Truth Maintenance System (ATMS) §  Retain truth §  Knowledge-base updates §  First step for computing explanations

Page 80: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

ATMS – Basic ideas (cont.)

§  Request → request

§  Represent assumptions, propositions and rules as directed graph

§  coffee ∧ no_coffee → ⊥

Assumption Proposition

Nogood (Inconsistency, Falsum)

Request request

Page 81: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

ATMS node §  Nodes store basic information §  Nodes for Assumptions, propositions, and

Inconsistencies (Contradictions are stored in a node called NOGOOD).

§  Nodes store §  Their name §  A set of a set of assumptions which have to be

true in order to make the node true (Environments) §  A set of justifications where a justification is a set

of propositions which have to be true in order to make the node true.

Page 82: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

ATMS node (cont.)

§  Request → request (Request, {{Request}}, {(Request)}) (request, {{Request}}, {(Request)})

Request request

Name Assumption Justification

Page 83: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Some remarks

§  Representation: §  Premises (p,{{}},{()}) §  Assumptions (A,{{A}},{(A)}) §  Propositions (p,{S1,..}, {J1,..})

§  Logical interpretation of (p, {{A11,..,A1n(1)},..}, {(q11,..,q1m(1)),..} §  A11 ∧…∧ A1n(1) → p … §  q11 ∧…∧ q1m(1) → p …

Page 84: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Task of the ATMS

§  For every rule added to the ATMS construct possible new nodes and vertices.

§  Compute the labels, i.e., the set of assumptions, for every node such that the labels are: §  Consistent §  Minimal §  Complete §  Sound

Page 85: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Example

§  Add rules in the given order 1.  Request → request 2.  Water → water 3.  Beans → beans 4.  request ∧ water ∧ beans → coffee 5.  coffee ∧ no_coffee → ⊥ 6.  no_coffee (FACT, Premise)

Page 86: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

ATMS before adding fact / premise

Request {{Request}}

Water {{Water}}

Beans {{Beans}}

request {{Request}}

water {{Water}}

beans {{beans}}

coffee {{Request,Water,Beans}}

no_coffee {}

⊥ {}

Page 87: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

ATMS after adding fact

Request {{Request}}

Water {{Water}}

Beans {{Beans}}

request {{Request}}

water {{Water}}

beans {{Beans}}

coffee {{Request,Water,Beans}}

no_coffee {}

⊥ {{Request,Water,Beans}}

no_coffee {{}}

⊥ {}

coffee {}

Page 88: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

What happens when..

§  Adding the fact request? §  Adding the fact beans? § …

Page 89: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

ATMS algorithm (1)

§  Call algorithm if justification (=rule) is added.

§  Remark: J: q1∧…∧qn → p Antecedence Consequent

§  When J is supplied call PROPAGATE(J,Φ,{{}})

where Φ indicates the absence of an optional antecedence node.

Page 90: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

ATMS algorithm (2)

§  PROPAGATE ( q1∧…∧qn → p, a, I) 1.  [Compute the incremental update]

L = WEAVE (a, I, {q1,…,qn }) 2.  [Update label and recure]

UPDATE (L,p)

Page 91: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

ATMS algorithm (3) §  UPDATE (L, p)

1.  [Dedect nogoods] If p = ⊥ the call NOGOOD (E) for each E∈L and return {}

2.  [Update p’s label ensuring minimality] 1.  Delete every environment from L which is a superset of

some label environment of p. 2.  Delete every environment from the label of p which is a

superset of some element of L. 3.  Add every remaining environment of L to the label of p.

3.  [Propagate the incremental change of p’s label to its consequences] For every justification J in which p is an antecedence node call PROPAGATE (J,p,L).

Page 92: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

ATMS algorithm (4) §  WEAVE (p,I,X)

1.  [Termination condition] If X is empty, return I.

2.  [Iterate over the antecedence nodes] Let h be the first node of the list X and R the rest.

3.  [Avoid computing the full label] If h = p, return WEAVE (Φ,I,R)

4.  [Incrementally construct the label] Let I’ be the set of all environments formed by computing the union of an environment of I and an environment of h’s label.

5.  [Ensure that I’ is minimal and contains no known inconsistency] Remove from I’ all duplicates, nogoods, as well as any environment subsumed by any other.

6.  Return WEAVE (p, I’, R).

Page 93: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

ATMS algorithm (5)

§  NOGOOD (E) 1.  Mark E as nogood 2.  Remove E and any superset from every

node label

Page 94: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

ATMS remarks

§  ATMS retains consistency by maintaining the node labels and the nogood.

§  Label update for the ATMS is NP-complete!

§  Various extensions mentioned in literature

Page 95: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

References

§  Johan de Kleer. “An assumption-based TMS”, Artificial Intelligence, 28:127-162, 1986.

§  Johan de Kleer: “A general labeling algorithm for assumption-based truth maintenance”. In proceedings of the AAAI, pp 188-192, 1988.

Page 96: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Explanations

Page 97: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Basic idea

§  ATMS retains consistency §  Inconsistent knowledge is stored in a

NOGOOD. §  The labels of the NOGOOD represent

all possible ways for deriving an inconsistency.

§  Hence, the provide information about the explanation for an inconsistency.

Page 98: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Example §  Given the nogood

NOGOOD {{Water},{Beans}} §  This means that both Water and Beans lead to an

inconsistency. Hence, we have to refill the water and the beans in order to obtain coffee.

§  Formally: Water → ⊥ and Beans → ⊥

§  In order to explain consistency we have to consider all environments of the nogood node.

§  In particular we have to take one element of each nogood and make it false. Hence, logically the nogood cannot longer be derived!

Page 99: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

More general …

§  NOGOOD Environments: A11 ∧ … ∧ A1n(1) → ⊥

… Am1 ∧ … ∧ Amn(1) → ⊥

§  Selection of A1i(1) … Am i(m) and setting their truth values to false ensures consistency!

§  Computing all selection is equivalent to computing all hitting sets (HS) of a set of sets.

Page 100: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Hitting sets

§  Definition: Given a set of sets F. A set H ⊆ ⋃x∈F x is called a hitting set for F iff the intersection of h with every set x ∈ F is not empty, i.e., x ∩ H ≠ ∅.

§  Definition: A hitting set H is minimal if no proper subset H’ of H is a hitting set.

Page 101: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Example - HS

§  Given: F = {{a,b},{a,c}} §  Solution: 2 minimal hitting sets

§  {a} §  {b,c}

Page 102: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Computing hitting sets §  There are many algorithms described in literature,

e.g., Ray Reiter, “A Theory of Diagnosis from First Principles”, Artificial Intelligence, 32(1):57-95, 1987. R. Greiner, B.A. Smith, R.W. Wilkerson, “A Correction to the Algorithm in Reiter’s Theory of Diagnosis”, Artificial Intelligence, 41(1):79-88, 1989.

§  Idea: construct a graph from the given set of sets

Page 103: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Putting it all together

Page 104: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Computing extensions for normal defaults

§  Given a default theory (ℜ,Δ) where each δ∈Δ is of the form (X : a | a).

§  First compute a theory T = ℜ ∪ { A ∧ X →a | (X : a | a)∈Δ} where A is a unique assumable which correspond to a. Let AS be the set of all assumables.

§  Feed T into an ATMS §  Take the environments of the NOGOOD and compute the hitting

sets. We know that all elements of each hitting sets have to be assigned a false truth value. In our case extensions in contrast have only positive elements.

§  All hitting sets are explanations for an inconsistency. We can take a hitting set H and compute Th(T ∪ (H\AS)) which is an extension of (ℜ,Δ).

Page 105: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Example §  Given:

({r,q, np ∧ p → ⊥},{(r:np|np), (q:p|p)}) §  T = {r,q, np ∧ p → ⊥, NP∧r →np, P∧q →p} §  The ATMS delivers the NOGOOD {{P,NP}}. §  We obtain two hitting sets

§  H1 = {P} §  H2 = {NP}

§  Hence, we get two extensions §  E1 = Th(T∪({P,NP}\H1)) = {r,q,np,NP} §  E2 = Th(T∪({P,NP}\H2)) = {r,q,p,P}

Page 106: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Alternative computation using truth tables and SAT

§  {r,q, np ∧ p → ⊥, NP∧r →np, P∧q →p}

r q p np P NP Theory

T T F F F F T

T T F T F T T

T T T F T F T

… … … … … … F

Page 107: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

SAT-Solver

§  Programs for proving satisfiability of propositional theories

§  See www.satlive.org §  E.g. Java-Sat Solver: SAT4J

Page 108: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Conclusion

§  Overview of logic-based AI focusing on some aspects of default and assumption-based reasoning

§  Restricted to propositional logic comprising facts and rules (Horn Clause Theories)

§  Applications: §  Commonsense Reasoning §  Diagnosis §  Knowledge-based configuration §  …

Page 109: Klassische Themen der Computerwissenschaften Artificial

Institute for Software Technology

Conclusion

§  Modeling for AI §  Abductive vs. deductive reasoning

§  Abduction: From a theory T and observations O derive explanations E, i.e., T ∧ E ⊧ O and T ∧ E is consistent

§  Deduction: From a theory T and facts F derive new facts N, i.e., T ∧ F ⊧ N

§  Non-monotonic vs. monotonic reasoning