The Maude 2.0 System. M. Clavel F. Durán S. Eker P. Lincoln. N. Martí-Oliet J. Meseguer C. Talcott

Similar documents
The Maude LTL LBMC Tool Tutorial

Program analysis parameterized by the semantics in Maude

Specification and Analysis of Real-Time Systems Using Real-Time Maude

CS422 - Programming Language Design

Software Specification and Verification in. Rewriting Logic: Lecture 1

Maude 2.0 Manual. Version 1.0. Manuel Clavel Francisco Durán Steven Eker Patrick Lincoln Narciso Martí-Oliet José Meseguer Carolyn Talcott

Unification in Maude. Steven Eker

CRC 3: A Church-Rosser Checker Tool for Conditional Order-Sorted Equational Maude Specifications

CafeOBJ. CafeOBJ. Starting CafeOBJ. Wolfgang Schreiner 1. A Quick Overview. 2.

Specifying, programming, and verifying in Maude

Analysis of the Suzuki-Kasami Algorithm with the Maude Model Checker

The Maude LTL Model Checker and Its Implementation

Maude Manual (Version 2.5) Manuel Clavel Francisco Durán Steven Eker Patrick Lincoln Narciso Martí-Oliet José Meseguer Carolyn Talcott

The Maude Formal Tool Environment

Mechanical Approach to Linking Operational Semantics and Algebraic Semantics for Verilog using Maude

What s New in Maude 2.4

Proving Modal Properties of Rewrite Theories Using Maude s Metalevel

A predicate abstraction tool for Maude

Declarative Debugging of Membership Equational Logic Specifications

CS422 - Programming Language Design

Computing Fundamentals 2 Introduction to CafeOBJ

A Rewriting Semantics for Maude Strategies

This article appeared in a journal published by Elsevier. The attached copy is furnished to the author for internal non-commercial research and

On-demand evaluation for Maude 1

4.3 Lists of natural numbers Binary trees with natural numbers Specications with equat

3.1 IMP: A Simple Imperative Language

Maude-NPA, Version 3.0

BOBJ: A Quickstart for Software Engineers

Semantics and Pragmatics of Real-Time Maude

Formal Modeling and Analysis of AADL Threads in Real Time Maude

Towards Integrated Specification and Analysis of Machine-Readable Policies Using Maude 1

The ITP Tool s Manual

JOURNAL OF OBJECT TECHNOLOGY

Defining Datalog in Rewriting Logic

Maude-NPA, Version 2.0 (November 26th, 2011)

Maude-NPA, Version 1.0

Towards a Module System for K

Built-in Module BOOL. Lecture Note 01a

CONVENTIONAL EXECUTABLE SEMANTICS. Grigore Rosu CS422 Programming Language Design

Formal Simulation and Analysis of the CASH Scheduling Algorithm in Real-Time Maude

arxiv: v5 [cs.fl] 12 Nov 2014

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic

RLSRunner: Linking Rascal with K for Program Analysis

Maude: specication and programming in rewriting logic

Implementing Datalog in Maude

Formal Modeling and Analysis of the OGDC Wireless Sensor Network Algorithm in Real-Time Maude

International Conference on Rewriting Techniques and Applications 2010 (Edinburgh), pp

Formal Analysis of Workflow Systems with Security Considerations

Executable Structural Operational Semantics in Maude

Haskell Overview III (3A) Young Won Lim 10/4/16

The Journal of Logic and Algebraic Programming

3.7 Denotational Semantics

Review of Data Representation & Binary Operations Dhananjai M. Rao CSA Department Miami University

Operators in C. Staff Incharge: S.Sasirekha

Formal checklists for remote agent dependability

Algebraic specification and verification with CafeOBJ Part 1 Introduction

Rewriting Needs Constraints and Constraints Need Rewriting

A Guide to Extending Full Maude Illustrated with the Implementation of Real-Time Maude

FORMALLY MODELING UML AND ITS EVOLUTION: A HOLISTIC APPROACH Ambrosio Toval Álvarez Software Engineering Research Group, Department of Informatics: La

Lexical Considerations

K-Maude. K-Maude. A Rewriting Based Tool for Semantics of Programming Languages. University of Illinois at Urbana-Champaign WRLA / 66

