250 likes | 392 Views
A KobrA and OCL model for backward state-space search planning and partial order-planning with STRIPS. Ana Emília (aemq@cin.ufpe.br) Jairson Vitorino (jv@cin.ufpe.br) Setembro, 2004. KobrA method overview. Developed at Fraunhofer IESE Integrates: Component based development (CBD)
E N D
A KobrA and OCL model for backward state-space search planning and partial order-planning with STRIPS Ana Emília (aemq@cin.ufpe.br) Jairson Vitorino (jv@cin.ufpe.br) Setembro, 2004
KobrA method overview • Developed at Fraunhofer IESE • Integrates: • Component based development (CBD) • Model-driven architecture (MDA) • Product-line approach • Komponents creation applied on a recursive fashion
Object Constraint Language • Part of the UML standard. • Formal Specification Language. Precise semantics. • (Quite) easy to read syntax. • Why? Because UML is not enough!
Natural language description OCL statement Age Vehicle´s owner must be at least 18 context Vehicle inv: self. Owner. age >= 18 Nobody can have more than 3 vehicles context Person inv: self.fleet–>size <= 3 Everyone´s car is black context Person inv: self.fleet–>forAll(v | v.colour = #black) Nobody can have more than 3 black vehicles context Person inv: self.fleet–>select(v | v.colour = #black)–>size <= 3 Nobody can have more than 3 black vehicles context Person inv: self.fleet–>iterate(v; acc:Integer=0 | if (v.colour=#black) then acc + 1 else acc endif) <=3 A person younger than 18 cannot own a car context Person inv: age<18 implies self.fleet–>forAll(v | not v.oclIsKindOf(Car)) There is one red car context Car inv: Car.allInstances()->exists(c | c.colour=#red) An OCL Example
The Planning Problem • Coming up with a sequence of actions that will achieve a goal • STRIPS planning language: comes in propositional or first-order logic flavor • STRIPS represents states, goals and actions
StripsSearchPlanner modelling • Strips_States • Positive propositional literal conjunction • Positive First-order literals conjunction • Ground • Function-free • Closed-world assumption • Strips_Goal Strips_States • Strips_actions • Name • Parameter_List • Precondition • Positive function free literals conjunction • Literal.Variables Parameter_List.Variables • Effect • Function freee literals conjunction
Basic algorithm • Do • Find Action A consistent and relevant if not possible return failure • Goal.remove(A.effect.positiveLiterals) • Goal.add(A.precondition.PositiveLiterals) • If checkIfIsReached (InitialState) return Solution • While goal not achieved
StateSearchPlanner Komponent Specification STRUCTURAL MODEL StateSearchPlanner <<Subject>> Plan State Current: List of Positive Literals 0..* Action Name: string ParameterList: List of variables Effect: List of Literals Precondition: List of Positive Literals Goal EffectPositiveLiterals() EffectNegativeLiterals()
StateSearchPlanner Komponent Realization Beahviour model StateChart
StripsPOPPlanner modelling • Strips_States • Positive propositional literal conjunction • Positive First-order literals conjunction • Ground • Function-free • Closed-world assumption • Strips_Goal Strips_States • Strips_actions • Name • Parameter_List • Precondition • Positive function free literals conjunction • Literal.Variables Parameter_List.Variables • Reserved actions: START and FINISH (POP algorithm) • Effect • Function freee literals conjunction
Actions set • Empty plan contains {START,FINISH} • START • No precondition • Effect:all literals composing the initial state • FINISH • No effects • Preconditions:literals composing the goal
Ordering constraints • A < B • Action A must be executedbeforeaction B • A < B and B < A are not allowed (loops)
p RightSockOn Causal Links • A B • Effect of action A is precondition pof action B • Cannot be canceled by other actions executed between A and B execution • Ex.: RightSock RightShoe • C conflictswithcausal link causal p: • C has effect p • C may happen between A and B according to ordering restrictions
StripsPOPPlanner Komponent Specification STRUCTURAL MODEL State POPPlan Ordering Current: List of Positive Literals previous: Action Current : Action * listOfOrederedActions: Ordering successor() linearization() Action Goal Name: string ParameterList: List of variables Effect: List of Literals Precondition: List of Positive Literals CausalLinks precondition:literal CLList EffectPositiveLiterals() EffectNegativeLiterals() * Constraints: Goal.Instance State.Instance Actions.Precondition.variables Action.ParameterList.Variables 0..1
StripsPOPPlanner KomponentSpecification STRUCTURAL MODEL State POPPlan Ordering Current: List of Positive Literals 1 previous: Action Current : Action * listOfOrederedActions: Ordering successor() linearization() Action Goal Name: string ParameterList: List of variables Effect: List of Literals Precondition: List of Positive Literals CausalLinks precondition:literal CLList EffectPositiveLiterals() EffectNegativeLiterals() * CL : List of CausalLinks Constraints:Contex Ordering:Invariant For All objects ordering O1 and O2 there cannot be O1.previous=O2.current or O1.current = O2.previous. // this means NO LOOPS 0..1
Project Analysis • KobrA: • small problems, only on interaction • Small structural models • Knowledge in embedded in Constraints and methods • OCL: Using OCL forces a better understanding of the model and better specification • Drawbacks: • Lack of better examples of OCL • Tool used (Poseidon) do not conform to OCL current specification • There is no Case tool for KobrA
Conclusions • OCL captures some behaviour aspects • OCL does not include side effects • Further investigation is necessary to use OCL in statechart and other behavioural diagrams • It may be necessary to extend KobrA to provide bottom-up modeling and better COTS integration