1 logic aided lamarckian evolution evelina lamma (1), fabrizio riguzzi (2), luís moniz pereira (3)...
Post on 18-Dec-2015
216 views
TRANSCRIPT
![Page 1: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/1.jpg)
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
![Page 2: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/2.jpg)
2
Summary
Genetic algorithms Lamarckian operator Multi-agent genetic algorithms Genes and Memes Multi-agent Crossover Belief revision Evolutionary approach to belief revision Example Experiments Conclusions
![Page 3: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/3.jpg)
3
Genetic Algorithms
Darwinian operators: selection mutation crossover
![Page 4: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/4.jpg)
4
Lamarckian operator
Given a chromosome: express it as a phenotype modify the phenotype in order to
improve its fitness translate back the phenotype into a
genotypeModel of cultural evolutionConcept of “meme”
![Page 5: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/5.jpg)
5
GA in Multi Agent Systems (MAS)
MAS: communication of knowledge by means of explicit messages
New: communication of knowledge by exchange of genes and memes
If 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
![Page 6: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/6.jpg)
6
Genetic Operators
Crossover: used in order to exchange genes and memes among agents a chromosome in an agent is crossed
with chromosomes from other agents
Lamarckian operator: used to locally improve the fitness by experience-directed self-mutation
![Page 7: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/7.jpg)
7
Genes and Memes
Genes are modified only by Darwinian operators individual “physical” features are fixed inherited irrespective of parental learning
Memes are modified by Darwinian and Lamarckian operators individual “cultural” features are changeable inherited via parental learning
![Page 8: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/8.jpg)
8
Asymmetrical flow of memes
Memes only go from teacher to learnerIn crossover:
genes are copied from both parents
memes 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.
![Page 9: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/9.jpg)
9
Multi-agent crossover
A new agent offspring is produced from two parent chromosomes one parent comes from the pool of another agent bits from each parent are copied according to a
mask
The mask is such that: genes are selected randomly, half from each parent memes are selected randomly, half from memes in
the other agent, but only if they have been accessed
![Page 10: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/10.jpg)
10
Multiagent crossover
1 0 0 0 1 1 1
0 1 1 1
0 1 0 1 1 1 0
1 1 0 0
1 1 0 0 1 1 0
0 1 0 0 1 1 1
0 0 0 0
Mask
1 – take from Ag1
0 – take from Ag2
Ag1
tags
Ag2
tags
child in Ag1pool
genesmemes
![Page 11: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/11.jpg)
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(hi)
![Page 12: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/12.jpg)
12
Genetic algorithm
GA(max_gen, p, r ,m, l, Fitness)Initialize population P := set of p hypotheses randomly
generatedgen :=0while gen <= max_gen
Generate PS by applying the following operators to P :
selectioncrossovermutationLamarck
update: P := PS
return the hypothesis from PS with the highest fitness
![Page 13: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/13.jpg)
13
Genetic operators
select: select (1- r) p hypotheses from P with a probability Pb proportional to their fitness and add them to PS
crossover: for i:=1 to r pselect h1 from P with probability Pb
select h2 from another agent chosen at random
crossover h1 with h2 obtaining h’1, add h’1 to PS
mutate: choose m percent of the members of PS with uniform probability
and, for each, invert randomly one bit
Lamarck: choose l p hypotheses from PS with uniform probability and apply to them the Lamarckian operator
![Page 14: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/14.jpg)
14
How to mutate and tag memes
Use belief revison to tag memes
Follow the chain of logical steps forward, from assumptions (memes) to conclusions (predictions)
When predictions differ from experience (observation), follow the logical steps backward to those assumptions (memes) supporting the predictions
Confirm or mutate, and tag those memes
![Page 15: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/15.jpg)
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’.
If an assumption supports contradiction, then go back on that assumption.
![Page 16: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/16.jpg)
16
Simple revision example (2)P: flies(X) bird(X), not ab(X). bird(a) .
ab(X) penguin(X).
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!
Some programs are non-revisable.
![Page 17: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/17.jpg)
17
What to remove?
Which 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.
![Page 18: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/18.jpg)
18
Revisables
Revisables = not {leakyValve, punctureTube, brokenSpokes}
Revisions in this case are {not lv}, {not pt}, and {not bs}
Solution: Define a set of revisables:
normalWheel not flatTyre, not brokenSpokes.
flatTyre leakyValve. ¬normalWheel wobblyWheel.
flatTyre puncturedTube. wobblyWheel .
![Page 19: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/19.jpg)
19
Integrity Constraints
For convenience, instead of:¬normalWheel wobblyWheel
we may use the denial: normalWheel, wobblyWheel
Can further generalize ICs into:L1 … Ln Ln+1 … Lm
where Lis are literals (possibly not L).
![Page 20: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/20.jpg)
20
ICs and Contradiction
In an ELP with ICs, add for every atom A: A, ¬A
A program P is contradictory iff P
where is the paraconsistent derivation of SLX
![Page 21: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/21.jpg)
21
ExampleRev = not {a,b,c}
p, q
p not a.
q not b, r.
r not b.
r not c.
p q
not a r not b
not 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}.
![Page 22: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/22.jpg)
22
Example
In 2-valued revision: some removals must be deleted; the process must be iterated.
p. a. b, not c.p not a, not b.
a
X
p
not a not bb not c
XThe 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:
![Page 23: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/23.jpg)
23
Algorithm for 2-valued revision
1 Let Revs={{}}2 For every element R of Revs:
Add it to the program and compute removal sets. Remove R from Revs For each removal set RS:
Add R U not RS to Revs3 Remove non-minimal sets from Revs4 Repeat 2 and 3 until reaching a fixed point of Revs. The revisions are the elements of the final Revs.
![Page 24: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/24.jpg)
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.
Rev0 = {{}}
Rev1 = {{a}, {b}}
• Choose {a}. P U {a} has no removal sets.
Rev2 = {{b}}
Rev3 = {{b,c}}
•The fixed point had been reached. P U {b,c} is the only revision.
= Rev4
![Page 25: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/25.jpg)
25
Revision and Diagnosis
In model based diagnosis one has: a program P with the model of a system
(the correct and, possibly, incorrect behaviors)
a set of observations O inconsistent with P (or not explained by P).
The diagnoses of the system are the revisions of P U O.
![Page 26: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/26.jpg)
26
Diagnosis Example
1
1
1
10
c1=0
c3=0
c6=0
c7=0
c2=0
0
1
g10
g11
g16
g19
g22
g23
![Page 27: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/27.jpg)
27
Diagnosis Program Observablesobs(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.
Connectionsconn(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 propagationval( 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 behaviorval( 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 behaviorval( out(nand,N), V ) ab(N), val( in(nand,N,1), W1), val( in(nand,N,2), W2),
and_table(W1,W2,V).
Run
![Page 28: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/28.jpg)
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)}
1
1
1
1 1
0
1
1
0
1 1
0
1
1
1
0 1
0
![Page 29: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/29.jpg)
29
Belief Revision
Important functionality of agents.Problem definition. Given
an extended logic program containing integrity constraints, i.e.:
B1,…,Bn, not C1,…,not Cm
a set of revisable literals, i.e., literals for which the revision is allowed. They must not have any definition
Find…
![Page 30: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/30.jpg)
30
Belief Revision
Find: a truth value for the revisable literals so
that the program is not contradictory, i.e., does not belong to the model of the program
![Page 31: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/31.jpg)
31
GAs for Belief Revision
Genetic Algorithms can be used for Belief Revision: each revisable is encoded with a
meme the meme has value 1 if the revisable
is true and 0 if it is false each set of assumptions about the
values of revisables is coded as a chromosome
![Page 32: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/32.jpg)
32
Fitness function
ni number of integrity constraints satisfied by hypothesis hi
n total number of integrity constraints
n
nhF i
i )(
![Page 33: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/33.jpg)
33
Example
Digital circuit diagnosis
Revisable literals indicate the assumed behaviour mode of each gate:
not ab(gate) : gate behaves normally ab(gate): gate behaves abnormally
![Page 34: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/34.jpg)
34
Example: circuit c17
g10
g11
g22
g16
g19g23
g6
g1
g3
g2
g7
0
0
0
1
0
0
1
1
1
0
11
1
obs
obs
![Page 35: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/35.jpg)
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 ).
![Page 36: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/36.jpg)
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)).
![Page 37: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/37.jpg)
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).
![Page 38: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/38.jpg)
38
Diagnosis
One of the integrity constraints is violated: the observed output for g22 is
different from the computed output.
Contradiction is removed by assuming ab(g22)
which is a diagnosis for the circuit.
![Page 39: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/39.jpg)
39
Belief Revision
Support 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
![Page 40: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/40.jpg)
40
Belief Revision
Hitting 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.
A contradiction removal set is a hitting set for the SS().
![Page 41: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/41.jpg)
41
Lamarckian operator
The Lamarckian operator uses techniques similar to BR ones.
It differs from BR because it starts from an arbitrary chromosome C
The Lamarckian support sets are all the support sets that are subsets of the current chromosome C
![Page 42: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/42.jpg)
42
Lamarckian operator
find all the Lamarckian support sets for with respect to C
find a hitting set HS() for themchange in C all its literals which are
in HS().
![Page 43: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/43.jpg)
43
Example: circuit c17
Suppose, initially: C={ab(g10), not ab(g11), ab(g16),
not ab(g19), not ab(g22), not ab(g23)}In this case, two constraints are
violated because out(g22)=1 and out(g23)=0
![Page 44: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/44.jpg)
44
Example: circuit c17
A BR operator would return as changes to C: {not ab(g10), not ab(g11),
not ab(g16), not ab(g19), ab(g22), not ab(g23)}
these are consistent with both ICs
![Page 45: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/45.jpg)
45
Example: circuit c17
Lamarckian support sets of : [not ab(g11),not ab(g19),not ab(g11),ab(g16),not ab(g23)] [not ab(g11),ab(g16),ab(g10),not ab(g22)]
Lamarck returns these changes to C, one for each hitting set: C={ab(g10), ab(g11), ab(g16),
not ab(g19), not ab(g22), not ab(g23)} C={ab(g10), not ab(g11), not ab(g16),
not ab(g19), not ab(g22), not ab(g23)} one constraint in either case is still violated
![Page 46: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/46.jpg)
46
Experiments
ISCAS85 collection of benchmark digital circuits
Four algorithms considered:S-L: single agent GA without the
Lamarckian operatorM-L: as S-L but multi agentM+L-A: as M-L plus Lamarck, without
asymmetryM+L+A: as M+L-A plus asymmetry
![Page 47: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/47.jpg)
47
Results
alu4_flat circuit 100 gates (100 revisables) 8 outputs (16 constraints) 4 agents, with same observations and
constraints 10 chromosomes each, l=0.6 5 experiments
Average fitness:
S-L M-L M+L-A M+L+A
Fitness 0.8958 0.9375 0.9583 0.9791
![Page 48: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/48.jpg)
48
Conclusions
Framework for solving problems represented with logic: belief revision dynamic world, control of observable outputs
Performance improvement by distributed agents Lamarckian operator asymmetric crossover on memes
![Page 49: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/49.jpg)
49
Future work
Situations where: agents do not have the same observations,
constraints or revisables observations change over time
Three-valued memes for expressing irrelevancy
Integrating Lamarckism with other agent features
![Page 50: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/50.jpg)
50
THE END
![Page 51: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/51.jpg)
[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)]
![Page 52: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/52.jpg)
52
Belief Revision
Support 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(Bi) for each Bi B. If B is empty then SS(L)={}
if L is a revisable literal then SS(L)={L}
![Page 53: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/53.jpg)
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
![Page 54: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/54.jpg)
54
Results, single agent
Single agent, with and without the Lamarckian operator
Fitness function:
fi number of revisables of hi that are false
5.0)( i
iii h
f
n
nhF
Circuit l Fitness Correct solution0 1.175 100%voter
0.6 1.218 100%
0 1.296 0%alu4_flat
0.6 1.310 30%
![Page 55: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/55.jpg)
55
Logic Programs RevisionThe problem:
A LP represents consistent incomplete knowledge;
New factual information comes.
How to incorporate the new information?
The solution: Add the new facts to
the program If the union is
consistent this is the result
Otherwise restore consistency to the union
The new problem: How to restore consistency to an
inconsistent program?
![Page 56: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/56.jpg)
56
Algorithm for 3-valued revision
Find all derivations for , collecting for each one the set of revisables supporting it. Each is a support set.
Compute the minimal hitting sets of the support sets. Each is a removal set.
A revision of P is obtained by adding{A u: A R}
where R is a removal set of P.
![Page 57: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/57.jpg)
57
2-valued Revision
In diagnosis one often wants the IC:ab(X) v not ab(X)
With these ICs (that are not denials), 3-valued revision is not enough.
A two valued revision is obtained by adding facts for revisables, in order to remove contradiction.
For 2-valued revision the algorithm no longer works…
![Page 58: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/58.jpg)
58
Simple diagnosis exampleinv(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 modelinv(G,I,0) node(I,0), ab(G).inv(G,I,1) node(I,1), ab(G).
a=1 b0g1
The only revision is:P U {ab(g1) u}
It does not conclude node(b,1).
In diagnosis applications (when fault models are considered) 3-valued revision is not enough.
![Page 59: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/59.jpg)
59
Abduction as Revision
For abductive queries:
Declare as revisable all the abducibles If the abductive query is Q, add the IC:
not Q The revision of the program are the
abductive solutions of Q.
![Page 60: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/60.jpg)
60
Revision and Debugging
Declarative debugging can be seen as diagnosis of a program.
The components are: rule instances (that may be incorrect). predicate instances (that may be uncovered)
The (partial) intended meaning can be added as ICs.
If the program with ICs is contradictory, revisions are the possible bugs.
![Page 61: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/61.jpg)
61
Debugging Transformation
Add to the body of each possibly incorrect rule r(X) the literal not incorrect(r(X)).
For each possibly uncovered predicate p(X) add the rule:
p(X) uncovered(p(X)).
For each goal G that you don’t want to prove add: G.
For each goal G that you want to prove add: not G.
![Page 62: 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](https://reader036.vdocuments.us/reader036/viewer/2022062515/56649d255503460f949fb52c/html5/thumbnails/62.jpg)
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) bRevisables 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)}