SlideShare a Scribd company logo
State Space C-Reductions
of Concurrent Systems in
     Rewriting Logic
       -- Alberto Lluch Lafuente, IMT Lucca
       -- José Meseguer, UIUC
       -- Andrea Vandin, IMT Lucca

   2nd ETAPS Graphite Workshop, Rome, March 24, 2013
                preliminary version presented at WRLA 2012
                conference version presented at ICFEM 2012
t
                ct i ons a l
       ng redu ion-leve
“defini ecificat       ”
 the sp several pros
    has
running example



$ = transfer of 1$

x$   = account with x$
credit rule



$

x$                 x+1$
$    $
                        Isomorphic...
                         Isomorphic...
                        but syntactically different
                         but syntactically different
          0$   0$




     $              $

1$   0$             0$      1$




          1$   1$
symmetries in state space exploration problems
some tools with symmetry reduction

   Murphy [Ip&Dill @FMSD'96];
   Symmetric SPIN [Bosnacki et al. @SPIN'00];
   TopSPIN [Donaldson et al. @AMAST'06];
   Groove [Rensink @GRABATS'06];
   MiHDa [Montanari et al. @FMCO'02];
   PRISM-symm [Ball et al. @CAV06];
   Uppaal [Larsen et al. @ FORMATS 2003 ];
   Planners, constraint and SAT solvers, etc.
Canonizers
A ∼-canonizer for
   – a Kripke structure K
   – and an equivalence (bisimulation) relation ∼ ⊆ S × S
is a function c : S → S such that s∼c(s) for all states s.



                                              c
                $           c          $

          1$   0$                     0$    1$
A ∼-canonizer is strong if s∼s' implies c(s) = c(s')
           (i.e. if canonical representatives of ∼-equivalence classes are unique)




                                    2$    1$       3$                                                  2$        1$        3$

          1$   3$    2$            c                                                               c
                                                                    1$        3$    2$
               c                               c
                                                                     c
                    1$    2$   3$                                                  1$    2$   3$
                                         2$   3$    1$                                                      2$        3$        1$
                     c
3$   1$    2$                  c                          3$   1$        2$
                                                                                                                 c

                    3$    2$   1$                                                  3$    2$   1$




                                                    otherwise we call them weak.
C-reduction
of a Kripke
Structure
The c-reduction of a Kripke structure
     K = (S , → , L, AP)
                                   $       $
is
     Kc = (S , →;c , L, AP)        0$ 0$



                              $                $

                           1$ 0$       c       0$ 1$




                                   1$ 1$
Th. If c is a ∼-canonizer then Kc ∼ K.
PERFORMANCE?

                           t
                 ct i ons a l
        ng redu ion-leve
 “defini ecificat       ”
  the sp several pros
     has
typical space reduction pattern
sizes of the
state-space
                              no reduction
                              strong reduction
                              weak reduction




                             size of the
                             system
typical time reduction pattern

runtime
                              no reduction
                              strong reduction
                              weak reduction




                             size of the
                             system
will we have the same in Maude?


Q1. Overhead of meta-level based c-reductions?
Q2. Similar performance gains as model checkers?
Q3. Performance for c-reductions not based
     on full permutations (e.g. rotations)?
previous work on symmetry reduction with Maude
       reduction was much slower!




       Full symmetries in Maude [D.Rodriguez@WRLA'08]
Q1. meta-level vs c-reductions?
runtime
(seconds)
 90


 80
                                          meta-level
 70


 60


 50


 40


 30


 20                                       c-reductions
 10


  0
      1    2   3   4   5   6   7      8

                                   size of the system
                                   (instance parameter)
Q2. Maude vs SymmSPIN?
relative time
reduction factor
     2
                                     no reduction
                                     symmSPIN
   1.5                               strong c-reduction
                                     weak c-reduction
     1



   0.5



     0
          2       3      4       5
                                     size of the system
   -0.5
                                     (instance parameter)
    -1



   -1.5
Q3. space reduction in dining philosophers
 states
                                     msg id reuse
 explored
        600000
                                     msg abstraction
                                     msg id reuse & permutations
                                     msg abstraction + philosopher rotation
        500000



        400000



        300000



        200000



        100000

                                                 size of the system
        0
    2            3   4   5   6   7   8       9   (instance parameter)
WE DO IT IN...
  REWRITING LOGIC / MAUDE


                              t
                    ct i ons a l
           ng redu ion-leve
    “defini ecificat       ”
     the sp several pros
        has
What is RL?

A rewrite theory M is a tuple (Σ , E ∪ A , R , ϕ)

    Σ = signature (e.g. syntax);

    E = equations (e.g. functions);    System states


    A = axioms (e.g. ACI);

    R = rules (e.g. non deterministic behaviour);
                                                       System dynamics

    ϕ = frozennes map (e.g. rewrite strategy).
What is RL?

A rewrite theory M is a tuple (Σ , E ∪ A , R , ϕ)

    Σ = signature (e.g. syntax);

    E = equations (e.g. functions);     Not all equivalence relations ∼
                                         Not all equivalence relations ∼
                                        are tractable as axioms

    A = axioms (e.g. ACI);               are tractable as axioms

    R = rules (e.g. non deterministic behaviour);

    ϕ = frozennes map (e.g. rewrite strategy).

Some assumptions:

    Topmost rules for a designated [State] kind.
--- The main module defining the signature and one initial state

fmod BANK is

  ...

  sorts Object Message Configuration State .

  subsort Message Object < Configuration .



  op <_|_> : Nat Nat -> Object [ctor] . --- account id and balance

  op credit : Nat -> Message [ctor] .      --- id of the target account

  op __ : Configuration Configuration -> Configuration [ctor assoc comm] .

  op none : -> Configuration [ctor] .

  op {_} : Configuration -> State [ctor frozen] .



  --- A simple initial state                                        $     $

  op init : -> Configuration .
                                                                   0$     0$
  eq init =    < 0 | 0 >   < 1 | 0 > credit(0) credit(1) .



endfm
--- The behavioural rules of the example
mod BANK-RULES is


                                     $
  inc BANK .


  vars i x : Nat .
                                    x$         x+1$
  vars c1 : Configuration .


  --- A simple rule for crediting an account
  rl [credit] :
         { < i | x    > credit(i)   c1 }
       => { < i | s(x) >            c1 } .


endm
search without reduction                                    $   $

                                                                           0$ 0$
Maude> search in BANK-RULES : {init} =>* s:State .
                                                                       $           $

Solution 1 (state 0)                                            1$ 0$              0$ 1$

s:State --> {credit(0) credit(1) < 0 | 0 > < 1 | 0 >}



Solution 2 (state 1)                                                       1$ 1$

s:State --> {credit(1) < 0 | 1 > < 1 | 0 >}


                                                         symmetric states
Solution 3 (state 2)

s:State --> {credit(0) < 0 | 0 > < 1 | 1 >}



Solution 4 (state 3)

s:State --> {< 0 | 1 > < 1 | 1 >}



No more solutions.

states: 4   rewrites: 6 in 0ms cpu (2ms real) (9523 rewrites/second)
Defining
canonizers
c-extension

The c-extension of a rewrite theory
      M = ( , E ∪ A , R, ϕ)
is
      M+c= (       ⊎   c
                           , E ∪ Gc ∪ A , R, ϕc)
i.e. a correct extension of R with the definition of c.
c-extension (example of canonizer)
--- The c-extension of BANK that defines the c-canonizer for object permutations

mod BANK-C is

  ...

  op c : State -> [State] .                              apply transposition...

  vars i j x y : Nat .

  vars c1 : Configuration .



  ceq    c( {                 < i | x > < j | y > c1   } )

        = c( { [[ i <-> j ]]( < i | x > < j | y > c1 ) } )

        if [[ i <-> j ]]( < i | x > < j | y > c1 )

           <# < i | x > < j | y > c1 .


                                                             If it provides
  eq c({c1}) = {c1} [ owise ] .
                                                             “lexicographically”
                                                             smaller states
endm
Identification of symmetric states

Maude> red c( {credit(0) < 0 | 0 > < 1 | 1 >}) .
result State: {credit(1) < 0 | 1 > < 1 | 0 >}
                                                   $
                                                   0$ 1$

                                                       c
                                                       $
                                                   1$ 0$
C-reduction
of a rewrite
theory
The c-reduction of a rewrite theory
     M =( ,E∪A,R,ϕ)
is
     M/c = ( ⊎       c
                         , E ∪ Gc ∪ A , Rc , ϕc)

                                                cc
where Rc is made of rules           K(M/c) = K (M)
                                    K(M/c) =   K (M)
     l => c(r) if cond
for each rule of R
     l => r          if cond
module architecture
                 BANK



BANK-RULES (M)              BANK-PERMUTATION



                              BANK-C (M+c)




                        BANK-C-REDUCTION (M/c)
c-reduction (example)
--- The c-reduction of BANK-RULES
mod BANK-C-REDUCTION is


  inc BANK-C .


  rl [credit] :
            { < i | x     > credit(i) c1 }
       => c({ < i | s(x) >           c1 }) .


endm
search in c-reduced state space
Maude> search in BANK-C-REDUCTION : {init} =>* s:State .

search in BANK-C-REDUCTION : {init} =>* s:State .

                                                              $        $

Solution 1 (state 0)
                                                              0$       0$
s:State --> {credit(0) credit(1) < 0 | 0 > < 1 | 0 >}


                                                         $                  $
Solution 2 (state 1)                                               c


s:State --> {credit(1) < 0 | 1 > < 1 | 0 >}         1$   0$                 0$   1$




Solution 3 (state 2)

s:State --> {< 0 | 1 > < 1 | 1 >}
                                                              1$       1$



No more solutions.

states: 3   rewrites: 25 in 0ms cpu (2ms real) (53648 rewrites/second)
exploiting the c-reduced state space
Another example: 4 accounts, 4 transfers for each
    Maude> search in BANK/C : {init(4,4)} =>* s:State .

    search in BANK/C : {init(4, 4)} =>* s:State .

    ...

    states: 70 rewrites: 14333 in 26ms cpu (26ms real) (536615 rewrites/second)


                        Unreduced state space has 625 states


Model checking example “eventually there will be no more transfers to
process, forever”
    Maude> red modelCheck({init(4,4)}, <>[]~ some-message) .

    reduce in MUTEX-CHECK : modelCheck({init(4, 4)}, <> []~ some-message) .

    rewrites: 14485 in 17ms cpu (19ms real) (841906 rewrites/second)

    result Bool: true
CHECKING CORRECTNESS
    OF REDUCTIONS


                            t
                  ct i ons a l
         ng redu ion-leve
  “defini ecificat       ”
   the sp several pros
      has
Does c provide a correct c-reduction?
Th 1. “K(M/c) is bisimilar to K(M)” (desiderata)

Lemma 0. “Relation ∼ is an equivalence relation”
  (i) Check that the action of the group is correct.


Lemma 1. “Relation ∼ is a bisimulation”
                                                       Proof plan for
  (ii) Check that ∼ strongly preserves AP;
                                                       group-theoretic
 (iii) Check that ∼ and R “commute”.                   reductions


Lemma 2. “Function c is a ∼-canonizer”
 (iv) Check that c is a ∼-canonizer.
group theoretic equivalence relations


The action ⟦ ⟧ of a group G on the set of states S
   defines an equivalence relation:


  s∼s' iff ⟦ f ⟧(s) = s' for some f ∈ G.
modules and checks
modules and checks
(ii) Checking that ∼ strongly preserves AP

IDEA: Define a rewrite theory M/G to “move” inside orbits:

      M/G = (Σ ⊎ ΣG, E ∪ EG ∪ A , RM/G , ϕ)
where RM/G = { s => [[g]](s) , g in H}


Theorem: ∼ strongly preserves AP if AP is stable in R∼.
Can we check such stability automatically?
Yes, with InvA (under some conditions)
fmod BANK-AP is

  eq [two-dollars-eq] : two-dollars({ < i | s(s(x)) > c1 }) = true .

endfm



fmod BANK-PERMUTATION-RULES is

  rl [transposition] :    {                 < i | x > < j | y > c1    }

                         => { [[ i <-> j ]] ( < i | x > < j | y > c1) } .

endm



Maude> (analyze-stable two-dollars(s:State) in BANK-AP BANK-PERMUTATION-RULES .)

rewrites: 15571 in 16ms cpu (19ms real) (918643 rewrites/second)

Checking BANK-PERMUTATION-RULES ||- two-dollars => O two-dollars ...

Proof obligations generated:    2
                                         For non discharged proof obligations
Proof obligations discharged: 2           For non discharged proof obligations
Success!
                                         one can use the Maude ITP tool
                                          one can use the Maude ITP tool
Step III:
Checking...
modules and checks
(iii) Checking that ∼ and R commute
                  M               For all M/G-transitions u → u' and
      u                v
M/G                               for all M-transitions from u to v.
                            M/G
                            *
                  M
      u'               v'
                  M
  θ(l)                θ(r)
                                  For all M/G-rules l' => r' and
                                  for all M-rules from l => r.


M/G               M/G         Similar functionalities (e.g. critical pair generation)
                                Similar functionalities (e.g. critical pair generation)
                              are already available in some Maude tools
                 M    *         are already available in some Maude tools
 θ(r')                 v'     (e.g. in the Coherence Checker).
                                (e.g. in the Coherence Checker).
(iii) Checking that ∼ and R commute

How do we check joinability of critical pairs (R rules vs R∼)?

                      M            For each M/G-rule l'=>r', M-rules l=>r do
θ(l)                        θ(r)    Compute the MGUs θ for l'=l
                                    For each θ do
                M/G                  Compute transitions θ(r')→θ(vi)
                                     Check if at least one θ(vi)
          M
                v1                         is reachable from θ(r')

                                   NOTE 1: Can be done using Maude's
                ...




                                   unify and search commands.
θ(r')           vn    M/G
                                   NOTE 2: We are currently implementing a
            M                      tool for this.
Conclusion
t
                ct i ons a l
       ng redu ion-leve
“defini ecificat       ”
 the sp several pros
    has
preliminary version presented at WRLA 2012
    conference version presented at ICFEM 2012
                  yet more work is to be done...
   Better integration in Maude
        Conciliate with other state space reduction techniques;
        Tool support and its integration in MFE.

   Beyond group theoretic symmetries
        Abstractions that yield bisimulations?
        Axiomatisations of bisimulations in process algebras?

   Beyond bisimulation
        Weak bisimulation? Trace equivalence (for LTL)?
thanks!
  alberto.lluch@imtlucca.it
  http://www.albertolluch.com
  http://www.linkedin.com/in/albertolluch
  http://www.imtlucca.it/alberto.lluch+lafuente

  State Space C-Reductions (full manuscript)
  http://eprints.imtlucca.it/1350/

More Related Content

Similar to State Space C-Reductions @ ETAPS Workshop GRAPHITE 2013

R Workshop for Beginners
R Workshop for BeginnersR Workshop for Beginners
R Workshop for Beginners
Metamarkets
 
Cs229 notes7a
Cs229 notes7aCs229 notes7a
Cs229 notes7a
VuTran231
 
Passive network-redesign-ntua
Passive network-redesign-ntuaPassive network-redesign-ntua
Passive network-redesign-ntua
IEEE NTUA SB
 
Lecture6
Lecture6Lecture6
Lecture6voracle
 
Linear algebra review
Linear algebra reviewLinear algebra review
Linear algebra reviewvevin1986
 
The H.264 Integer Transform
The H.264 Integer TransformThe H.264 Integer Transform
The H.264 Integer Transform
Iain Richardson
 
Ef24836841
Ef24836841Ef24836841
Ef24836841
IJERA Editor
 
Machine learning (7)
Machine learning (7)Machine learning (7)
Machine learning (7)NYversity
 
lightweight graphical models for selectivity estimation without independance ...
lightweight graphical models for selectivity estimation without independance ...lightweight graphical models for selectivity estimation without independance ...
lightweight graphical models for selectivity estimation without independance ...
Soheila Dehghanzadeh
 
Conic Clustering
Conic ClusteringConic Clustering
Conic Clustering
Napat Rujeerapaiboon
 
Engineering science lesson 5
Engineering science lesson 5Engineering science lesson 5
Engineering science lesson 5
Shahid Aaqil
 
Engineering science lesson 5
Engineering science lesson 5Engineering science lesson 5
Engineering science lesson 5
Shahid Aaqil
 
NIPS2007: structured prediction
NIPS2007: structured predictionNIPS2007: structured prediction
NIPS2007: structured predictionzukun
 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysis
nadiazaheer
 
Molecular models, threads and you
Molecular models, threads and youMolecular models, threads and you
Molecular models, threads and youJiahao Chen
 
Geohydrology ii (3)
Geohydrology ii (3)Geohydrology ii (3)
Geohydrology ii (3)
Amro Elfeki
 
"SSC" - Geometria e Semantica del Linguaggio
"SSC" - Geometria e Semantica del Linguaggio"SSC" - Geometria e Semantica del Linguaggio
"SSC" - Geometria e Semantica del Linguaggio
Alumni Mathematica
 
Mas college5 2011.key
Mas college5 2011.keyMas college5 2011.key
Mas college5 2011.keyeosinophil_g
 
An introduction to reinforcement learning (rl)
An introduction to reinforcement learning (rl)An introduction to reinforcement learning (rl)
An introduction to reinforcement learning (rl)
pauldix
 

Similar to State Space C-Reductions @ ETAPS Workshop GRAPHITE 2013 (20)

R Workshop for Beginners
R Workshop for BeginnersR Workshop for Beginners
R Workshop for Beginners
 
Cs229 notes7a
Cs229 notes7aCs229 notes7a
Cs229 notes7a
 
Passive network-redesign-ntua
Passive network-redesign-ntuaPassive network-redesign-ntua
Passive network-redesign-ntua
 
Lecture6
Lecture6Lecture6
Lecture6
 
Linear algebra review
Linear algebra reviewLinear algebra review
Linear algebra review
 
Ch06 alignment
Ch06 alignmentCh06 alignment
Ch06 alignment
 
The H.264 Integer Transform
The H.264 Integer TransformThe H.264 Integer Transform
The H.264 Integer Transform
 
Ef24836841
Ef24836841Ef24836841
Ef24836841
 
Machine learning (7)
Machine learning (7)Machine learning (7)
Machine learning (7)
 
lightweight graphical models for selectivity estimation without independance ...
lightweight graphical models for selectivity estimation without independance ...lightweight graphical models for selectivity estimation without independance ...
lightweight graphical models for selectivity estimation without independance ...
 
Conic Clustering
Conic ClusteringConic Clustering
Conic Clustering
 
Engineering science lesson 5
Engineering science lesson 5Engineering science lesson 5
Engineering science lesson 5
 
Engineering science lesson 5
Engineering science lesson 5Engineering science lesson 5
Engineering science lesson 5
 
NIPS2007: structured prediction
NIPS2007: structured predictionNIPS2007: structured prediction
NIPS2007: structured prediction
 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysis
 
Molecular models, threads and you
Molecular models, threads and youMolecular models, threads and you
Molecular models, threads and you
 
Geohydrology ii (3)
Geohydrology ii (3)Geohydrology ii (3)
Geohydrology ii (3)
 
"SSC" - Geometria e Semantica del Linguaggio
"SSC" - Geometria e Semantica del Linguaggio"SSC" - Geometria e Semantica del Linguaggio
"SSC" - Geometria e Semantica del Linguaggio
 
Mas college5 2011.key
Mas college5 2011.keyMas college5 2011.key
Mas college5 2011.key
 
An introduction to reinforcement learning (rl)
An introduction to reinforcement learning (rl)An introduction to reinforcement learning (rl)
An introduction to reinforcement learning (rl)
 

More from Alberto Lluch Lafuente

Many-to-Many Information Flow Policies
Many-to-Many Information Flow PoliciesMany-to-Many Information Flow Policies
Many-to-Many Information Flow Policies
Alberto Lluch Lafuente
 
Adaptable Transition Systems @ ASCENS Meeting Prague 2013
Adaptable Transition Systems @ ASCENS Meeting Prague 2013Adaptable Transition Systems @ ASCENS Meeting Prague 2013
Adaptable Transition Systems @ ASCENS Meeting Prague 2013
Alberto Lluch Lafuente
 
White Box Adaptation @ CINA Meeting 2013
White Box Adaptation @ CINA Meeting 2013White Box Adaptation @ CINA Meeting 2013
White Box Adaptation @ CINA Meeting 2013Alberto Lluch Lafuente
 
A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...
A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...
A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...
Alberto Lluch Lafuente
 
A conceptual framework for behavioural adaptation @ Leicester 2011
A conceptual framework for behavioural adaptation @ Leicester 2011A conceptual framework for behavioural adaptation @ Leicester 2011
A conceptual framework for behavioural adaptation @ Leicester 2011
Alberto Lluch Lafuente
 
Evaluating the performance of model transformation styles with Maude @ Sympos...
Evaluating the performance of model transformation styles with Maude @ Sympos...Evaluating the performance of model transformation styles with Maude @ Sympos...
Evaluating the performance of model transformation styles with Maude @ Sympos...
Alberto Lluch Lafuente
 
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
Alberto Lluch Lafuente
 
IMT Welcome Day 2011
IMT Welcome Day 2011IMT Welcome Day 2011
IMT Welcome Day 2011
Alberto Lluch Lafuente
 
A Graph Syntax for Processes and Services @ Workshop WS-FM 2009
A Graph Syntax for Processes and Services @ Workshop WS-FM 2009A Graph Syntax for Processes and Services @ Workshop WS-FM 2009
A Graph Syntax for Processes and Services @ Workshop WS-FM 2009Alberto Lluch Lafuente
 
An Algebra of Hierarchical Graphs
An Algebra of Hierarchical GraphsAn Algebra of Hierarchical Graphs
An Algebra of Hierarchical Graphs
Alberto Lluch Lafuente
 

More from Alberto Lluch Lafuente (10)

Many-to-Many Information Flow Policies
Many-to-Many Information Flow PoliciesMany-to-Many Information Flow Policies
Many-to-Many Information Flow Policies
 
Adaptable Transition Systems @ ASCENS Meeting Prague 2013
Adaptable Transition Systems @ ASCENS Meeting Prague 2013Adaptable Transition Systems @ ASCENS Meeting Prague 2013
Adaptable Transition Systems @ ASCENS Meeting Prague 2013
 
White Box Adaptation @ CINA Meeting 2013
White Box Adaptation @ CINA Meeting 2013White Box Adaptation @ CINA Meeting 2013
White Box Adaptation @ CINA Meeting 2013
 
A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...
A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...
A White-box Perspective on Self-Adaptation and Self-Awareness (with a focus o...
 
A conceptual framework for behavioural adaptation @ Leicester 2011
A conceptual framework for behavioural adaptation @ Leicester 2011A conceptual framework for behavioural adaptation @ Leicester 2011
A conceptual framework for behavioural adaptation @ Leicester 2011
 
Evaluating the performance of model transformation styles with Maude @ Sympos...
Evaluating the performance of model transformation styles with Maude @ Sympos...Evaluating the performance of model transformation styles with Maude @ Sympos...
Evaluating the performance of model transformation styles with Maude @ Sympos...
 
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
A conceptual framework for behavioural adaptation @ Meeting ASCENS 2011
 
IMT Welcome Day 2011
IMT Welcome Day 2011IMT Welcome Day 2011
IMT Welcome Day 2011
 
A Graph Syntax for Processes and Services @ Workshop WS-FM 2009
A Graph Syntax for Processes and Services @ Workshop WS-FM 2009A Graph Syntax for Processes and Services @ Workshop WS-FM 2009
A Graph Syntax for Processes and Services @ Workshop WS-FM 2009
 
An Algebra of Hierarchical Graphs
An Algebra of Hierarchical GraphsAn Algebra of Hierarchical Graphs
An Algebra of Hierarchical Graphs
 

Recently uploaded

Landownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptxLandownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptx
JezreelCabil2
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 

Recently uploaded (20)

Landownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptxLandownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptx
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 

State Space C-Reductions @ ETAPS Workshop GRAPHITE 2013

  • 1. State Space C-Reductions of Concurrent Systems in Rewriting Logic -- Alberto Lluch Lafuente, IMT Lucca -- José Meseguer, UIUC -- Andrea Vandin, IMT Lucca 2nd ETAPS Graphite Workshop, Rome, March 24, 2013 preliminary version presented at WRLA 2012 conference version presented at ICFEM 2012
  • 2. t ct i ons a l ng redu ion-leve “defini ecificat ” the sp several pros has
  • 3. running example $ = transfer of 1$ x$ = account with x$
  • 5. $ $ Isomorphic... Isomorphic... but syntactically different but syntactically different 0$ 0$ $ $ 1$ 0$ 0$ 1$ 1$ 1$
  • 6. symmetries in state space exploration problems
  • 7. some tools with symmetry reduction  Murphy [Ip&Dill @FMSD'96];  Symmetric SPIN [Bosnacki et al. @SPIN'00];  TopSPIN [Donaldson et al. @AMAST'06];  Groove [Rensink @GRABATS'06];  MiHDa [Montanari et al. @FMCO'02];  PRISM-symm [Ball et al. @CAV06];  Uppaal [Larsen et al. @ FORMATS 2003 ];  Planners, constraint and SAT solvers, etc.
  • 9. A ∼-canonizer for – a Kripke structure K – and an equivalence (bisimulation) relation ∼ ⊆ S × S is a function c : S → S such that s∼c(s) for all states s. c $ c $ 1$ 0$ 0$ 1$
  • 10. A ∼-canonizer is strong if s∼s' implies c(s) = c(s') (i.e. if canonical representatives of ∼-equivalence classes are unique) 2$ 1$ 3$ 2$ 1$ 3$ 1$ 3$ 2$ c c 1$ 3$ 2$ c c c 1$ 2$ 3$ 1$ 2$ 3$ 2$ 3$ 1$ 2$ 3$ 1$ c 3$ 1$ 2$ c 3$ 1$ 2$ c 3$ 2$ 1$ 3$ 2$ 1$ otherwise we call them weak.
  • 12. The c-reduction of a Kripke structure K = (S , → , L, AP) $ $ is Kc = (S , →;c , L, AP) 0$ 0$ $ $ 1$ 0$ c 0$ 1$ 1$ 1$
  • 13. Th. If c is a ∼-canonizer then Kc ∼ K.
  • 14. PERFORMANCE? t ct i ons a l ng redu ion-leve “defini ecificat ” the sp several pros has
  • 15. typical space reduction pattern sizes of the state-space no reduction strong reduction weak reduction size of the system
  • 16. typical time reduction pattern runtime no reduction strong reduction weak reduction size of the system
  • 17. will we have the same in Maude? Q1. Overhead of meta-level based c-reductions? Q2. Similar performance gains as model checkers? Q3. Performance for c-reductions not based on full permutations (e.g. rotations)?
  • 18. previous work on symmetry reduction with Maude reduction was much slower! Full symmetries in Maude [D.Rodriguez@WRLA'08]
  • 19. Q1. meta-level vs c-reductions? runtime (seconds) 90 80 meta-level 70 60 50 40 30 20 c-reductions 10 0 1 2 3 4 5 6 7 8 size of the system (instance parameter)
  • 20. Q2. Maude vs SymmSPIN? relative time reduction factor 2 no reduction symmSPIN 1.5 strong c-reduction weak c-reduction 1 0.5 0 2 3 4 5 size of the system -0.5 (instance parameter) -1 -1.5
  • 21. Q3. space reduction in dining philosophers states msg id reuse explored 600000 msg abstraction msg id reuse & permutations msg abstraction + philosopher rotation 500000 400000 300000 200000 100000 size of the system 0 2 3 4 5 6 7 8 9 (instance parameter)
  • 22. WE DO IT IN... REWRITING LOGIC / MAUDE t ct i ons a l ng redu ion-leve “defini ecificat ” the sp several pros has
  • 23. What is RL? A rewrite theory M is a tuple (Σ , E ∪ A , R , ϕ)  Σ = signature (e.g. syntax);  E = equations (e.g. functions); System states  A = axioms (e.g. ACI);  R = rules (e.g. non deterministic behaviour); System dynamics  ϕ = frozennes map (e.g. rewrite strategy).
  • 24. What is RL? A rewrite theory M is a tuple (Σ , E ∪ A , R , ϕ)  Σ = signature (e.g. syntax);  E = equations (e.g. functions); Not all equivalence relations ∼ Not all equivalence relations ∼ are tractable as axioms  A = axioms (e.g. ACI); are tractable as axioms  R = rules (e.g. non deterministic behaviour);  ϕ = frozennes map (e.g. rewrite strategy). Some assumptions:  Topmost rules for a designated [State] kind.
  • 25. --- The main module defining the signature and one initial state fmod BANK is ... sorts Object Message Configuration State . subsort Message Object < Configuration . op <_|_> : Nat Nat -> Object [ctor] . --- account id and balance op credit : Nat -> Message [ctor] . --- id of the target account op __ : Configuration Configuration -> Configuration [ctor assoc comm] . op none : -> Configuration [ctor] . op {_} : Configuration -> State [ctor frozen] . --- A simple initial state $ $ op init : -> Configuration . 0$ 0$ eq init = < 0 | 0 > < 1 | 0 > credit(0) credit(1) . endfm
  • 26. --- The behavioural rules of the example mod BANK-RULES is $ inc BANK . vars i x : Nat . x$ x+1$ vars c1 : Configuration . --- A simple rule for crediting an account rl [credit] : { < i | x > credit(i) c1 } => { < i | s(x) > c1 } . endm
  • 27. search without reduction $ $ 0$ 0$ Maude> search in BANK-RULES : {init} =>* s:State . $ $ Solution 1 (state 0) 1$ 0$ 0$ 1$ s:State --> {credit(0) credit(1) < 0 | 0 > < 1 | 0 >} Solution 2 (state 1) 1$ 1$ s:State --> {credit(1) < 0 | 1 > < 1 | 0 >} symmetric states Solution 3 (state 2) s:State --> {credit(0) < 0 | 0 > < 1 | 1 >} Solution 4 (state 3) s:State --> {< 0 | 1 > < 1 | 1 >} No more solutions. states: 4 rewrites: 6 in 0ms cpu (2ms real) (9523 rewrites/second)
  • 29. c-extension The c-extension of a rewrite theory M = ( , E ∪ A , R, ϕ) is M+c= ( ⊎ c , E ∪ Gc ∪ A , R, ϕc) i.e. a correct extension of R with the definition of c.
  • 30. c-extension (example of canonizer) --- The c-extension of BANK that defines the c-canonizer for object permutations mod BANK-C is ... op c : State -> [State] . apply transposition... vars i j x y : Nat . vars c1 : Configuration . ceq c( { < i | x > < j | y > c1 } ) = c( { [[ i <-> j ]]( < i | x > < j | y > c1 ) } ) if [[ i <-> j ]]( < i | x > < j | y > c1 ) <# < i | x > < j | y > c1 . If it provides eq c({c1}) = {c1} [ owise ] . “lexicographically” smaller states endm
  • 31. Identification of symmetric states Maude> red c( {credit(0) < 0 | 0 > < 1 | 1 >}) . result State: {credit(1) < 0 | 1 > < 1 | 0 >} $ 0$ 1$ c $ 1$ 0$
  • 33. The c-reduction of a rewrite theory M =( ,E∪A,R,ϕ) is M/c = ( ⊎ c , E ∪ Gc ∪ A , Rc , ϕc) cc where Rc is made of rules K(M/c) = K (M) K(M/c) = K (M) l => c(r) if cond for each rule of R l => r if cond
  • 34. module architecture BANK BANK-RULES (M) BANK-PERMUTATION BANK-C (M+c) BANK-C-REDUCTION (M/c)
  • 35. c-reduction (example) --- The c-reduction of BANK-RULES mod BANK-C-REDUCTION is inc BANK-C . rl [credit] : { < i | x > credit(i) c1 } => c({ < i | s(x) > c1 }) . endm
  • 36. search in c-reduced state space Maude> search in BANK-C-REDUCTION : {init} =>* s:State . search in BANK-C-REDUCTION : {init} =>* s:State . $ $ Solution 1 (state 0) 0$ 0$ s:State --> {credit(0) credit(1) < 0 | 0 > < 1 | 0 >} $ $ Solution 2 (state 1) c s:State --> {credit(1) < 0 | 1 > < 1 | 0 >} 1$ 0$ 0$ 1$ Solution 3 (state 2) s:State --> {< 0 | 1 > < 1 | 1 >} 1$ 1$ No more solutions. states: 3 rewrites: 25 in 0ms cpu (2ms real) (53648 rewrites/second)
  • 37. exploiting the c-reduced state space Another example: 4 accounts, 4 transfers for each Maude> search in BANK/C : {init(4,4)} =>* s:State . search in BANK/C : {init(4, 4)} =>* s:State . ... states: 70 rewrites: 14333 in 26ms cpu (26ms real) (536615 rewrites/second) Unreduced state space has 625 states Model checking example “eventually there will be no more transfers to process, forever” Maude> red modelCheck({init(4,4)}, <>[]~ some-message) . reduce in MUTEX-CHECK : modelCheck({init(4, 4)}, <> []~ some-message) . rewrites: 14485 in 17ms cpu (19ms real) (841906 rewrites/second) result Bool: true
  • 38. CHECKING CORRECTNESS OF REDUCTIONS t ct i ons a l ng redu ion-leve “defini ecificat ” the sp several pros has
  • 39. Does c provide a correct c-reduction? Th 1. “K(M/c) is bisimilar to K(M)” (desiderata) Lemma 0. “Relation ∼ is an equivalence relation” (i) Check that the action of the group is correct. Lemma 1. “Relation ∼ is a bisimulation” Proof plan for (ii) Check that ∼ strongly preserves AP; group-theoretic (iii) Check that ∼ and R “commute”. reductions Lemma 2. “Function c is a ∼-canonizer” (iv) Check that c is a ∼-canonizer.
  • 40. group theoretic equivalence relations The action ⟦ ⟧ of a group G on the set of states S defines an equivalence relation: s∼s' iff ⟦ f ⟧(s) = s' for some f ∈ G.
  • 43. (ii) Checking that ∼ strongly preserves AP IDEA: Define a rewrite theory M/G to “move” inside orbits: M/G = (Σ ⊎ ΣG, E ∪ EG ∪ A , RM/G , ϕ) where RM/G = { s => [[g]](s) , g in H} Theorem: ∼ strongly preserves AP if AP is stable in R∼.
  • 44. Can we check such stability automatically? Yes, with InvA (under some conditions) fmod BANK-AP is eq [two-dollars-eq] : two-dollars({ < i | s(s(x)) > c1 }) = true . endfm fmod BANK-PERMUTATION-RULES is rl [transposition] : { < i | x > < j | y > c1 } => { [[ i <-> j ]] ( < i | x > < j | y > c1) } . endm Maude> (analyze-stable two-dollars(s:State) in BANK-AP BANK-PERMUTATION-RULES .) rewrites: 15571 in 16ms cpu (19ms real) (918643 rewrites/second) Checking BANK-PERMUTATION-RULES ||- two-dollars => O two-dollars ... Proof obligations generated: 2 For non discharged proof obligations Proof obligations discharged: 2 For non discharged proof obligations Success! one can use the Maude ITP tool one can use the Maude ITP tool
  • 47. (iii) Checking that ∼ and R commute M For all M/G-transitions u → u' and u v M/G for all M-transitions from u to v. M/G * M u' v' M θ(l) θ(r) For all M/G-rules l' => r' and for all M-rules from l => r. M/G M/G Similar functionalities (e.g. critical pair generation) Similar functionalities (e.g. critical pair generation) are already available in some Maude tools M * are already available in some Maude tools θ(r') v' (e.g. in the Coherence Checker). (e.g. in the Coherence Checker).
  • 48. (iii) Checking that ∼ and R commute How do we check joinability of critical pairs (R rules vs R∼)? M For each M/G-rule l'=>r', M-rules l=>r do θ(l) θ(r) Compute the MGUs θ for l'=l For each θ do M/G Compute transitions θ(r')→θ(vi) Check if at least one θ(vi) M v1 is reachable from θ(r') NOTE 1: Can be done using Maude's ... unify and search commands. θ(r') vn M/G NOTE 2: We are currently implementing a M tool for this.
  • 50. t ct i ons a l ng redu ion-leve “defini ecificat ” the sp several pros has
  • 51. preliminary version presented at WRLA 2012 conference version presented at ICFEM 2012 yet more work is to be done...  Better integration in Maude  Conciliate with other state space reduction techniques;  Tool support and its integration in MFE.  Beyond group theoretic symmetries  Abstractions that yield bisimulations?  Axiomatisations of bisimulations in process algebras?  Beyond bisimulation  Weak bisimulation? Trace equivalence (for LTL)?
  • 52. thanks! alberto.lluch@imtlucca.it http://www.albertolluch.com http://www.linkedin.com/in/albertolluch http://www.imtlucca.it/alberto.lluch+lafuente State Space C-Reductions (full manuscript) http://eprints.imtlucca.it/1350/