1 Logic Aided Lamarckian Evolution Evelina Lamma (1), Fabrizio Riguzzi (2), Luís Moniz Pereira (3) (1) DEIS, University of Bologna, Italy (2) DI, University.

Slides:



Advertisements
Similar presentations
Updates plus Preferences Luís Moniz Pereira José Júlio Alferes Centro de Inteligência Artificial Universidade Nova de Lisboa Portugal JELIA’00, Málaga,
Advertisements

CS6800 Advanced Theory of Computation
Exact and heuristics algorithms
Default Reasoning the problem: in FOL, universally-quantified rules cannot have exceptions –  x bird(x)  can_fly(x) –bird(tweety) –bird(opus)  can_fly(opus)
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
1 Transportation problem The transportation problem seeks the determination of a minimum cost transportation plan for a single commodity from a number.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Well-founded Semantics with Disjunction João Alcântara, Carlos Damásio and Luís Moniz Pereira Centro de Inteligência Artificial.
On the Genetic Evolution of a Perfect Tic-Tac-Toe Strategy
Tuesday, May 14 Genetic Algorithms Handouts: Lecture Notes Question: when should there be an additional review session?
Biologically Inspired AI (mostly GAs). Some Examples of Biologically Inspired Computation Neural networks Evolutionary computation (e.g., genetic algorithms)
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
1 Lecture 8: Genetic Algorithms Contents : Miming nature The steps of the algorithm –Coosing parents –Reproduction –Mutation Deeper in GA –Stochastic Universal.
João Alcântara, Carlos Damásio and Luís Moniz Pereira Centro de Inteligência Artificial (CENTRIA) Depto. Informática,
1 Logic Aided Lamarckian Evolution Evelina Lamma (1), Fabrizio Riguzzi (2), Luís Moniz Pereira (3) (1) DEIS, University of Bologna, Italy (2) DI, University.
Luís Moniz Pereira CENTRIA, Departamento de Informática Universidade Nova de Lisboa Pierangelo Dell’Acqua Dept. of Science and Technology.
Logic Program Revision The problem: The problem: –A LP represents consistent incomplete knowledge; –New factual information comes. –How to incorporate.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
Models -1 Scientists often describe what they do as constructing models. Understanding scientific reasoning requires understanding something about models.
Genetic Algorithms GAs are one of the most powerful and applicable search methods available GA originally developed by John Holland (1975) Inspired by.
LP and Non-Monotonicity LP includes a non-monotonic form of default negation not L is true if L cannot (now) be proven This feature is used for representing.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
Methods of Proof Chapter 7, second half.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
Scientific Thinking - 1 A. It is not what the man of science believes that distinguishes him, but how and why he believes it. B. A hypothesis is scientific.
Luís Moniz Pereira Centro de Inteligência Artificial - CENTRIA Universidade Nova de Lisboa, Portugal Pierangelo Dell’Acqua Dept. of Science and Technology.
Adaptive Reasoning for Cooperative Agents Luís Moniz Pereira Alexandre Pinto Centre for Artificial Intelligence – CENTRIA Universidade Nova de Lisboa INAP’09,
Chapter 6: Transform and Conquer Genetic Algorithms The Design and Analysis of Algorithms.
Genetic Algorithm.
SOFT COMPUTING (Optimization Techniques using GA) Dr. N.Uma Maheswari Professor/CSE PSNA CET.
Solving the Concave Cost Supply Scheduling Problem Xia Wang, Univ. of Maryland Bruce Golden, Univ. of Maryland Edward Wasil, American Univ. Presented at.
CS 484 – Artificial Intelligence1 Announcements Lab 3 due Tuesday, November 6 Homework 6 due Tuesday, November 6 Lab 4 due Thursday, November 8 Current.
Arindam K. Das CIA Lab University of Washington Seattle, WA MINIMUM POWER BROADCAST IN WIRELESS NETWORKS.
Applying Genetic Algorithm to the Knapsack Problem Qi Su ECE 539 Spring 2001 Course Project.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
1 Machine Learning: Lecture 12 Genetic Algorithms (Based on Chapter 9 of Mitchell, T., Machine Learning, 1997)
GENETIC ALGORITHM A biologically inspired model of intelligence and the principles of biological evolution are applied to find solutions to difficult problems.
Preference Revision via Declarative Debugging Pierangelo Dell’Acqua Dept. of Science and Technology - ITN Linköping University, Sweden EPIA’05, Covilhã,
1 Genetic Algorithms K.Ganesh Introduction GAs and Simulated Annealing The Biology of Genetics The Logic of Genetic Programmes Demo Summary.
Automated Patch Generation Adapted from Tevfik Bultan’s Lecture.
Genetic Algorithms Przemyslaw Pawluk CSE 6111 Advanced Algorithm Design and Analysis
Chapter 9 Genetic Algorithms.  Based upon biological evolution  Generate successor hypothesis based upon repeated mutations  Acts as a randomized parallel.
Introduction to Genetic Algorithms. Genetic Algorithms We’ve covered enough material that we can write programs that use genetic algorithms! –More advanced.
Genetic Algorithms What is a GA Terms and definitions Basic algorithm.
Re-Configurable Byzantine Quorum System Lei Kong S. Arun Mustaque Ahamad Doug Blough.
Genetic Algorithms. The Basic Genetic Algorithm 1.[Start] Generate random population of n chromosomes (suitable solutions for the problem) 2.[Fitness]
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 5: Power of Heuristic; non- conventional search.
NMR98 - Logic Programming1 Learning with Extended Logic Programs Evelina Lamma (1), Fabrizio Riguzzi (1), Luís Moniz Pereira (2) (1)DEIS, University of.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
1 Consistent-based Diagnosis Yuhong YAN NRC-IIT. 2 Main concepts in this paper  (Minimal) Diagnosis  Conflict Set  Proposition 3.3  Corollary 4.5.
Preliminary Background Tabu Search Genetic Algorithm.
D Nagesh Kumar, IIScOptimization Methods: M8L5 1 Advanced Topics in Optimization Evolutionary Algorithms for Optimization and Search.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
N- Queens Solution with Genetic Algorithm By Mohammad A. Ismael.
Learning Three-Valued Logical Programs Evelina Lamma 1, Fabrizio Riguzzi 1, Luis Moniz Pereira 2 1 DEIS, Università di Bologna 2 Centro de Inteligencia.
Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution.
Genetic Algorithm Dr. Md. Al-amin Bhuiyan Professor, Dept. of CSE Jahangirnagar University.
Agenda  INTRODUCTION  GENETIC ALGORITHMS  GENETIC ALGORITHMS FOR EXPLORING QUERY SPACE  SYSTEM ARCHITECTURE  THE EFFECT OF DIFFERENT MUTATION RATES.
1 Comparative Study of two Genetic Algorithms Based Task Allocation Models in Distributed Computing System Oğuzhan TAŞ 2005.
Genetic Programming. What is Genetic Programming? GP for Symbolic Regression Other Representations for GP Example of GP for Knowledge Discovery Outline.
Genetic Algorithm. Outline Motivation Genetic algorithms An illustrative example Hypothesis space search.
 Negnevitsky, Pearson Education, Lecture 12 Hybrid intelligent systems: Evolutionary neural networks and fuzzy evolutionary systems n Introduction.
