HDTP Presentation_09_print

HDTP
Heuristic-Driven Theory Projection
Ulf Krumnack
Angela Schwering
[email protected]
[email protected]
October 2006
Outlook
Introduction
Theory
Anti-Unification
Semantics
HDTP
Algorithm illustrated with Rutherford Example
Heat Flow Example
Conclusions
1
Introduction
Idea: Analogy as an abstraction process
analogy = common structure in different domains
domains = instances of more general principle
Example: Rutherford Analogy:
solar system and Rutherford’s atom can be seen as a
central force system:
they consist of a massive object which attracts a
lightweight object
this causes the lightweight object to revolve around the
heavier
2
generalization:
central force system
generalized
axioms
generalized theory
source:
solar system
target:
Rutherford atom
axioms
axioms
theory
theory
generalization:
central force system
generalized
axioms
generalized theory
instances of more general theory
source:
solar system
target:
Rutherford atom
analogical
axioms
theory
relation R
axioms
theory
3
Theory
Unification and Anti-Unification
Unification
make terms equal via appropriate variable assignment
find the most general unifier
p(X)
p(a)
Θ = {X←
←a}
p(a)
p(f(X),Y,g(Y))
p(f(X),Z,g(X))
Θ = {Y←
←X, Z ← X}
p(f(X),X,g(X))
Anti-Unification is the dual construction
4
Anti-Unification
Anti-Unification
introduced by Plotkin in context of inductive learning
syntactical operation defined on a formal term language
constructs more general terms for given input terms
input terms t1 and t2,
generalized term t
substitutions Θ1 and Θ2
t1
t
= tΘ
Θ1 and t2 = tΘ
Θ2
Θ1
Θ2
t1
t2
Anti-Unification
Task:
least general generalizations of laws / facts for target and source
• Plotkin’s anti-unification
• unique lgg
• most specific anti-instance
exists always
• finitely many anti-instances
generalization: f(a,X)
{X←c}
source: f(a,c)
{X←b}
target: f(a,b)
5
Anti-Unification
Task:
most specific generalizations of laws / facts for target and source
generalization:
X
{X←f(a,b)}
source: f(a,b)
{X←g(a,b)}
target: g(a,b)
Anti-Unification
Task:
most specific generalizations of laws / facts for target and source
• second-order anti-unification
generalization: F(a,b)
{F←g}
source: g(a,b)
{F←f}
target: f(a,b)
6
Anti-Unification
Task:
most specific generalizations of laws / facts for target and source
• second-order anti-unification
• several generalizations possible
F(h(X,Y)) {
F←
g,X
←
a,Y
{F←f,X←
←c,Y←
←h(a,b)}
source: f(h(c,h(a,b) ) )
←b
}
target: g( h(a,b) )
Anti-Unification
Task:
most specific generalizations of laws / facts for target and source
• second-order anti-unification
• several generalizations possible
F(h(X,Y))
{F
c
(h(
y.(f
λ
←
source: f(h(c,h(a,b) ) )
)}
,y))
F(h(a,b))
{F←g}
target: g( h(a,b) )
7
2nd Order Substitutions
Restriction:
anti-instances always structurally simpler
Types:
permutation
F(x1, … , xn) → f(xσ(1), … , xσ(n))
F(a,b)
{F←f}
{F←λa,b.(g(b,a)}
f(a,b)
g(b,a)
with this restriction we get only finitely many least
general generalizations
2nd Order Substitutions
Restriction:
anti-instances always structurally simpler
Types:
permutation
flattening
F(x) → f(g(x))
F(a)
{F←f}
{F←λ x.f(g(x))}
f(a)
f(g(a))
with this restriction we get only finitely many least
general generalizations
8
2nd Order Substitutions
Restriction:
anti-instances always structurally simpler
Types:
permutation
flattening
drop argument
F(x1, … , xn) → f(x1, a, b, … , xn)
F(a)
{F←f}
{F←λ x.g(x,b)}
f(a)
g(a,b)
with this restriction we get only finitely many least
general generalizations
Semantics
induced semantic
relation R*
interpretation
interpretation
source
target
syntactic analogical
axioms
theory
relation R
axioms
theory
9
general force
system
interpretation
interpretation
generalized
axioms
source
target
generalized theory
axioms
axioms
theory
theory
HDTP
Illustration with the Rutherford Example
10
Essential Ideas of HDTP
Language
HDTP is based on a many-sorted logical language as first-order
predicate logic or Horn logic
What is HDTP doing?
Input
Partially defined theories of source domain and target domain
Process
HDTP is identifying terms, predicates, formulas and rules from
source and target
Additionally formulas are transferred from the source to the target in
the case they are not associated yet
These can be generalized using an extension of anti-unification
Output
A generalized theory
HDTP – Rutherford
nucleus
> mass
coloumb
distance
entity
fact
law
electron
11
HDTP – The Process
1.
definition of source and target
types, entities, functions, facts
types:
object, real
entities: object: sun, object: planet
function: mass: object → real x {kg}
dist: object x object → real x {m}
gravity: object x object → real x {N}
fact:
mass(sun) > mass(planet)
dist(sun, planet) > 0
gravity(sun, planet) > 0
HDTP – Rutherford
source
target
dist(sun, planet) > 0
dist(nucleus, electron) > 0
mass(sun) > mass(planet)
mass(nucleus) > mass(electron)
gravity(sun, planet) > 0
coloumb(nucleus, electron) > 0
12
HDTP – The Process
1.
definition of source and target
types, entities, functions, facts
2.
3.
description of background knowledge
anti-unification
find pairs of axioms that can be anti-unified
notice: many different possible heuristics
start with the target domain
anti-unify these pairs and test
if fail, anti-unify again
else add the anti-instance to generalized theory
HDTP – Rutherford
generalized theory
dist( X, Y) > 0
mass( X ) > mass( Y )
F(X,Y)>0
heuristic:
• selection of axioms
in target theory
• evaluation of antiinstances
target
source
dist(sun, planet) > 0
dist(electron, nucleus) > 0
mass(sun) > mass(planet)
mass(nucleus) > mass(electron)
gravity(sun, planet) > 0
coloumb(nucleus, electron) > 0
background
dist(x, y) = dist(y, x)
13
HDTP – Rutherford
generalized theory
dist( X, Y) > 0
mass( X ) > mass( Y )
F(X,Y)>0
heuristic:
• selection of axioms
in target theory
• evaluation of antiinstances
target
source
dist(sun, planet) > 0
dist(electron, nucleus) > 0
mass(sun) > mass(planet)
mass(nucleus) > mass(electron)
gravity(sun, planet) > 0
coloumb(nucleus, electron) > 0
background
dist(x, y) = dist(y, x)
HDTP – Rutherford
generalized theory
dist( X, Y) > 0
mass( X ) > mass( Y )
F(X,Y)>0
heuristic:
• selection of axioms
in target theory
• evaluation of antiinstances
target
source
dist(sun, planet) > 0
dist(electron, nucleus) > 0
mass(sun) > mass(planet)
mass(nucleus) > mass(electron)
gravity(sun, planet) > 0
coloumb(nucleus, electron) > 0
background
dist(x, y) = dist(y, x)
14
HDTP – Rutherford
generalized theory
dist( X, Y) > 0
mass( X ) > mass( Y )
F(X,Y)>0
heuristic:
• selection of axioms
in target theory
• evaluation of antiinstances
anti-unification of theories !!!
source
target
dist(sun, planet) > 0
dist(electron, nucleus) > 0
mass(sun) > mass(planet)
mass(nucleus) > mass(electron)
gravity(sun, planet) > 0
coloumb(nucleus, electron) > 0
background
dist(x, y) = dist(y, x)
HDTP – The Process
1.
definition of source and target
2.
3.
4.
types, entities, functions, facts, laws
description of background knowledge
anti-unification
transfer knowledge from source
transfer remaining axioms in source to target
governed by the anti-instances added so far
test new axioms via
consistency checking with existing knowledge in target
consistency checking with background knowledge
experiments (oracle)
if they fail: cancel the axiom
else test another one
15
HDTP – Rutherford
types:
object, real
entities: object: sun, object: planet
function: mass:
object → real x {kg}
dist:
object x object → real x {m}
gravity:
object x object → real x {N}
centrifugal: object x object → real x {N}
fact:
source richer
than target
mass(sun) > mass(planet)
dist(sun, planet) > 0
gravity(sun, planet) > 0
revolves_around(planet, sun)
∀ o1: object, o2: object :
dist(o1, o2) > 0 ∧ gravity(o1, o2) > 0 →
∃ force : force(o1, o2) < 0 ∧ force(o1, o2) = centrifugal(o1, o2)
laws:
∀ o1: object, o2: object :
dist(o1, o2) > 0 ∧ centrifugal(o1, o2) < 0 →
revolves around(o1, o2)
HDTP – Rutherford
dist( X, Y) > 0
mass( X ) > mass( Y )
F(X,Y)>0
Law 1 in Source:
∀o1: object, o2: object :
dist(o1, o2) > 0 ∧ gravity(o1, o2) > 0 →
∃ force : force(o1, o2) < 0 ∧ force(o1, o2) = centrifugal(o1, o2)
dist(sun, planet) > 0
dist(electron, nucleus) > 0
mass(sun) > mass(planet)
mass(nucleus) > mass(electron)
gravity(sun, planet) > 0
coloumb(nucleus, electron) > 0
background
dist(x, y) = dist(y, x)
16
HDTP – Rutherford
dist( X, Y) > 0
mass( X ) > mass( Y )
F(X,Y)>0
∃ force : force(o1, o2) < 0 ∧ force(o1, o2) = centrifugal(o1, o2)
dist(sun, planet) > 0
dist(electron, nucleus) > 0
mass(sun) > mass(planet)
mass(nucleus) > mass(electron)
gravity(sun, planet) > 0
coloumb(nucleus, electron) > 0
background
dist(x, y) = dist(y, x)
HDTP – Rutherford
dist( X, Y) > 0
mass( X ) > mass( Y )
F(X,Y)>0
centrifugal ( X, Y)
Law 2 in Source:
∀o1: object, o2: object :
dist(o1, o2) > 0 ∧ centrifugal(o1, o2) < 0 →
revolves around(o1, o2)
dist(sun, planet) > 0
dist(electron, nucleus) > 0
mass(sun) > mass(planet)
mass(nucleus) > mass(electron)
gravity(sun, planet) > 0
coloumb(nucleus, electron) > 0
centrifugal(sun, planet) < 0
centrifugal(nucleus, electron) < 0
background
dist(x, y) = dist(y, x)
17
HDTP – Rutherford
dist( X, Y) > 0
mass( X ) > mass( Y )
F(X,Y)>0
centrifugal ( X, Y)
oracle:
generate
experiments
revolves around(o1, o2)
dist(sun, planet) > 0
dist(electron, nucleus) > 0
mass(sun) > mass(planet)
mass(nucleus) > mass(electron)
gravity(sun, planet) > 0
coloumb(nucleus, electron) > 0
centrifugal(sun, planet) < 0
centrifugal(nucleus, electron) < 0
consistency !!!
background
dist(x, y) = dist(y, x)
HDTP – The Analogical Transfer
Source
Target
Anti-Instance
mass(s) > mass(p)
mass(n) > mass(e)
mass(X) > mass(Y)
revolves_around(p,s)
revolves_around(e,n)
revolves_around(Y,X)
gravity(p,s) > 0
coloumb(e,n) > 0
F(X,Y) > 0
dist(s,p) > 0
dist(n,e) > 0
dist(X,Y) > 0
The corresponding substitutions are:
Θ1/Θ2 :
X → planet / electron
Y → sun / nucleus
F → gravity / coloumb
Notice: We need to transfer certain laws and facts from source to
target domain
18
HDTP – The Analogical Transfer
Transferred Laws:
∀ o1: object, o2: object :
dist(o1, o2) > 0 ∧ coloumb(o1, o2) > 0 →
∃ force : force(o1, o2) < 0 ∧ force(o1, o2) = centrifugal(o1, o2)
∀ o1: object, o2: object :
dist(o1, o2) > 0 ∧ centrifugal(o1, o2) < 0 →
revolves around(o1, o2)
Facts we can now derive:
revolves_around(electron, nucleus)
HDTP
The Heat-Flow Example
19
Water Flow – Heat Flow
Water Flow – Heat Flow
water system (source):
sorts
real, massterm, object, time
entities:
vial: object
beaker: object
water: massterm
pipe: object
functions: height: object × time → real × {cm}
footprint: object × time → real × {cm2}
in:
object × massterm → object
volume: object × time → real × {cm3}
functional definitions:
volume(x,t) := footprint(x,t) ⋅ height(x,t)
20
The Representation of an Example
water system (source):
facts
connected(beaker,vial,pipe)
liquid(water)
∀ t1:time, t2: time:
footprint(beaker, t1) > footprint(vial, t1) ∧
footprint(beaker, t1) = footprint(beaker, t2) ∧
footprint(vial, t1) = footprint(vial, t2)
laws
∀t1:time, t2: time: t2 > t1 ∧
height( in(water, beaker, t1)) > height( in(water, vial, t1))
→
height( in(water, beaker, t1)) > height( in(water, beaker, t2)) ∧
volume( in(water, beaker, t1)) – volume( in(water, beaker, t2))
= volume( in(water, vial, t2)) – volume( in(water, vial, t1))
Water Flow – Heat Flow
heat flow (target):
sortes
real, massterm, object, time
entities:
coffee: massterm
cup: object
b_cube: object
bar: object
functions: observ_temp: object × time → real × {C}
operator in: object × massterm → object
facts
connected( in(coffee, cup),b_cube,bar)
liquid(coffee)
experiment ∀t1:time, t2: time: t2 > t1 ∧
temp( in(coffee, cup, t1)) > temp(b_cube, t1)
→ temp( in(coffee, cup, t2)) < temp( in(coffee, cup, t1)) ∧
temp(b_cube, t2) > temp(b_cube, t1)
21
Water Flow – Heat Flow: Anti-Unification
Source
Target
connected (beaker, vial, pipe)
connected( in(coffee, cup),
conn (A,B,C)
b_cube, bar)
liquid(water)
liquid(coffee)
liquid(D)
height( in(water, beaker, t1)) >
height( in(water, vial, t1))
temp( in(coffee, cup, t1)) >
temp(b_cube,t1)
T(A, t1) >
T(B, t1)
height( in(water, beaker, t1)) > temp( in(coffee, cup, t1)) >
height( in(water, beaker, t2))
temp( in(coffee, cup, t2))
T(A, t1) >
T(A, t2)
height( in(water, vial, t2)) >
height( in(water, vial, t1))
T(B, t2) >
T(B, t1)
temp(b_cube, t2) >
temp(b_cube, t1)
A
Water Flow – Heat Flow: Anti-Unification
Mappings
Here are the substitutions Θ1 and Θ2
→ beaker / in(coffee, cup)
B → vial / b_cube
C → pipe / bar
D → water / coffee
T → λx,t: height( in(water, x,t)) / temp
A
22
Conclusions
Advantages of our Modeling
Strengths of HDTP:
causal explanation is not build into the system
formalism tests whether some generalizations fit or do not fit
knowledge transfer: HDTP tests premise and transfers
concusion
distinction between cause and inference
transfer of rules!
new concepts can be transferred from the base to the target
this is a creative capacity of the system
e.g. heat and heat flow are new concepts
23
Further Work
testing of different principles concerning the selection of facts
and laws
possible heuristics are:
testing of different conceptualizations of base and target
granularity of the modeling
the semantics needs to be made precise
matching of predicates
complexity of substitutions
number of involved variables
instantiation of universally quantified laws etc.
semantics of generalized theory
still problematic: anti-unification of theories
how to deal with logical inferences
24