10.5 a. HeadAt(c): tape head at cell location c, true for exactly one cell. b. State(s): machine state is s, true for exactly one cell. c. ValueOf(c,v): cell c’s value is v. d. LeftOf (c 1 ,c 2 ): cell c 1 is one step left from cell c 2 . e. TransitionLeft(s 1 ,v 1 ,s 2 ,v 2 ): the machine in state s 1 upon reading a cell with value v 1 may write value v 2 to the cell, change state to s 2 , and transition to the left. f. TransitionRight(s 1 ,v 1 ,s 2 ,v 2 ): the machine in state s 1 upon reading a cell with value v 1 may write value v 2 to the cell, change state to s 2 , and transition to the right. The predicates HeadAt, State, and ValueOf are fluents, the rest are constant descriptions of the machine and its tape. Two actions are required: Action(RunLeft(s 1 ,c 1 ,v 1 ,,s 2 ,c 2 ,v 2 ), PRECOND :State(s 1 ) ∧ HeadAt(c 1 ) ∧ ValueOf(c 1 ,v 1 ) ; ∧TransitionLeft(s 1 ,v 1 ,s 2 ,v 2 ) ∧ LeftOf (c 2 ,c 1 ) EFFECT :¬State(s 1 ) ∧ State(s 2 ) ∧ ¬HeadAt(c 1 ) ∧ HeadAt(c 2 ) ∧¬ValueOf(c 1 ,v 1 ) ∧ ValueOf(c 1 ,v 2 )) Action(RunRight(s 1 ,c 1 ,v 1 ,,s 2 ,c 2 ,v 2 ), PRECOND :State(s 1 ) ∧ HeadAt(c 1 ) ∧ ValueOf(c 1 ,v 1 ) ; ∧TransitionRight(s 1 ,v 1 ,s 2 ,v 2 ) ∧ LeftOf (c 1 ,c 2 ) EFFECT :¬State(s 1 ) ∧ State(s 2 ) ∧ ¬HeadAt(c 1 ) ∧ HeadAt(c2) ∧ ¬ValueOf(c 1, v 1) ∧ ValueOf(c 1, v 2)) The goal will typically be to reach a fixed accept state. A simple example problem is: Init(HeadAt(C 0 ) ∧ State(S 1 ) ∧ ValueOf (C 0 ,1) ∧ ValueOf(C 1 ,1) ∧ValueOf (C 2 ,1) ∧ ValueOf(C 3 ,0) ∧ LeftOf (C 0 ,C 1 ) ∧ LeftOf (C 1 ,C 2 ) ∧LeftOf (C 2 ,C 3 ) ∧ TransitionLeft(S 1 ,1,S 1 ,0) ∧ TransitionLeft(S 1 ,0,S accept ,0) Goal(State(S accept )) Note that the number of literals in a state is linear in the number of cells, which means a polynomial space machine require polynomial state to represent. 10.15 The main point here is that writing each successor-state axiom correctly requires knowing all the actions that might add or delete a given fluent; writing a STRIPS axiom, on the other hand, requires knowing all the fluents that a given action might add or delete. a. Poss(Fly(p,from,to),s) ⇔At(p,from,s) ∧ Plane(p) ∧ Airport(from) ∧ Airport(to) . b. Poss(a,s) ⇒ (At(p,to,Result(a,s)) ⇔(∃from a=Fly(p,from,to)) ∨(At(p,to,s) ∧ ¬∃new new 6= to ∧ a=Fly(p,to,new))) . c. We must add the possibility axiom for the new action: Poss(Teleport(p,from,to),s) ⇔At(p,from,s) ∧ ¬Warped(p,s) ∧ Plane(p) ∧ Airport(from) ∧ Airport(to) . The successor-state axiom for location must be revised: Poss(a,s) ⇒(At(p,to,Result(a,s)) ⇔(∃from a=Fly(p,from,to)) ∨(∃from a=Teleport(p,from,to)) ∨(At(p,to,s) ∧ ¬∃new new 6= to ∧(a=Fly(p,to,new) ∨ a=Teleport(p,to,new)))) . Finally, we must add a successor-state axiom for Warped: Poss(a,s) ⇒(Warped(p,Result(a,s)) ⇔(∃from,to a=Teleport(p,from,to)) ∨ Warped(p,s)) . d. The basic procedure is essentially given in the description of classical planning as Boolean satisfiability in 10.4.1, except that there is no grounding step, the precondition axioms become definitions of Poss for each action, and the successor-state axioms use the structure given in 10.4.2 with existential quantifiers for all free variables in the actions, as shown in the examples above. 12.7 a. “Water is a liquid between 0 and 100 degrees.” We will translate this as “For any water and any situation, the water is liquid iff and only if the water’s temperature in the situation is between 0 and 100 centigrade.” ∀w,s w∈Water ⇒(Centigrade(0) < Temperature(w,s) < Centigrade(100)) ⇔T(w∈Liquid,s) b. “Water boils at 100 degrees.” It is a good idea here to do some tool-building. On page 243 we used MeltingPoint as a predicate applying to individual instances of a substance. Here, we will define SBoilingPoint to denote the boiling point of all instances of a substance. The basic meaning of boiling is that instances of the substance becomes gaseous above the boiling point: SBoilingPoint(c,bp) ⇔∀x,s x∈c ⇒(∀t T(Temperature(x,t),s) ∧ t > bp ⇒ T(x∈Gas,s)) Then we need only say SBoilingPoint(Water,Centigrade(100)). c. “The water in John’s water bottle is frozen.” We will use the constant Now to represent the situation in which this sentence holds. Note that it is easy to make mistakes in which one asserts that only some of the water in the bottle is frozen. ∃b ∀w w∈Water ∧ b∈WaterBottles ∧ Has(John,b,Now)∧ Inside(w,b,Now) ⇒ (w∈Solid,Now) d. “Perrier is a kind of water.” Perrier ⊂ Water e. “John has Perrier in his water bottle.” ∃b ∀w w∈Water ∧ b∈WaterBottles ∧ Has(John,b,Now)∧ Inside(w,b,Now) ⇒ w∈Perrier f. “All liquids have a freezing point.” Presumably what this means is that all substances that are liquid at room temperature have a freezing point. If we use RTLiquidSubstance to denote this class of substances, then we have ∀c RTLiquidSubstance(c) ⇒ ∃t SFreezingPoint(c,t) g. “A liter of water weighs more than a liter of alcohol.” ∀w,a w∈Water ∧ a∈Alcohol ∧ V olume(w)=Liters(1)∧V olume(a)=Liters(1) ⇒ Mass(w) > Mass(a
© Copyright 2026 Paperzz