October 19th, 2007L. M. Pereira and A. M. Pinto1 Approved Models for Normal Logic Programs Luís Moniz Pereira and Alexandre Miguel Pinto Centre for Artificial.
Genetic Algorithm (Knapsack Problem)
Introduction to Genetic Algorithms
Chapter 14 Genetic Algorithms.
Genetic Algorithms.
An evolutionary approach to solving complex problems
EE368 Soft Computing Genetic Algorithms.
Machine Learning: UNIT-4 CHAPTER-2
Presentation transcript:

1 Logic Aided Lamarckian Evolution Evelina Lamma (1), Fabrizio Riguzzi (2), Luís Moniz Pereira (3) (1) DEIS, University of Bologna, Italy (2) DI, University of Ferrara, Italy (3) CENTRIA, Departamento de Informática Universidade Nova de Lisboa, Portugal

2 Summary zGenetic algorithms zLamarckian operator zMulti-agent genetic algorithms zGenes and Memes zMulti-agent Crossover zBelief revision zEvolutionary approach to belief revision zExample zExperiments zConclusions

3 Genetic Algorithms zDarwinian operators: yselection ymutation ycrossover

4 Lamarckian operator zGiven a chromosome: yexpress it as a phenotype ymodify the phenotype in order to improve its fitness ytranslate back the phenotype into a genotype zModel of cultural evolution zConcept of “meme”

