Describing state change
Download
1 / 14

Describing State Change - PowerPoint PPT Presentation


  • 104 Views
  • Uploaded on

Describing State Change. Predicate logic is stateless: if p(a) can once be deduced from a set of axioms then it can always be deduced from those axioms. Modelling the real world, however, requires us to talk about state change.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Describing State Change' - bin


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Describing state change
Describing State Change

Predicate logic is stateless: if p(a) can once be deduced from a set of axioms then it can always be deduced from those axioms.

Modelling the real world, however, requires us to talk about state change.

We look at one simple (but common) way to model state in a stateless logic.


Blocks world example
Blocks World Example

Op1

Opn

trans(Block, From, To)

……..

a

c

b

a

b

c

t1

t2

t3

t1

t2

t3


State change as recursion
State Change as Recursion

poss(s0).

poss(do(Op, S)) :-

poss(S),

pact(do(Op, S)).

do(Op2 , do(Op1, s0 ) )

do( Op1, s0 )

s0

c

a

b

t1

t2

t3


Possible actions
Possible Actions

pact(do(trans(X, Y, Z), S)) :-

holds(clr(Z), S),

holds(clr(X), S),

holds(on(X, Y), S),

\+(X = Z), \+(Z = Y), \+(X = Y).

trans(c, a, t3)

clr(t3)

clr(c)

c

on(c,a)

c

a

b

a

b

t1

t2

t3

t1

t2

t3


Initial conditions
Initial Conditions

holds(on(c,a), s0).

holds(on(a,t1), s0).

holds(on(b,t2), s0).

holds(clr(c), s0).

holds(clr(b), s0).

holds(clr(t3), s0).

c

a

b

t1

t2

t3


Transition effects on state
Transition Effects on State

holds(clr(Y), do(trans(_, Y, _), _)).

holds(on(X, Z), do(trans(X, _, Z), _)).

trans(c, a, t3)

clr(a)

c

c

a

b

a

b

on(c,t3)

t1

t2

t3

t1

t2

t3


Frame axiom
Frame Axiom

holds(C, do(trans(X, Y, Z), S)) :-

holds(C, S),

\+(C = clr(Z)),

\+(C = on(X, Y)).

clr(t3)

trans(c, a, t3)

on(c,a)

on(a,t1)

on(a,t1)

on(b,t2)

on(b,t2)

c

clr(c)

clr(c)

c

a

b

a

b

t1

t2

t3

clr(b)

clr(b)

t1

t2

t3


Goal state
Goal State

goal :-

poss(S),

holds(on(a,b), S),

holds(clr(a), S),

holds(on(b,c), S),

holds(on(c,t3), S),

holds(clr(t1), S),

holds(clr(t2), S).

a

b

c

t1

t2

t3


Plan

poss(do(trans(a,t1,b),

do(trans(b,t2,c),

do(trans(c,a,t3), s0))))

trans(c, a, t3)

trans(b, t2, c)

trans(a, t1, b)

a

b

c

b

c

a

b

c

a

a

b

c

t1

t2

t3

t1

t2

t3

t1

t2

t3

t1

t2

t3


Subsumption based systems
Subsumption Based Systems

  • Subsumption based inference is used in programming systems that employ types, classes, description logics and the like.

  • We look at how to infer subsumption in two ways:

  • Through term structure;

  • Through translation to FOPC

  • There are other ways (e.g. by writing a type unification system) but we don’t cover those.


Term encoding for subsumption
Term Encoding For Subsumption

animal

vehicle

mammal

reptile

car

bus

dog

Type described as a structured term e.g. animal(mammal(dog(X)))

| ?- animal(X) = animal(mammal(Y)).

X = mammal(Y)

| ?- animal(X) = vehicle(Y).

no

| ?- animal(mammal(dog(rover))) = vehicle(car(rover)).

no


Vocabulary describing classes
Vocabulary Describing Classes

“Mammals are animals”

“Mammals are warm blooded and lactating”

subclass(mammal, animal)

subclass(intersection(warm_blooded, lactating), mammal)

domain(biomass,animal)

range(biomass,number)

etc…

“Biomass is a function over animals”

“Biomass is a function returning a number”


Translator to fopc
Translator to FOPC

th(A, X, T) :- atom(A), T =.. [A,X].

th(intersection(C,D), X, (T1,T2)) :-

th(C, X, T1),

th(D, X, T2).

th(all(R,C), X, (T1 :- T2)) :-

th(C, Y, T1), T2 =.. [R,X,Y].

tb(A, X, T) :- atom(A), T =.. [A,X].

tb(intersection(C,D), X, (T1,T2)) :-

tb(C, X, T1),

tb(D, X, T2).

tb(union(C,D), X, (T1 ; T2)) :-

tb(C, X, T1),

tb(D, X, T2).

tb(some(R,C), X, (T1,T2)) :-

tb(C, Y, T2), T1 =.. [R,X,Y].

t(subclass(C,D), (T1 :- T2)) :-

th(D, Y, T1),

tb(C, Y, T2).

t(equivalent(C,D), (T1,T2)) :-

t(subclass(C,D), T1),

t(subclass(D,C), T2).

t(range(R,D), (T1 :- T2)) :-

th(D, Y, T1),

T2 =.. [R,_,Y].

t(domain(R,D), (T1 :- T2)) :-

th(D, X, T1),

T2 =.. [R,X,_].

t(X : A, T) :-

th(A, X, T).

t((X1,X2):R, T) :-

atom(R),

T =.. [R,X1,X2].


Applying fopc translator
Applying FOPC Translator

| ?- t(subclass(mammal, animal), S).

S = (animal(X) :- mammal(X))

| ?- t(subclass(intersection(warm_blooded, lactating), mammal), R).

R = (mammal(X) :- warm_blooded(X), lactating(X))

| ?- t(domain(biomass,animal), D).

D = (animal(X) :- biomass(X,_))

| ?- t(range(biomass,number), R).

R = (number(X) :- biomass(_,X))


ad