Augmenting a Regular ExpressionBased Temporal Logic with Local
Augmenting a Regular Expression-Based Temporal Logic with Local Variables Cindy Eisner IBM Haifa Research Lab and Dana Fisman Hebrew University, IBM Haifa Research Lab 1
Regular Expression-Based Temporal Logic § Regular Expression-Based Temporal Logic (DRE) is at the core of the IEEE standards PSL and SVA. To be exact, the logic is built on Semi-Extended Regular Expressions (SEREs) SERE if then 2
Local Variables § Temporal logic is usually defined with respect to a word representing a computation path over a set of atomic propositions. § A temporal logic formula does not control the behavior of the atomic propositions, it merely observes their behavior. § Local variables are a twist on this approach, in which the user can declare variables local to the formula and control their behavior from within the formula itself. 3
Local Variables § Previous example: § Using local variables we can state that end should hold only if counting held the same number of cycles as busy: All variables have a finite domain. For simplicity we do not specify it. 4
Local Variables 0 0 1 2 3 5
Locality of local variables § The “locality” of a local variable stems from the fact that different “matches” of the same SERE can be considered to have different “copies” of the local variables. § This is similar to programming languages in which each invocation of a function has its own copy of a local variable, even if those invocations occur concomitantly (e. g. , in recursion). 6
Local Variables 0 0 1 2 7
Local Variables 0 0 1 1 8
Local Variables x 0 0 x 1 1 2 3 4 9
Why Local Variables? § Local variables do not add expressive power to DRE which is -regular to begin with. § However, they do ease formulation and readability as advocated independently by [Havlicek et al. ] and [Oliviera and Hu] in 2002. § Local variables are already a part of SVA and are in the process of being incorporated into PSL. 10
The problem § The current semantics of local variables (in SVA) suffers several drawbacks. l Distributivity of union over intersection breaks. u l The problem is know since 2004 [Havlicek et al. ] The semantics exhibits unintuitive interpretations in certain cases. 11
Previous Approaches § SEREs are defined with respect to l a word w l an initial valuation of local variables L 0 l and an end valuation of local variables L 1 12
Previous Approaches § Official SVA semantics for intersection (Å) End value of Initial value word of local variables l Definition of flow, sample and block for intersection (Å) 13
Previous Approaches § [BH’ 06] SVA semantics for intersection (Å) 14
Previous Approaches - Problems § Unintuitive interpretation: ? = ! ? l Language of both is expected to be empty. l However ! is satisfiable, for example z=4 z=13 A word of length 2 15
Previous Approaches - Problems § Distributivity of union over intersection breaks! l The following two are not equivalent: l For example: z=1 z=0 A word of length 1 16
Our goal Provide an intuitive semantics for DRE augmented with local variables, which preserves conventional algebraic properties. 17
Overview § Local Variables – what and why. § Previous approach and its problems. § Syntax and Semantics of LVDRE. § Characteristics of our semantics. § Comparison to previous work. § Conclusions. 18
LVDRE - syntax § Semi extended regular expression (SEREs) § LVDRE formulas Strong SERE Boolean Expression and a sequence of assignments The empty Regular Expression Negation Disjunction Suffix implication Concatenation Suffix conjunction Union Intersection Kleene closure (repetition) Declaration of local variables Removing variables Declaration andlocal assignments Declaration and assignments from scope 19
Scope § The scope of a local variable is defined as the SERE or formula in which it was declared using new, unless it was explicitly taken out of scope by free. § We assume that a variable not in scope is not used (neither referenced nor assigned). 20
Enhanced Words § Typically In the presence linear temporal of local variables logic is defined we need with to Value include respect at the beginning of to words the value over of local thevariables, alphabet of andatomic to control propositions their change. the cycle (pre (designals) -value) ack=true req=false req=true busy=true data[0: 1]=00 data[0: 1]=01 i=0 j=0 i=1 j=0 = i=1 j=0 i=1 j=7 Value at the end of the cycle ack=false (post-value) req=false Many possible busy=true intermediate data[0: 1]=01 values, e. g. = i=1 j=7 i=4 j=8 21
Our Approach § SEREs are defined with respect to l An enhanced word w That is, the value of local variables is tracked at each cycle rather than just at the beginning and end of the match 22
Semantics of SEREs § Base cases: Boolean expression The word is of length one Enhanced word. Models tightly under local variables in scope Z Boolean expression and a sequence of assignments The boolean expression holds on it. . The variables in scope not in The did variables change theirdid value scope not change their value The variables in scope changedtheir value as dictated by the sequence of assignments 23
Semantics of SEREs § SERE operators: § Semantics is as usual!!! 24
Semantics of SEREs § Scope and assignment operators: Add X to the set of variables in scope. Remove X from the set of variables in scope. Change the initial value of the local variables to be the result of the assignment Add X to the set of variables in scope. 25
Characteristics of The Semantics § Implementation l 1 O(D|r|¢ 2|V|) There exists an NFA with states accepting the enhanced words v such that and for a given r, Z and . The automata are slightly bigger that those of previous approaches because we l There exists a Büchi control the variables in scope 1 automaton with O(D| |¢ 2|V|) states accepting the words w such that for a given , Z and . 26
Characteristics of The Semantics § Complexity l The satisfiability and model checking problems for properties in LVDRE are EXPSPACE-complete. Same as in previous approaches 27
Characteristics of The Semantics § Algebraic properties l Intersection ([) are commutative. The(Å) keyand to union preserving l standard(Å) algebraic properties is Intersection and union ([) are associative. l separating the operations dealing with Intersection distributes over union. local variables (scope and assignments) l the regular SERE operators!!! Unionfrom distributes over intersection. l The following equivalences hold for LVDRE: 29
Characteristics of The Semantics assignments The key to preserving standard algebraic properties is usualdealing semantics separating the operations with local variables (scope and assignments) from the regular SERE operators!!! scope 30
Comparison to previous approaches § Our semantics l l l SEREs are defined with respect to enhanced words Formulas are defined with respect to a word an initial valuation of local variables Scope is determined by the operators new and free § Previous approach l l l SEREs are defined with respect to a word and initial and end valuation of local variables Formulas are defined with respect to a word an initial valuation of local variables Scope is determined automatically 31
Conclusions § We have presented a semantics for LVDRE which is l l Intuitive In the paper we show why Preserves important properties any semantics whichstandard tries to algebraic determine the scope automatically The scope is determined by newwill and free rather distributivity or other than break automatically as in previous approaches standard algebraic property Same complexity (for satisfiability and model chechking) as previous approach 32
The End Thank you! 33
- Slides: 32