5 GA in Multi Agent Systems (MAS) zMAS: communication of knowledge by means of explicit messages zNew: communication of knowledge by exchange of genes and memes zIf the number of agents is fixed, each has a pool of chromosomes of its own; or each agent is a single chromosome and there is a single pool of agents

6 Genetic Operators zCrossover: used in order to exchange genes and memes among agents ya chromosome in an agent is crossed with chromosomes from other agents zLamarckian operator: used to locally improve the fitness by experience-directed self-mutation

7 Genes and Memes zGenes are modified only by Darwinian operators yindividual “physical” features are fixed yinherited irrespective of parental learning zMemes are modified by Darwinian and Lamarckian operators yindividual “cultural” features are changeable yinherited via parental learning

8 Asymmetrical flow of memes zMemes only go from teacher to learner zIn crossover: xgenes are copied from both parents xmemes are copied from another agent only if that agent has “accessed” and “tagged” them: accessed: confirmed or modified after an application of the Lamarckian operator tagged: an extra bit is associated to each meme in order to code whether the meme has been accessed.

9 Multi-agent crossover zA new agent offspring is produced from two parent chromosomes yone parent comes from the pool of another agent ybits from each parent are copied according to a mask zThe mask is such that: ygenes are selected randomly, half from each parent ymemes are selected randomly, half from memes in the other agent, but only if they have been accessed

10 Multiagent crossover  Mask 1 – take from Ag1 0 – take from Ag2 Ag1 tags Ag2 tags child in Ag1 pool genesmemes

11 Genetic algorithm (GA) GA(max_gen, p, r,m, l, Fitness) max_gen : maximum number of generations before termination p : number of individuals in the population r : fraction of population to be replaced by crossover at each step m : fraction of population to be mutated l : fraction of population that evolves Lamarckianly Fitness : fitness function F(h i )

12 Genetic algorithm GA(max_gen, p, r,m, l, Fitness) Initialize population P := set of p hypotheses randomly generated gen :=0 while gen <= max_gen Generate P S by applying the following operators to P : selection crossover mutation Lamarck update: P := P S return the hypothesis from P S with the highest fitness

13 Genetic operators select: select (1- r) p hypotheses from P with a probability Pb proportional to their fitness and add them to P S crossover: for i:=1 to r p select h 1 from P with probability Pb select h 2 from another agent chosen at random crossover h 1 with h 2 obtaining h’ 1, add h’ 1 to P S mutate: choose m percent of the members of P S with uniform probability and, for each, invert randomly one bit Lamarck: choose l p hypotheses from P S with uniform probability and apply to them the Lamarckian operator

14 How to mutate and tag memes zUse belief revison to tag memes zFollow the chain of logical steps forward, from assumptions (memes) to conclusions (predictions) zWhen predictions differ from experience (observation), follow the logical steps backward to those assumptions (memes) supporting the predictions zConfirm or mutate, and tag those memes

15 Simple revision example (1) P:flies(X)  bird(X), not ab(X).bird(a) . ab(X)  penguin(X). We learn penguin(a). P  {penguin(a)} is consistent. Nothing more to be done. We learn instead ¬flies(a). P  {¬flies(a)} is inconsistent. What to do? Since the inconsistency rests on the assumption not ab(a), remove that assumption (e.g. by adding the fact ab(a), or forcing it undefined with ab(a)  u) obtaining a new program P’. y If an assumption supports contradiction, then go back on that assumption.

16 Simple revision example (2) P:flies(X)  bird(X), not ab(X).bird(a) . ab(X)  penguin(X). y If an assumption supports contradiction, then go back on that assumption. If later we learn flies(a). P’  {flies(a)} is inconsistent. The contradiction does not depend on assumptions. Cannot remove contradiction! y Some programs are non-revisable.

