klassische themen der computerwissenschaften artificial
TRANSCRIPT
Institute for Software Technology
Klassische Themen der Computerwissenschaften
Artificial Intelligence
Prof. Dr. Franz Wotawa [email protected]
Institute for Software Technology
History of AI The following slides are an excerpt from http://www.aaai.org/AITopics/bbhist.html#intro
�
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.
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).
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
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
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
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
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
Institute for Software Technology
History of AI – RoboCup 2006
Institute for Software Technology
History of AI – Robotic applications
Aus Visa Magazin 4/2006
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,…
Institute for Software Technology
IBM Watson (2011)
Institute for Software Technology
Google AlphaGo (2016)
Institute for Software Technology
Automated driving
§ DARPA Grand Challenge (2004-2007) § Google Car
Institute for Software Technology
But there are also ethical issues…
See moralmachine.mit.edu!
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
Institute for Software Technology
The Turing Test (TT) �
Institute for Software Technology
The Imitation Game (I)
♀ ♀
♀ ♂ ?
Institute for Software Technology
The Imitation Game (II) ♀ ♀
♀ ♂ ? ♀ ♀
♀ ♂ ?
Institute for Software Technology
The Turing Test (TT)
☺ ☺
☺?
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.
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’.
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.
§ …
Institute for Software Technology
Logic-based AI �
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
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
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
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) ) )
Institute for Software Technology
Requirements for knowledge-based systems
§ In Knowledge-based Systems (KBS, Expert Systems) knowledge has to be: § explicit, and § declarative
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”.
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
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!
Institute for Software Technology
Propositional Logic �
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
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.
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).
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.
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.
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.
Institute for Software Technology
Some theorems
§ Theorem 1: F ⊧ G iff ⊧ (F→G)
§ Theorem 2: F ⊧ G iff (F∧¬G) is inconsistent
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?”
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
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)
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.
Institute for Software Technology
PL – Example �
Institute for Software Technology
Constructed Wetlands
§ Used in smaller villages to clean their waste water.
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
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
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
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 → ⊥.
Institute for Software Technology
Problems with standard logics
§ Commonsense reasoning → Bird example
§ Explanations from theories → Constructed wetland → Nixon example
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…
Institute for Software Technology
Klassische Themen der Computerwissenschaften
Artificial Intelligence
Prof. Dr. Franz Wotawa [email protected]
Institute for Software Technology
Knowledge representation & reasoning
�
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
Institute for Software Technology
Example Force ?
Institute for Software Technology
Example (cont.)
§ But also:
Institute for Software Technology
Example (formalization)
§ Formalization in propositional logic: § equalForce → midPosition § lowerForce → downPosition § higherForce → upPosition § break → downPosition
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
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”
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!!!
Institute for Software Technology
Consequences of inconsistencies
§ Everything can be derived! § We cannot derive anything meaningful
anymore!
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!
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)
Institute for Software Technology
Default reasoning
�
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.
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.
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
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.
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!
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)
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”
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).
Institute for Software Technology
References
§ Philippe Besnard, “An Introduction to Default Logic”, Springer, 1989.
Institute for Software Technology
Assumption-based reasoning
�
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
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
Institute for Software Technology
ATMS – Basic ideas
§ Assumption-based Truth Maintenance System (ATMS) § Retain truth § Knowledge-base updates § First step for computing explanations
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
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.
Institute for Software Technology
ATMS node (cont.)
§ Request → request (Request, {{Request}}, {(Request)}) (request, {{Request}}, {(Request)})
Request request
Name Assumption Justification
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 …
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
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)
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 {}
⊥ {}
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 {}
Institute for Software Technology
What happens when..
§ Adding the fact request? § Adding the fact beans? § …
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.
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)
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).
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).
Institute for Software Technology
ATMS algorithm (5)
§ NOGOOD (E) 1. Mark E as nogood 2. Remove E and any superset from every
node label
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
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.
Institute for Software Technology
Explanations
�
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.
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!
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.
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.
Institute for Software Technology
Example - HS
§ Given: F = {{a,b},{a,c}} § Solution: 2 minimal hitting sets
§ {a} § {b,c}
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
Institute for Software Technology
Putting it all together
�
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 (ℜ,Δ).
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}
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
Institute for Software Technology
SAT-Solver
§ Programs for proving satisfiability of propositional theories
§ See www.satlive.org § E.g. Java-Sat Solver: SAT4J
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 § …
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