Ancona A. Ferrando L. Franceschini V. Mascardi Department of Informatics, Bioengineering, Robotics and Systems Engineering University of Genoa, Italy Formal Techniques for Java-Like Programs 20 May 2017, Barcelona, Spain
devised for monitoring agents interactions in multi-agent systems (Ancona, Drossopoulou, and Mascardi 2012), influenced by gloabl and multiparty session types. . . but they are actually very general! (Ancona, Ferrando, and Mascardi 2016)
our program during execution that is related to the specification Event type ϑ ⊆ E: a set of events Event trace e ∈ E∞: a (possibly infinite) sequence of events encoding the execution flow
our program during execution that is related to the specification Event type ϑ ⊆ E: a set of events Event trace e ∈ E∞: a (possibly infinite) sequence of events encoding the execution flow Trace expression τ: specification of a (possibly infinite) set of correct event traces
our program during execution that is related to the specification Event type ϑ ⊆ E: a set of events Event trace e ∈ E∞: a (possibly infinite) sequence of events encoding the execution flow Trace expression τ: specification of a (possibly infinite) set of correct event traces Possible events Function and method invocation, open/read/write/close on files, I/O operations over a network, acquire and release of locks in a multi-threaded environment. . .
F = ε ∨ new:O O = write:O ∨ close:ε Recursion: trace expressions are regular terms, defined by syntactic equations (no explicit µ) Some accepted traces ε new write close new write write . . .
F = ε ∨ new:O O = write:O ∨ close:ε Recursion: trace expressions are regular terms, defined by syntactic equations (no explicit µ) Some accepted traces ε new write close new write write . . . Some refuted traces new write write . . .
are invoked on specific objects: only monitoring which methods are invoked is not enough. Parametric trace expressions (Ancona, Ferrando, and Mascardi 2017) are needed.
are invoked on specific objects: only monitoring which methods are invoked is not enough. Parametric trace expressions (Ancona, Ferrando, and Mascardi 2017) are needed. Binder A new operator is introduced: <x; τ>
are invoked on specific objects: only monitoring which methods are invoked is not enough. Parametric trace expressions (Ancona, Ferrando, and Mascardi 2017) are needed. Binder A new operator is introduced: <x; τ> Event types We assume a function match: match(e, ϑ) = σ iff event e matches event type ϑ with computed substitution σ.
| o object}∪{o.write() | o object}∪{o.close() | o object} Events are method invocations, o is object identifier. any(x) is the event type including all operations on object x. any(x) = {new x(), x.write(), x.close()}
| o object}∪{o.write() | o object}∪{o.close() | o object} Events are method invocations, o is object identifier. any(x) is the event type including all operations on object x. any(x) = {new x(), x.write(), x.close()} F = ε ∨ <o; new o():(O | F)> O = o.close():ε ∨ o.write():O
| o object}∪{o.write() | o object}∪{o.close() | o object} Events are method invocations, o is object identifier. any(x) is the event type including all operations on object x. any(x) = {new x(), x.write(), x.close()} F = ε ∨ <o; new o():(O | F)> O = o.close():ε ∨ o.write():O A possible correct trace new f1() f1.write() new f2() f2.write() f1.close() f2.close()
| o object}∪{o.write() | o object}∪{o.close() | o object} Events are method invocations, o is object identifier. any(x) is the event type including all operations on object x. any(x) = {new x(), x.write(), x.close()} F = ε ∨ <o; new o():(O | F)> O = o.close():ε ∨ o.write():O A possible correct trace new f1() f1.write() new f2() f2.write() f1.close() f2.close() A refuted trace new f1() f2.write() f1.close()
trace expressions with linear time and space Objects: systematic way to generalize a trace expression from a single object to a community of object More examples, more common patterns
trace expressions with linear time and space Objects: systematic way to generalize a trace expression from a single object to a community of object More examples, more common patterns Optimizations: exploit equational theory to implement optimizations
Generation of Self-monitoring MASs from Multiparty Global Session Types in Jason”. In: DALT 2012. Ancona, Davide, Angelo Ferrando, and Viviana Mascardi (2016). “Comparing Trace Expressions and Linear Temporal Logic for Runtime Verification”. In: Theory and Practice of Formal Methods. – (2017). “Parametric Runtime Verification of Multiagent Systems”. In: AAMAS 2017.