17 What to remove? zWhich assumptions should be removed? normalWheel  not flatTyre, not brokenSpokes. flatTyre  leakyValve. ¬ normalWheel  wobblyWheel. flatTyre  puncturedTube. wobblyWheel .  Contradiction can be removed by either dropping not flatTyre or not brokenSpokes  We’d like to delve deeper in the model and (instead of not flatTyre ) either drop not leakyValve or not puncturedTube.

18 Revisables Revisables = not {leakyValve, punctureTube, brokenSpokes} Revisions in this case are {not lv}, {not pt}, and {not bs} zSolution: yDefine a set of revisables: normalWheel  not flatTyre, not brokenSpokes. flatTyre  leakyValve. ¬ normalWheel  wobblyWheel. flatTyre  puncturedTube. wobblyWheel .

19 Integrity Constraints zFor convenience, instead of: ¬ normalWheel  wobblyWheel we may use the denial:   normalWheel, wobblyWheel zCan further generalize ICs into: L 1  …  L n  L n+1  …  L m where L i s are literals (possibly not L).

20 ICs and Contradiction zIn an ELP with ICs, add for every atom A:   A, ¬A zA program P is contradictory iff P   where  is the paraconsistent derivation of SLX

21 Example Rev = not {a,b,c}   p, q p  not a. q  not b, r. r  not b. r  not c.  pq not arnot b not c Support sets are:{not a, not b}and {not a, not b, not c}. Removal sets are: {not a} and {not b}.

22 Example zIn 2-valued revision: ysome removals must be deleted; ythe process must be iterated.   p.   a.   b, not c. p  not a, not b.  a X p not a not b b not c X The only support is {not a, not b}. Removals are {not a} and {not b}. P U {a} is contradictory (and unrevisable). P U {b} is contradictory (though revisable). But:

23 Algorithm for 2-valued revision 1Let Revs={{}} 2For every element R of Revs: yAdd it to the program and compute removal sets. yRemove R from Revs yFor each removal set RS: yAdd R U not RS to Revs 3Remove non-minimal sets from Revs 4Repeat 2 and 3 until reaching a fixed point of Revs. zThe revisions are the elements of the final Revs.

24 Choose {b}. The removal set of P U {b} is {not c}. Add {b, c} to Rev. Choose {b,c}. The removal set of P U {b,c} is {}. Add {b, c} to Rev. Choose {}. Removal sets of P U {} are {not a} and {not b}. Add them to Rev. Example of 2-valued revision   p.   a.   b, not c. p  not a, not b. Rev 0 = {{}} Rev 1 = {{a}, {b}} Choose {a}. P U {a} has no removal sets. Rev 2 = {{b}} Rev 3 = {{b,c}} The fixed point had been reached. P U {b,c} is the only revision. = Rev 4

25 Revision and Diagnosis zIn model based diagnosis one has: ya program P with the model of a system (the correct and, possibly, incorrect behaviors) ya set of observations O inconsistent with P (or not explained by P). zThe diagnoses of the system are the revisions of P U O.

26 Diagnosis Example c1=0 c3=0 c6=0 c7=0 c2=0 0 1 g10 g11 g16 g19 g22 g23

27 Diagnosis Program Observables obs(out(inpt0, c1), 0). obs(out(inpt0, c2), 0). obs(out(inpt0, c3), 0). obs(out(inpt0, c6), 0). obs(out(inpt0, c7), 0). obs(out(nand, g22), 0). obs(out(nand, g23), 1). Predicted and observed values cannot be different  obs(out(G, N), V1), val(out(G, N), V2), V1  V2. Connections conn(in(nand, g10, 1), out(inpt0, c1)). conn(in(nand, g10, 2), out(inpt0, c3)). … conn(in(nand, g23, 1), out(nand, g16)). conn(in(nand, g23, 2), out(nand, g19)). Value propagation val( in(T,N,Nr), V )  conn( in(T,N,Nr), out(T2,N2) ), val( out(T2,N2), V ). val( out(inpt0, N), V )  obs( out(inpt0, N), V ). Normal behavior val( out(nand,N), V )  not ab(N), val( in(nand,N,1), W1), val( in(nand,N,2), W2), nand_table(W1,W2,V). Abnormal behavior val( out(nand,N), V )  ab(N), val( in(nand,N,1), W1), val( in(nand,N,2), W2), and_table(W1,W2,V). Run

