340 likes | 466 Views
TMT for CHR v in SFC. Pierre Deransart with Rafael Ferreira Oliveira. CR INRIA-Paris-Rocquencourt. 16 septembre 2009. Development Methodology of a Generic Trace for CHR v based on the Simple Fluent Calculus. Development Methodology: Trace Meta-Theory (TMT)
E N D
TMT for CHRv in SFC Pierre Deransart with Rafael Ferreira Oliveira CR INRIA-Paris-Rocquencourt 16 septembre 2009 Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
Development Methodology of a Generic Trace for CHRv based on the Simple Fluent Calculus • Development Methodology: Trace Meta-Theory (TMT) • Constraint Handling Rules with Disjunction (CHRv) • Simple Fluent Calculus (SFC) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
TMT , Generic Trace Development • SFC (short introduction) • CHRv semantics in SFC (t) • OS of CHRv in SFC • GT Development, next steps Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
Trace Meta Theory Followup work of OADymPPaC Project (2001-2004) Outils d'Analyse Dynamique Pour la Programmation Par Contraintes http://contraintes.inria.fr/OADymPPaC Pierre Deransart, Mireille Ducassé and Gérard Ferrand, Observational Semantics of the Resolution Box Model, Proceedings of the 17th Workshop on Logic-based Methods in Programming Environments (WLPE'07), 2007, eds.Wim Vanhoof and Patricia Hill, Porto, Portugal Pierre Deransart Conception de traces et applications (vers une méta-théorie des traces), Progress reports on http://hal.inria.fr/ (last march 2009) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
TMT, Generic Trace Development • Valid for several processes • Usable by several analysers • Easy to extend and to standardize • Generic trace: generic query language • Several levels of analysis (abstr/subtrace) Objectives Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
(Full) Actual Trace Twt = <s0,wt*> • Unbounded sequence of trace events wt (t > 0) • wt : (t, at) • t : chrono: « time » of the trace • at: set of attributes • or current full actual state • Interpretative Semantics (IS): • Tvt= I(Twt) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
(Full) Virtual Trace Tvt= <(s0,)et*> • Unbounded sequence of trace events(t > 0) • et: (t, rt, st) • t: chrono: timestamps of the trace event • rt: type of trace event: an identifier characterizing the type of action which produced the transition st-1 to st • rt belongs to a finite set R. • st = p1,t..., pn,t : set of parameter values at chrono t. st is the current virtual state • Observational Semantics (OS): • Twt= E(Tvt) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
The two traces of a process • Virtual Trace TV = <S0,et*> OS • Actual Trace TA = <S0,wt*> IS Condition to satisfy: (faithfulness) Twt = E(Tvt) etTvt = I(Twt) Illustration TV E: extraction I: interpretation (reconstruction) E ° I = I ° E = i Process E I Tw (Informal equations) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
Sémantique Observationnelle (“Labelled Transition System”) • SO: < S, R, E, T, S0 > où • S ensemble des états virtuels, • R est un ensemble fini de type d’évènements de trace • T fonction de transition d’état T : R x S -> S • E fonction d’extraction de l’événement de trace lors d’une transition E : R x S -> A • S0 ensemble des états initiaux I S Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
Sémantique Observationnelle (représentation) • Schéma de règle de transition: • TypeAction : {un identificateur r} • ActionCond : {Conditions d'exécution de l'action, portant sur l'état virtuel courant : une formule logique du premier ordre utilisant des prédicats sur les paramètres } • Extcond : {Conditions d'exécution de l'action faisant intervenir des variables externes à l'état (donc non décrite dans le modèle). • Sera dite condition externe ou influence} • VSEffect : { Effet de l'action rsur l'état courant s, résultant en un nouvel état s’} • Etrace : { Trace produite par l'action r: l'état actuel extraita} Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
Idealized (biologically unrealistic) rabbit population (Fibonacci) • SO: < S, R, E, T, S0 > • < N*, {mg}, E, T, {[1,1]} > • st = [popu(0,…,popu(t),popu(t+1)], s0 = [1,1] • TypeAct : {Mg (monthly growing)} • ActionCd : {true} • Extcond : {true} • VSEffect : {s’= s [plast(s)+last(s)] } (T) • Etrace : {last(s’)} =w = E(r,s) • Tv5= <[1,1],[(1,Mg,[1,1,2]), (2, Mg,[1,1,2,3]),…, • (4, Mg,[1,1,2,3,5,8]),(5, Mg,[1,1,2,3,5,8,13])]> • Tw5= <[1,1],[(1,2),(2,3),(3,5),(4,8),(5,13)]> • I(Twt)= et =(t,Mg,[1,1,a1, a2,…, at-1, at]) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
TMT , Generic Trace Development • SFC (short introduction) and OS in SFC • CHRv semantics in SFC (t) • OS of CHRv in SFC • GT Development, next steps Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
Fluent Calculus M. Thielscher, Introduction to the fluent calculus, Electronic Transactions on Artificial Intelligence, 1998, pp 179--192, v 2, n 3-4, http://www.ep.liu.se/ej/etai/1998/006/ Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
FC interesting because… • Easy expression of OS: the idea of trace is “naturally” contained in the notion of situation • Logical proofs become simpler in the SFC (less deductions, at least for “direct closed” effects) • A solution to the “frame problem” (persistence of unafected partial state) • Symetry of “state axioms” allows forward and bakward reasonning (useful for proofs of faithfulness) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
Simple Fluent Calculus (Partial) state: set of fluents Fluents Actions Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
Simple Fluent Calculus (ctd) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
OS in SFC As many pairs of axioms as there are action types The actual trace is in the situation Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
OS of Fibonacci in SFC Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
Frame Problem Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
TMT , Generic Trace Development • SFC (short introduction) and OS in SFC • CHRv semantics in SFC (t) • OS of CHRv in SFC • GT Development, next steps Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
CHRv semantics in SFC (vt) • Marcos Aurélio Almeida da Silva, CHORD: Constraint Handling Object-Oriented Rules with Disjunctions, Mestrado Thesis, Feb 2009 • Gregory J.Duck, Peter Stuckey, Maria Garcia de la Banda, Christian Holzbaur, The refined Operational Semantics of CHR, In Proceedings of the 20th International Conference on Logic Programming (ICLP’04), pp 90-104, Saint-Malo, France, 2004, Springer Verlag Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
Different semantics of CHR (trvt vr) 3 actions for CHR t semantics (th. Oper. Sem.) solve, introduce, apply 6 actions for CHR r semantics (refined. Oper. Sem.) solve, activate, reactivate, drop, simplify, propagate 3 actions for CHR vt semantics (th. Oper. Sem.) derive, clean, split 8? actions for CHR vr semantics Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
CHR semantics in SFC (t) 6 parameters (virtual state) Initial state: S0 = Goal(Q) oUdcs([])oInBics(true) oInPropHistory([]) o NextId(1) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
CHR semantics in SFC (t) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
CHR semantics in SFC (t) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
CHRsemantics in SFC (t) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
CHRsemantics in SFC (t) (ctd) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
TMT , Generic Trace Development • SFC (short introduction) and OS in SFC • CHR semantics in SFC (t) • OS of CHR in SFC (t) • GT Development, next steps Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
OS of CHR in SFC (t) 6 parameters (virtual state) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
OS of CHR in SFC (t) (ctd) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
OS of CHR in SFC (t) (ctd) Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
TMT , Generic Trace Development • SFC (short introduction) and OS in SFC • CHR semantics in SFC (t) • OS of CHR in SFC • GT Development, next steps Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009
CONCLUSION GT Development, next steps • CHRv refined operational semantics in SFC (vr): 8 basic actions • Interpretative semantics (reconstruction function in SFC?) • Proof methods of OS/IS properties using SFC and Flux • Equivalente specification in OOSFC (Object Oriented SFC) using the platform CHROME-REF • Implementation in Java and tests Séminaire Interne Contraintes, Paris Rocquencourt 16/9/2009