Rewriting logic with Maude Lars Tveito June 1, 2015
Introduction Maude is a system for writing system specifications.
Introduction Maude is a system for writing system specifications. Systems are modeled using equational and rewriting logic.
Introduction Maude is a system for writing system specifications. Systems are modeled using equational and rewriting logic. Maude has tools for exploring the state space for properties.
Introduction Maude is a system for writing system specifications. Systems are modeled using equational and rewriting logic. Maude has tools for exploring the state space for properties. A model-checker is provided.
Introduction Maude is a system for writing system specifications. Systems are modeled using equational and rewriting logic. Maude has tools for exploring the state space for properties. A model-checker is provided. Rewriting logic is reflective; this allows for meta-modeling.
Introduction Maude is a system for writing system specifications. Systems are modeled using equational and rewriting logic. Maude has tools for exploring the state space for properties. A model-checker is provided. Rewriting logic is reflective; this allows for meta-modeling. This greatly enhances it’s expressive power (for instance, LTL can be modeled in maude, which is done in its model-checker).
Introduction Maude is a system for writing system specifications. Systems are modeled using equational and rewriting logic. Maude has tools for exploring the state space for properties. A model-checker is provided. Rewriting logic is reflective; this allows for meta-modeling. This greatly enhances it’s expressive power (for instance, LTL can be modeled in maude, which is done in its model-checker). Additional tools, like confluence checker, completeness checker and a theorem prover can be acquired.
Introduction Maude is a system for writing system specifications. Systems are modeled using equational and rewriting logic. Maude has tools for exploring the state space for properties. A model-checker is provided. Rewriting logic is reflective; this allows for meta-modeling. This greatly enhances it’s expressive power (for instance, LTL can be modeled in maude, which is done in its model-checker). Additional tools, like confluence checker, completeness checker and a theorem prover can be acquired. A LTLR model checker exits; this could be interesting for this talk, but is not examined further here.
Signatures A signature consists of a set of sorts, and a set of function symbol declarations.
Signatures A signature consists of a set of sorts, and a set of function symbol declarations. Definition[4]: A many-sorted signature ( S , Σ) consists of a set S , whose elements are sorts, and an S ∗ × S -sorted family { Σ w , s | w ∈ S ∗ , s ∈ S } of function symbols. Σ w , s is the set of function symbols with arity w and value of sort s . We can write f : w → s ∈ Σ for Σ w , s . If w is the empty word, then f is often called a constant of sort s .
Ground terms We can express ground terms using only constants and function symbols.
Ground terms We can express ground terms using only constants and function symbols. Definition[4]: Given a many-sorted signature ( S , Σ) , we can define a S -sorted set of ground terms T Σ = {T Σ , s | s ∈ S } inductively: Σ ǫ, s ⊆ T Σ , s . Every constant of sort s is a ground term of sort s . If f ∈ Σ s 1 ,..., s n , s and t 1 ∈ T Σ , s 1 , ..., t n ∈ T Σ , sn and 1 ≥ n , then f ( t 1 , ..., t n ) ∈ T Σ , s . A function applied to ground terms of the right sort are also ground terms. Each set T Σ , s is the smallest set that satisfies the above conditions.
Variables Variables are placeholders for terms .
Variables Variables are placeholders for terms . Definition[4]: Given a many-sorted signature ( S , Σ) , a variable set X is a S -sorted family X = { X s | s ∈ S } of pairwise disjoint sets, also disjoint from Σ .
Variables Variables are placeholders for terms . Definition[4]: Given a many-sorted signature ( S , Σ) , a variable set X is a S -sorted family X = { X s | s ∈ S } of pairwise disjoint sets, also disjoint from Σ . Note that: The definition implies that no variable have different sorts, so X s ∩ X s ′ = ∅ should hold. Also, the definition implies that a variable cannot be a function-symbol, so X s ∩ Σ = ∅ .
Terms Terms are just like ground terms, that can also contain free variables.
Terms Terms are just like ground terms, that can also contain free variables. Definition[4]: Given a many-sorted signature ( S , Σ) , and a variable set X = { X s | s ∈ S } , the S -sorted set of terms T Σ ( X ) = {T Σ , s ( X ) | s ∈ S } can be defined inductively: X s ⊆ T Σ , s ( X ) for s ∈ S ; a variable of sort s is also a term of sort s . Σ ǫ, s ⊆ T Σ , s ( X ) for s ∈ S ; a constant of sort s is also a term of sort s . f ( t 1 , ... t n ) ∈ T Σ , s ( X ) if f ∈ Σ s 1 ... s n , s and t i ∈ T Σ , s i ( X ) for each 1 ≤ i ≤ n . T Σ ( X ) is the smallest S -sorted set satisfying the above conditions.
Rewriting Typically a an equational theory (Σ , E ) represents the static part of a system (things that don’t change)[3].
Rewriting Typically a an equational theory (Σ , E ) represents the static part of a system (things that don’t change)[3]. A rewrite theory R = (Σ , E , R ) the dynamic part of a system (where things do change).
Rewriting Typically a an equational theory (Σ , E ) represents the static part of a system (things that don’t change)[3]. A rewrite theory R = (Σ , E , R ) the dynamic part of a system (where things do change). The strengths of rewriting comes from naturally being able to express systems that are: Non-deterministic (or non-confluent) Concurrent Distributed
Rewriting Typically a an equational theory (Σ , E ) represents the static part of a system (things that don’t change)[3]. A rewrite theory R = (Σ , E , R ) the dynamic part of a system (where things do change). The strengths of rewriting comes from naturally being able to express systems that are: Non-deterministic (or non-confluent) Concurrent Distributed In other words; we need rewriting rules to model state change .
Substitution Substitution is a mapping from a variables to terms[4][1].
Substitution Substitution is a mapping from a variables to terms[4][1]. Substitutions are functions on the form: { x 1 �→ t 1 , ..., x n �→ t n }
Substitution Substitution is a mapping from a variables to terms[4][1]. Substitutions are functions on the form: { x 1 �→ t 1 , ..., x n �→ t n } It is a function σ : X → T Σ ( Y ) , where X is a set of variables and T Σ (Y) is a set of terms.
Substitution Substitution is a mapping from a variables to terms[4][1]. Substitutions are functions on the form: { x 1 �→ t 1 , ..., x n �→ t n } It is a function σ : X → T Σ ( Y ) , where X is a set of variables and T Σ (Y) is a set of terms. σ is extended to σ : T Σ ( X ) → T Σ ( Y ) , which takes a term and simultaneously replaces each variable in a term t according to the substitution.
Substitution Substitution is a mapping from a variables to terms[4][1]. Substitutions are functions on the form: { x 1 �→ t 1 , ..., x n �→ t n } It is a function σ : X → T Σ ( Y ) , where X is a set of variables and T Σ (Y) is a set of terms. σ is extended to σ : T Σ ( X ) → T Σ ( Y ) , which takes a term and simultaneously replaces each variable in a term t according to the substitution. Example Given a substitution σ = { x �→ a , y �→ f ( b ) } and a term t = g ( x , f ( y )) then σ t is g ( a , f ( f ( b ))) .
Matching Definition[4]: Given a term t and a term u , then t matches u if there is a substitution such that σ t = u .
Matching Definition[4]: Given a term t and a term u , then t matches u if there is a substitution such that σ t = u . Example Given a term t = g ( x , f ( y )) and a term u = g ( a , f ( f ( b ))) , then t matches u because σ g ( x , f ( y )) = g ( a , f ( f ( b ))) where σ is the substitution σ = { x �→ a , y �→ f ( b ) } .
Equations and rewrite rules A rewrite rule consists of a label , a left-hand side term t and a right-hand side t ′ .
Equations and rewrite rules A rewrite rule consists of a label , a left-hand side term t and a right-hand side t ′ . The semantics of a rewrite rule is that a term t may become t ′ ; rules can (conceptually) be applied concurrently.
Equations and rewrite rules A rewrite rule consists of a label , a left-hand side term t and a right-hand side t ′ . The semantics of a rewrite rule is that a term t may become t ′ ; rules can (conceptually) be applied concurrently. An equation is just a rewrite rule with a few underlying assumptions.
Equations and rewrite rules A rewrite rule consists of a label , a left-hand side term t and a right-hand side t ′ . The semantics of a rewrite rule is that a term t may become t ′ ; rules can (conceptually) be applied concurrently. An equation is just a rewrite rule with a few underlying assumptions. An equation is symmetric (so t = t ′ and t ′ = t ).
Recommend
More recommend