28 Diagnosis Example c1=0 c3=0 c6=0 c7=0 c2=0 0 1 g10 g11 g16 g19 g22 g23 Revision are:{ab(g23)}, {ab(g19)}, and {ab(g16),ab(g22)}

29 Belief Revision zImportant functionality of agents. zProblem definition. Given yan extended logic program containing integrity constraints, i.e.:   B 1,…,B n, not C 1,…,not C m ya set of revisable literals, i.e., literals for which the revision is allowed. xThey must not have any definition zFind…

30 Belief Revision zFind: ya truth value for the revisable literals so that the program is not contradictory, i.e.,  does not belong to the model of the program

31 GAs for Belief Revision zGenetic Algorithms can be used for Belief Revision: yeach revisable is encoded with a meme ythe meme has value 1 if the revisable is true and 0 if it is false yeach set of assumptions about the values of revisables is coded as a chromosome

32 Fitness function zn i number of integrity constraints satisfied by hypothesis h i zn total number of integrity constraints

33 Example zDigital circuit diagnosis zRevisable literals indicate the assumed behaviour mode of each gate: ynot ab(gate) : gate behaves normally yab(gate): gate behaves abnormally

34 Example: circuit c17 g10 g11 g22 g16 g19 g23 g6 g1 g3 g2 g obs

35 Example: circuit c17 val( in(Type,Name,Nr), V ) :- conn( in(Type,Name,Nr), out(Type2,Name2) ), val( out(Type2,Name2), V ). val( out(nand,Name), V ) :- not ab(Name), val( in(nand,Name,1), W1), val( in(nand,Name,2), W2), nand_table(W1,W2,V). nand_table(0,0,1). …... val( out(nand,Name), V ) :- ab(Name), val( in(nand,Name,1), W1), val( in(nand,Name,2), W2), and_table(W1,W2,V). val( out(inpt0, Name), V ) :- obs( out(inpt0, Name), V ).

36 Topology conn(in(nand, g10, 1), out(inpt0, g1)). conn(in(nand, g10, 2), out(inpt0, g3)). conn(in(nand, g11, 1), out(inpt0, g3)). conn(in(nand, g11, 2), out(inpt0, g6)). conn(in(nand, g16, 1), out(inpt0, g2)). conn(in(nand, g16, 2), out(nand, g11)). conn(in(nand, g19, 1), out(nand, g11)). conn(in(nand, g19, 2), out(inpt0, g7)). conn(in(nand, g22, 1), out(nand, g10)). conn(in(nand, g22, 2), out(nand, g16)). conn(in(nand, g23, 1), out(nand, g16)). conn(in(nand, g23, 2), out(nand, g19)).

37 Observations and constraints  :- obs(out(nand, g22), 0), val(out(nand, g22), 1).  :- obs(out(nand, g22), 1), val(out(nand, g22), 0).  :- obs(out(nand, g23), 0), val(out(nand, g23), 1).  :- obs(out(nand, g23), 1), val(out(nand, g23), 0). obs(out(inpt0, g1), 0). obs(out(inpt0, g2), 1). obs(out(inpt0, g3), 0). obs(out(inpt0, g6), 0). obs(out(inpt0, g7), 0). obs(out(nand, g22), 0). obs(out(nand, g23), 1).

38 Diagnosis One of the integrity constraints is violated: ythe observed output for g22 is different from the computed output. Contradiction is removed by assuming yab(g22) which is a diagnosis for the circuit.

39 Belief Revision zSupport Set: a support set of a literal L of a program P, denoted by SS(L), is a set of revisables sufficient to support a derivation of L in P

40 Belief Revision zHitting set: a hitting set of for a collection of SS(L) is the union of one non-empty subset from each SS(L). It is minimal iff no proper subset is a hitting set. zA contradiction removal set is a hitting set for the SS(  ).

41 Lamarckian operator zThe Lamarckian operator uses techniques similar to BR ones. zIt differs from BR because it starts from an arbitrary chromosome C zThe Lamarckian support sets are all the support sets that are subsets of the current chromosome C