UNIT- 3 Introduction to C++

Rewriting Semantics of Production Rule Sets

UML Modeling and Formal Verification of control/data driven Embedded Systems

Twenty Years of Rewriting Logic

Using big-step and small-step semantics in Maude to perform declarative debugging

the Common Algebraic Specification Language

Formal Modeling and Analysis of Wireless Sensor Network Algorithms in Real-Time Maude

Model checking pushdown systems

1 Lexical Considerations

Modular Language Specifications for Program Analysis

MMT case study: distributed algorithms

Tool demonstration: Spin

An introduction introduction to functional functional programming programming using usin Haskell

Specification and Analysis of the AER/NCA Active Network Protocol Suite in Real-Time Maude

Haskell Overview II (2A) Young Won Lim 8/9/16

The Algebraic Specification of Multi-core and Multi-threaded Microprocessors

The Algebraic Specification of Multi-core and Multi-threaded Microprocessors

CS201 Some Important Definitions

CMSC 330: Organization of Programming Languages

Rewriting Logic using Strategies for Neural Networks: an Implementation in Maude

Towards a Rewriting Semantics for a Software Architecture Description Language

Introduction to dependent types in Coq

These are reserved words of the C language. For example int, float, if, else, for, while etc.

Type Checking. Outline. General properties of type systems. Types in programming languages. Notation for type rules.

Computer System and programming in C

Formal and Tool Support for Model Driven Engineering with Maude

Lexical Considerations

Outline. General properties of type systems. Types in programming languages. Notation for type rules. Common type rules. Logical rules of inference

Computing the Parallelism Degree of Timed BPMN Processes

A Modular Rewriting Semantics for CML

The Leader Election Protocol of IEEE 1394 in Maude

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Haske k ll An introduction to Functional functional programming using Haskell Purely Lazy Example: QuickSort in Java Example: QuickSort in Haskell

C Programming Language (Chapter 2 of K&R) Variables and Constants

Propositional Calculus. Math Foundations of Computer Science

A Model-driven Approach for the Analysis of Multimedia Documents

Math-2. Lesson 3-1. Equations of Lines

Formal Specification and Verification

Evaluation of Datalog queries and its application to the static analysis of Java code

Transcription:

The Maude 2.0 System M. Clavel F. Durán S. Eker P. Lincoln N. Martí-Oliet J. Meseguer C. Talcott 1

Overview Maude is a language based on rewriting logic. Type system is based on membership equation logic. Equations are assumed to be confluent and terminating; used for conventional algebraic specification & functional programming. Rewrite rules are assume to be coherent w.r.t. equations (Viry); used to express inference & state change. Maude modules themselves form an algebraic data type - metaprogramming; extension via reflection. Can be used as a semantic framework to specify & prototype other languages and as a logical framework to represent & mechanize other logics. Maude 2.0 is the latest incarnation. 2

Supports AC, ACU, A, AU. New Term Representation Based on persistent data structures. Reduces the computational complexity of E-rewriting for large subjects and simple patterns. fmod REV-LIST is sort List Elt. subsort Elt < List. op nil : -> List. op : List List -> List [assoc id: nil]. ops a b c d e : -> Elt. vars E E2 : Elt. var L : List. 3

New Term Representation (2) op rev : List -> List. eq rev(nil) = nil. eq rev(e L) = rev(l) E. op rev2 : List -> List. eq rev2(nil) = nil. eq rev2(e) = E. eq rev2(e L E2) = E2 rev2(l) E. op rev3 : List -> List. eq rev3(nil) = nil. eq rev3(l E) = E rev3(l). endfm All three naive list reversal algorithms run in linear time! 4

Conditions Rather than a single equality, conditions now allow a list of condition fragments, separated by /\. 4 types of fragments; last type is for rule conditions only: term = term term : sort pattern := term term => pattern equality test sort test assignment by matching rewrite proof search Patterns may have unbound variables that are bound by matching; regular terms are reduced upto strategy. Failure of a fragment causes backtracking. 5