42 Lamarckian operator zfind all the Lamarckian support sets for  with respect to C zfind a hitting set HS(  ) for them zchange in C all its literals which are in HS(  ).

43 Example: circuit c17 zSuppose, initially: yC={ab(g10), not ab(g11), ab(g16), not ab(g19), not ab(g22), not ab(g23)} zIn this case, two constraints are violated because out(g22)=1 and out(g23)=0

44 Example: circuit c17 zA BR operator would return as changes to C: y{not ab(g10), not ab(g11), not ab(g16), not ab(g19), ab(g22), not ab(g23)} ythese are consistent with both ICs

45 Example: circuit c17 zLamarckian support sets of  : y[not ab(g11),not ab(g19),not ab(g11),ab(g16),not ab(g23)] y[not ab(g11),ab(g16),ab(g10),not ab(g22)] zLamarck returns these changes to C, one for each hitting set: yC={ab(g10), ab(g11), ab(g16), not ab(g19), not ab(g22), not ab(g23)} yC={ab(g10), not ab(g11), not ab(g16), not ab(g19), not ab(g22), not ab(g23)} yone constraint in either case is still violated

46 Experiments yISCAS85 collection of benchmark digital circuits yFour algorithms considered: S-L: single agent GA without the Lamarckian operator M-L: as S-L but multi agent M+L-A: as M-L plus Lamarck, without asymmetry M+L+A: as M+L-A plus asymmetry

47 Results  alu4_flat circuit y100 gates (100 revisables) y8 outputs (16 constraints) y4 agents, with same observations and constraints y10 chromosomes each, l=0.6 y5 experiments zAverage fitness:

48 Conclusions zFramework for solving problems represented with logic: ybelief revision ydynamic world, control of observable outputs zPerformance improvement by ydistributed agents yLamarckian operator yasymmetric crossover on memes

49 Future work zSituations where: yagents do not have the same observations, constraints or revisables yobservations change over time zThree-valued memes for expressing irrelevancy zIntegrating Lamarckism with other agent features

50 THE END

[ab(c11gat),ab(c19gat),ab(c11gat),ab(c16gat),ab(c23gat)], [not ab(c11gat),ab(c19gat),ab(c11gat),ab(c16gat),ab(c23gat)], [ab(c11gat),not ab(c19gat),ab(c11gat),ab(c16gat),ab(c23gat)], [not ab(c11gat),not ab(c19gat),ab(c11gat),ab(c16gat),ab(c23gat)], [ab(c11gat),ab(c19gat),not ab(c11gat),ab(c16gat),ab(c23gat)], [not ab(c11gat),ab(c19gat),not ab(c11gat),ab(c16gat),ab(c23gat)], [ab(c11gat),ab(c19gat),ab(c11gat),not ab(c16gat),ab(c23gat)], [not ab(c11gat),ab(c19gat),ab(c11gat),not ab(c16gat),ab(c23gat)], [ab(c11gat),ab(c19gat),not ab(c11gat),not ab(c16gat),ab(c23gat)], [not ab(c11gat),ab(c19gat),not ab(c11gat),not ab(c16gat),ab(c23gat)], [ab(c11gat),not ab(c19gat),not ab(c11gat),not ab(c16gat),ab(c23gat)], [not ab(c11gat),not ab(c19gat),not ab(c11gat),not ab(c16gat),ab(c23gat)], [ab(c11gat),not ab(c19gat),not ab(c11gat),ab(c16gat),not ab(c23gat)], [not ab(c11gat),not ab(c19gat),not ab(c11gat),ab(c16gat),not ab(c23gat)], [ab(c11gat),not ab(c19gat),ab(c11gat),not ab(c16gat),not ab(c23gat)], [not ab(c11gat),not ab(c19gat),ab(c11gat),not ab(c16gat),not ab(c23gat)], [not ab(c11gat),ab(c16gat),not ab(c10gat),ab(c22gat)], [ab(c11gat),not ab(c16gat),not ab(c10gat),ab(c22gat)], [ab(c11gat),ab(c16gat),ab(c10gat),not ab(c22gat)], [not ab(c11gat),ab(c16gat),ab(c10gat),not ab(c22gat)], [ab(c11gat),not ab(c16gat),ab(c10gat),not ab(c22gat)], [not ab(c11gat),not ab(c16gat),ab(c10gat),not ab(c22gat)], [ab(c11gat),ab(c16gat),not ab(c10gat),not ab(c22gat)], [not ab(c11gat),not ab(c16gat),not ab(c10gat),not ab(c22gat)]