Iter Attribute Allows efficient storage, i/o and sort computations for huge towers of unary operator symbols. Main application is the efficient implementation of natural numbers using the successor notation. fmod ITER-TEST is sorts Even Odd Nat. subsorts Even Odd < Nat. op 0 : -> Even. op s_ : Even -> Odd [iter]. op s_ : Odd -> Even [iter]. endfm red s_^123456789(0). red s_^1234567890(0). 6

Natural Numbers Nats are constructed using successor operator and the iter attribute. fmod NAT is sorts Zero NzNat Nat. subsort Zero NzNat < Nat. op 0 : -> Zero [ctor]. op s_ : Nat -> NzNat [ctor iter special (...)].... endfm Decimal i/o by default. Built-in operators very efficient (use GNU GMP). Gcd, lcm, mod exp, bitwise ops. 7

Natural Numbers (continued) red in NAT : gcd(18, gcd(x:nat, 12)). fmod COMBINATORIAL is protecting NAT. op _! : Nat -> NzNat. op C : Nat Nat -> Nat. vars N M : Nat. eq 0! = s 0. eq (s N)! = s N * N!. eq C(N, M) = N! quo (M! * sd(n, M)!). endfm red 1000!. red C(1000, 100). 8

Other Built-ins Integers (constructed from Nats). subsorts NzNat < NzInt Nat < Int. op -_ : NzNat -> NzInt [...]. Rationals (constructed from Ints and Nats). subsorts NzInt < NzRat Int < Rat. op _/_ : NzInt NzNat -> NzRat [...]. IEEE Floating Point Numbers. Strings (using SGI Rope package). Comprehensive set of conversion functions. 9

LTL Model Checker Linear Temporal Logic manipulations (simplifications and negative normal form) are done by Maude code. The satisfaction of (possibly parameterized) propositions are defined in Maude. On-the-fly model checking is done by a built-in operation op modelcheck : State Formula ~> ModelCheckResult [special (...)]. Implementation uses state-of-the-art Buchi automaton construction algorithm and standard double depth first search of the synchronous product for a counterexample. LTL Satisfiability solving and tautology checking also provided. 10

New Meta Level Simpler metaterm representation: 1.0 + X:Float is meta-represented as _+_[ 1.0.FiniteFloat, X:Float] Many more descent functions such as metaxapply() (with contexts) and metasearch(). Descent functions return sorts of terms. Ascent functions to inspect modules in database. Much more sophisticated caching at module and operator level. 11

Term Coloring Color (possibly intermediate) results based on reduced flag and constructor status to flag problems. set print color on. reduced, ctor reduced, non-ctor, colored below reduced, non-ctor, no colored below unreduced, no reduced above unreduced, reduced directly above unreduced, reduced not directly above not colored blue red green magenta cyan Red and magenta denote likely origin of problem, blue and cyan denote secondary damage. 12

Format Attribute Allows control of white-space, color and style for pretty-printing operators. Format words are given for each white-space position. s space r red R background red t tab g green G background green + increment indent counter b blue B background blue - decrement indent counter y yellow Y background yellow i indent by indent counter m magenta M background magenta n new line c cyan C background cyan f flash w white W background white h hidden p black P background black d default spacing u underline x reverse video o original style! bright? dim 13

Format Attribute (2) op while _ do _ od : Bool Statement -> Statement. ^ ^ ^ ^ ^ ^ op let _ := _ : Variable Expression -> Statement. ^ ^ ^ ^ ^ op while _ do _ od : Bool Statement -> Statement [format (nir! o r! o++ --nir! o)]. op let _ := _ : Variable Expression -> Statement [format (nir! o d d d)]. 14

Profiling. Other New Features Break points (on symbols or labeled statements). Rewrite search, dump of rewrite graph. Kind level declarations & on-the-fly variable declarations. Command line editing (Tecla). Frozen attribute. Position fair & object-message rewriting. Statement attributes: owise, label, nonexec, metadata. Optimizations: left-to-right sharing, order sorted discrimination nets, substitution slot coloring. More powerful module operations in Full Maude. 15

Runs under Unix (all flavors). Licensed under GNU GPL. Availability Source tree, manual, examples and binaries for selected architectures available from the new Maude website: http://maude.cs.uiuc.edu/ 16