52 Belief Revision zSupport Set: a support set of a literal L of a program P, denoted by SS(L), is obtained as follows:  if L is not a revisable literal, then, for each rule L  B in P, there is one SS(L) given by the union of SS(B i ) for each B i  B. If B is empty then SS(L)={} yif L is a revisable literal then SS(L)={L}

53 Lamarckian operator Lamarckian support set: given an hypothesis C, a Lamarckian support set of a literal L of a program P, denoted by SS(L), is obtained as follows: if L is not a revisable literal, then, for each rule L  B in P there is one SS(L) given by the union of SS(Bi) for each Bi  B. If B is empty then SS(L)={} if L is a revisable literal then if L belongs to C, then SS(L)={L} if L is not in C or the default complement belongs to C then the SS(L) under construction is not a support set

54 Results, single agent zSingle agent, with and without the Lamarckian operator zFitness function: xf i number of revisables of h i that are false

55 Logic Programs Revision zThe problem: yA LP represents consistent incomplete knowledge; yNew factual information comes. yHow to incorporate the new information? z The solution: yAdd the new facts to the program yIf the union is consistent this is the result yOtherwise restore consistency to the union zThe new problem: yHow to restore consistency to an inconsistent program?

56 Algorithm for 3-valued revision zFind all derivations for , collecting for each one the set of revisables supporting it. Each is a support set. zCompute the minimal hitting sets of the support sets. Each is a removal set. zA revision of P is obtained by adding {A  u: A  R} where R is a removal set of P.

57 2-valued Revision zIn diagnosis one often wants the IC: ab(X) v not ab(X)  yWith these ICs (that are not denials), 3- valued revision is not enough. zA two valued revision is obtained by adding facts for revisables, in order to remove contradiction. zFor 2-valued revision the algorithm no longer works…

58 Simple diagnosis example inv(G,I,0)  node(I,1), not ab(G). inv(G,I,1)  node(I,0), not ab(G). node(b,V)  inv(g1,a,V). node(a,1). ¬node(b,0). %Fault model inv(G,I,0)  node(I,0), ab(G). inv(G,I,1)  node(I,1), ab(G). a=1 b0b0 g1 The only revision is: P U {ab(g1)  u} It does not conclude node(b,1). zIn diagnosis applications (when fault models are considered) 3-valued revision is not enough.

59 Abduction as Revision zFor abductive queries: yDeclare as revisable all the abducibles yIf the abductive query is Q, add the IC:   not Q yThe revision of the program are the abductive solutions of Q.

60 Revision and Debugging zDeclarative debugging can be seen as diagnosis of a program. zThe components are: yrule instances (that may be incorrect). ypredicate instances (that may be uncovered) zThe (partial) intended meaning can be added as ICs. zIf the program with ICs is contradictory, revisions are the possible bugs.

61 Debugging Transformation zAdd to the body of each possibly incorrect rule r(X) the literal not incorrect(r(X)). zFor each possibly uncovered predicate p(X) add the rule: p(X)  uncovered(p(X)). zFor each goal G that you don’t want to prove add:   G. zFor each goal G that you want to prove add:   not G.

62 Debugging example a  not b b  not c WFM = {not a, b, not c} b should be false a  not b, not incorrect(a  not b) b  not c, not incorrect(b  not c) a  uncovered(a) b  uncovered(b) c  uncovered(c)   b Revisables are incorrect/1 and uncovered/1 Revision is: {incorrect(b  not c)} {uncovered(c)} BUT a should be false! Add   a Revisions now are: {inc(b  not c), inc(a  not b)} {unc(c ), inc(a  not b)} BUT c should be true! Add   not c The only revision is: {unc(c ), inc(a  not b)}