Maude 6. Maude [1] UIUC J. Meseguer. Maude. Maude SRI SRI. Maude. AC (Associative-Commutative) Maude. Maude Meseguer OBJ LTL SPIN

Σχετικά έγγραφα
Εφαρμογές της Λογικής στην Πληροφορική

var N : SNat. eq (s(n) = 0) = false. και eq (s(n: SNat) = 0) = false.

Σχολή Εφαρμοσμένων Μαθηματικών και Φυσικών Επιστημών. Εθνικό Μετσόβιο Πολυτεχνείο. Thales Workshop, 1-3 July 2015

Dynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016

Answers - Worksheet A ALGEBRA PMT. 1 a = 7 b = 11 c = 1 3. e = 0.1 f = 0.3 g = 2 h = 10 i = 3 j = d = k = 3 1. = 1 or 0.5 l =

The challenges of non-stable predicates

Σειρά Προβλημάτων 1 Λύσεις

EM Baum-Welch. Step by Step the Baum-Welch Algorithm and its Application 2. HMM Baum-Welch. Baum-Welch. Baum-Welch Baum-Welch.

2016 IEEE/ACM International Conference on Mobile Software Engineering and Systems

at 3 at 13 (r1=1 r2=1)

LTL to Buchi. Overview. Buchi Model Checking LTL Translating LTL into Buchi. Ralf Huuck. Buchi Automata. Example

Εργαστήριο Οργάνωσης Η/Υ. Δαδαλιάρης Αντώνιος

❷ s é 2s é í t é Pr 3

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

Quick algorithm f or computing core attribute

Distances in Sierpiński Triangle Graphs

Orthogonalization Library with a Numerical Computation Policy Interface

ΕΠΑΝΑΛΗΠΤΙΚΑ ΘΕΜΑΤΑ 2014

Chapter 6 BLM Answers

VSC STEADY2STATE MOD EL AND ITS NONL INEAR CONTROL OF VSC2HVDC SYSTEM VSC (1. , ; 2. , )

FX10 SIMD SIMD. [3] Dekker [4] IEEE754. a.lo. (SpMV Sparse matrix and vector product) IEEE754 IEEE754 [5] Double-Double Knuth FMA FMA FX10 FMA SIMD

Commutative Monoids in Intuitionistic Fuzzy Sets

ΤΕΧΝΙΚΕΣ ΑΥΞΗΣΗΣ ΤΗΣ ΑΠΟΔΟΣΗΣ ΤΩΝ ΥΠΟΛΟΓΙΣΤΩΝ I

GPU. CUDA GPU GeForce GTX 580 GPU 2.67GHz Intel Core 2 Duo CPU E7300 CUDA. Parallelizing the Number Partitioning Problem for GPUs

ΓΡΑΜΜΙΚΟΣ & ΔΙΚΤΥΑΚΟΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ

ΕΠΛ 664 Ανάλυση και Επαλήθευση Συστημάτων 6-1

Homework 3 Solutions

Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in

Λειτουργικά Συστήματα

Study on Re-adhesion control by monitoring excessive angular momentum in electric railway traction

Lecture 2. Soundness and completeness of propositional logic

MIDI [8] MIDI. [9] Hsu [1], [2] [10] Salamon [11] [5] Song [6] Sony, Minato, Tokyo , Japan a) b)

ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ

Verification. Lecture 12. Martin Zimmermann

A Method for Creating Shortcut Links by Considering Popularity of Contents in Structured P2P Networks

Overview. Transition Semantics. Configurations and the transition relation. Executions and computation

Vol. 31,No JOURNAL OF CHINA UNIVERSITY OF SCIENCE AND TECHNOLOGY Feb

Development of the Nursing Program for Rehabilitation of Woman Diagnosed with Breast Cancer

Εισαγωγή στο εργαλείο SPIN

ΕΠΛ 664 Ανάλυση και Επαλήθευση Συστημάτων 1-1

Scrub Nurse Robot: SNR. C++ SNR Uppaal TA SNR SNR. Vain SNR. Uppaal TA. TA state Uppaal TA location. Uppaal

ΕΠΛ 664 Ανάλυση και Επαλήθευση Συστημάτων 1-1

Γραμμική Χρονική Λογική (Linear Temporal Logic)

IPSJ SIG Technical Report Vol.2014-CE-127 No /12/6 CS Activity 1,a) CS Computer Science Activity Activity Actvity Activity Dining Eight-He

Mock Exam 7. 1 Hong Kong Educational Publishing Company. Section A 1. Reference: HKDSE Math M Q2 (a) (1 + kx) n 1M + 1A = (1) =

Πανεπιστήμιο Δυτικής Μακεδονίας. Τμήμα Μηχανικών Πληροφορικής & Τηλεπικοινωνιών. Τεχνητή Νοημοσύνη. Ενότητα 2: Αναζήτηση (Search)

- Αναπαράσταση ακέραιας τιµής : - Εύρος ακεραίων : - Ακέραιοι τύποι: - Πράξεις µε ακεραίους (DIV - MOD)

Homework 8 Model Solution Section

Toward a SPARQL Query Execution Mechanism using Dynamic Mapping Adaptation -A Preliminary Report- Takuya Adachi 1 Naoki Fukuta 2.

Re-Pair n. Re-Pair. Re-Pair. Re-Pair. Re-Pair. (Re-Merge) Re-Merge. Sekine [4, 5, 8] (highly repetitive text) [2] Re-Pair. Blocked-Repair-VF [7]

HIV HIV HIV HIV AIDS 3 :.1 /-,**1 +332

Η Διαδραστική Τηλεδιάσκεψη στο Σύγχρονο Σχολείο: Πλαίσιο Διδακτικού Σχεδιασμού

Formal Semantics. 1 Type Logic

[4] 1.2 [5] Bayesian Approach min-max min-max [6] UCB(Upper Confidence Bound ) UCT [7] [1] ( ) Amazons[8] Lines of Action(LOA)[4] Winands [4] 1

Every set of first-order formulas is equivalent to an independent set

An Automatic Modulation Classifier using a Frequency Discriminator for Intelligent Software Defined Radio

BMI/CS 776 Lecture #14: Multiple Alignment - MUSCLE. Colin Dewey

Μελέτη των μεταβολών των χρήσεων γης στο Ζαγόρι Ιωαννίνων 0

Solving an Air Conditioning System Problem in an Embodiment Design Context Using Constraint Satisfaction Techniques

The Simply Typed Lambda Calculus

Optimization, PSO) DE [1, 2, 3, 4] PSO [5, 6, 7, 8, 9, 10, 11] (P)

Trigonometry 1.TRIGONOMETRIC RATIOS

{takasu, Conditional Random Field

Living and Nonliving Created by: Maria Okraska

HY340, 2009 Α. Σαββίδης Slide 2 / 143. HY340, 2009 Α. Σαββίδης Slide 3 / 143. HY340, 2009 Α. Σαββίδης Slide 4 / 143

: Monte Carlo EM 313, Louis (1982) EM, EM Newton-Raphson, /. EM, 2 Monte Carlo EM Newton-Raphson, Monte Carlo EM, Monte Carlo EM, /. 3, Monte Carlo EM

Matrices and vectors. Matrix and vector. a 11 a 12 a 1n a 21 a 22 a 2n A = b 1 b 2. b m. R m n, b = = ( a ij. a m1 a m2 a mn. def

Newman Modularity Newman [4], [5] Newman Q Q Q greedy algorithm[6] Newman Newman Q 1 Tabu Search[7] Newman Newman Newman Q Newman 1 2 Newman 3

CTL - Λογική Δένδρου Υπολογισμού

ΔΙΠΛΩΜΑΤΙΚΕΣ ΕΡΓΑΣΙΕΣ

Chap. 6 Pushdown Automata

Τοποθέτηση τοπωνυµίων και άλλων στοιχείων ονοµατολογίας στους χάρτες

Discriminantal arrangement

Durbin-Levinson recursive method

Legal use of personal data to fight telecom fraud

Γραμμική και διακλαδωμένη χρονική λογική

ΕΠΛ664 ΑΝΑΛΥΣΗ ΚΑΙ ΕΠΑΛΗΘΕΥΣΗ ΣΥΣΤΗΜΑΤΩΝ

Section 7.6 Double and Half Angle Formulas

Προγραμματισμός PASCAL

ΠΡΟΣΟΜΟΙΩΣΗ ΘΕΩΡΙΑ 1. H αρχική οθόνη του Open Roberta lab

Research on Economics and Management

Protecting Critical ICT Infrastructures

«Συμπεριφορά μαθητών δευτεροβάθμιας εκπαίδευσης ως προς την κατανάλωση τροφίμων στο σχολείο»

Approximation of distance between locations on earth given by latitude and longitude

MICROMASTER Vector MIDIMASTER Vector

1 (forward modeling) 2 (data-driven modeling) e- Quest EnergyPlus DeST 1.1. {X t } ARMA. S.Sp. Pappas [4]

Buried Markov Model Pairwise

The Pohozaev identity for the fractional Laplacian

entailment Hoare triple Brotherston Brotherston

How do loss and delay occur?

Fractional Colorings and Zykov Products of graphs

GREECE BULGARIA 6 th JOINT MONITORING

Retrieval of Seismic Data Recorded on Open-reel-type Magnetic Tapes (MT) by Using Existing Devices

Resurvey of Possible Seismic Fissures in the Old-Edo River in Tokyo

From Secure e-computing to Trusted u-computing. Dimitris Gritzalis

CSLab National Technical University of Athens

CTL - Λογική Δένδρου Υπολογισμού (ΗR Κεφάλαιο 3.4)

ER-Tree (Extended R*-Tree)

Δομή Επανάληψης. Κεφάλαιο 7 Mike Trimos

Section 8.3 Trigonometric Equations

Transcript:

78 Maude 1 Maude [1] UIUC J. Meseguer ( 1 ) ( ) Maude Maude SRI 90 UIUC SRI Maude SRI S. Eker C++ Maude 2 Maude Meseguer OBJ 1983-84 OBJ2[3] OBJ Maude OBJ 1 CafeOBJ 3 Maude 4 Maude CafeOBJ Maude: A Computer Language based on Rewriting Logic and its Implementation. Kazuhiro Ogata, Masaki Nakamura, Kokichi Futatsugi,, School of Information Science, JAIST., Vol.25, No.2 (2008), pp.78 84. [ ] 2007 12 27. 1 Real-Time Maude 2 http://maude.cs.uiuc.edu/ 3 http://www.ldl.jaist.ac.jp/cafeobj/ 4 Meseguer Maude [1] [4] Eker Maude SRI (1993-97) [1] [2] ( ) ( ) Maude [1] 800 AC (Associative-Commutative) (LTL search ) LTL SPIN (on-the-fly explicit state) SMV BDD SPIN SPIN Maude 5 Maude 6 5 SRI SAL infbmc 6 CafeOBJ search LTL SAL

Vol. 25 No. 2 Apr. 2008 79 ( ) [5] search ( ) ( ) Maude 2 Maude 7 2 8 (fmod M is endfm) (sort S.) (subsort S 1 < S 2.) (op f : S 1... S n -> S [ ].) ([c]eq LHS = RHS [if C].) ([c]mb T : S [if C].) S 1 < S 2 S 1 S 2 f (assoc) (comm) LHS RHS C C RHS LHS C T S C C C C 1 /\... /\ C n C 7 (LTL ) 8 C 1,..., C n C i (1) (T = T ) (2) (T := T ) (3) Bool T (3) (1)(T = true) (1) (2) T LHS C 1,...,C i 1 (2) T T 9 (1) T T 10 (2) T LHS T T 11 (mod M is ) ([c]rl [[L] :] LHS => RHS [if C].) L LHS RHS C C ( ) RHS LHS C t 0 1 t 0 t 0 t 1 1 t 0 t 1 12 C C 1 /\... /\ C n C i (1) (3) (4) (T => T ) (4) T LHS C 1,...,C i 1 T T (4) T 9 T ( ) 10 == true false (3) T == T (1) 11 12 LHS

80 0 T M ( ) 3 (pr) (ex) (inc) pr M M (no junk) (no confusion) M ex M M inc M M 3 (Critical Section) (Remainder Section) i Loop Remainder Section rs: tmp i := enq(queue,i); es: queue := tmp i ; ws: repeat until top(queue) =i; Critical Section cs: tmp i := deq(queue); ds: queue := tmp i ; queue tmp i 13 enq deq top rs es ws cs ds ws ( ) 1 rs tmp i queue (empty ) 4 Maude S 0 S 0 Maude S 0 V 0 I 0 T 0 13 tmp i queue ( ) 2 V 0 {pc i :Label i P} {tmp i : Queue i P} {queue : Queue} Label Queue P ( Pid ) pc i i ( ) tmp i i tmp i queue queue S 0 V 0 S 0 I 0 i P pc i =rs tmp i =empty queue =empty ( 1 ) T 0 {eq 1 i i P} {eq 2 i i P} {wt i i P} {dq1 i i P} {dq2 i i P} wt i i ws 1 eq1 i eq2 i dq1 i dq2 i i rs es cs ds (1) eq1 i (2) wt i (1) eq1 i pc i =rs pc i es tmp i queue i (2) wt i pc i =ws queue i pc i cs S 0 QLOCK QLOCK mod QLOCK is pr LABEL. pr PID. pr QUEUE. sorts Var Sys. subsort Var < Sys. op : Sys Sys -> Sys [assoc comm]. op pc[_]:_ : Pid Label -> Var. op queue:_ : Queue -> Var. op tmp[_]:_ : Pid Queue -> Var. vars Q R : Queue. var I : Pid. rl [eq1] : (pc[i]: rs) (queue: Q) (tmp[i]: R) => (pc[i]: es) (queue: Q) (tmp[i]: enq(q,i)). rl [eq2] : (pc[i]: es) (queue: Q) (tmp[i]: R) => (pc[i]: ws) (queue: R) (tmp[i]: R). crl [wt] : (pc[i]: ws) (queue: Q) => (pc[i]: cs) (queue: Q) if top(q) == I.

Vol. 25 No. 2 Apr. 2008 81 rl [dq1] : (pc[i]: cs) (queue: Q) (tmp[i]: R) => (pc[i]: ds) (queue: Q) (tmp[i]: deq(q)). rl [dq2] : (pc[i]: ds) (queue: Q) (tmp[i]: R) => (pc[i]: rs) (queue: R) (tmp[i]: R). LABEL PID QUEUE fmod LABEL is sort Label. ops rs es ws cs ds : -> Label. endfm fmod PID is sort Pid. ops p1 p2 : -> Pid. endfm fmod QUEUE is pr PID. sort Queue. op empty : -> Queue. op : Pid Queue -> Queue. op enq : Queue Pid -> Queue. op deq : Queue -> Queue. op top : Queue -> Pid. var Q : Queue. vars X Y : Pid. eq enq(empty,x) = X empty. eq enq((y Q),X) = Y enq(q,x). eq deq(empty) = empty. eq deq((x Q)) = Q. eq top((x Q)) = X. endfm PID 2 ( ) p1 p2 Sys S 0 Var ( ) pc[_]:_ queue:_ tmp[_]:_ pc i queue tmp i pc[_]:_ tmp[_]:_ 1 i 2 pc i tmp i queue:_ queue pc i cs pc[i]: cs S 0 14 S 0 14 SPIN Maude ( ) Z ( ) S 0 Maude (pc[p1]: rs) (pc[p2]: rs) (queue: empty) (tmp[p1]: empty) (tmp[p2]: empty) eq 1 i eq2 i wt i dq1 i dq2 i eq1 eq2 wt dq1 dq2 LHS wt i pc i =ws top(queue) =i LHS (pc[i]: ws) pc[p1]: rs pc[p2]: rs trans by eq1 queue: empty with I = p1 tmp[p1]: empty tmp[p2]: empty trans by eq2 with I = p1 pc[p1]: ws pc[p2]: rs queue: p1 empty trans by wt with I = p1 tmp[p1]: p1 empty tmp[p2]: empty pc[p1]: es pc[p2]: rs queue: empty tmp[p1]: p1 empty tmp[p2]: empty pc[p1]: cs pc[p2]: rs queue: p1 empty tmp[p1]: p1 empty tmp[p2]: empty ( ) eq1 LHS (pc[p1]: rs) (queue: empty) (tmp[p1]: empty) RHS (pc[p1]: es) (queue: empty) (tmp[p1]: p1 empty) S 0 QLOCK-INIT 15 mod QLOCK-INIT is pr QLOCK. op init : -> Sys. eq init = (pc[p1]: rs) (pc[p2]: rs) (queue: empty) (tmp[p1]: empty) (tmp[p2]: empty). 5 search search t t 15 init( ) ( ) ( )

82 pc i =cs i 1 S 0 search [1] in QLOCK-INIT : init =>* (pc[p1]: cs) (pc[p2]: cs) (S:Sys). init (pc[p1]: cs) (pc[p2]: cs) (S:Sys) ( ) [1] 1 S Sys Maude Solution 1 (state 33) states: 34 rewrites: 82 in 1ms cpu (0ms real) (82000 rewrites/second) S:Sys --> queue: (p2 empty) (tmp[p1]: p1 empty) tmp[p2]: p2 empty search 33 (init 0 ) 33 ( 33) 33 ( ) show path (show path 33.) state 0, Sys: queue: empty (pc[p1]: rs) (pc[p2]: rs) (tmp[p1]: empty) tmp[p2]: empty ===[... [label eq1]. ]===> state 1, Sys: queue: empty (pc[p1]: es) (pc[p2]: rs) (tmp[p1]: p1 empty) tmp[p2]: empty ===[... [label eq1]. ]===> state 3, Sys: queue: empty (pc[p1]: es) (pc[p2]: es) ===[... [label eq2]. ]===> state 6, Sys: queue: (p1 empty) (pc[p1]: ws) (pc[p2]: es) ===[... [label wt]. ]===> state 13, Sys: queue: (p1 empty) (pc[p1]: cs) (pc[p2]: es) ===[... [label eq2]. ]===> state 23, Sys: queue: (p2 empty) (pc[p1]: cs) (pc[p2]: ws) ===[... [label wt]. ]===> state 33, Sys: queue: (p2 empty) (pc[p1]: cs) (pc[p2]: cs) eq2 13 23 queue (p1 empty) (p2 empty) wt 23 33 p1 p2 queue rs es 2 1 (rs: queue := enq(queue,i);) i S 0 2 eq1 i eq 2 i 1 eq i S 1 S 0 Maude 2 eq1 eq2 1 S 1 Maude 16 rl [eq] : (pc[i]: rs) (queue: Q) => (pc[i]: ws) (queue: enq(q,i)). search 2 S 1 6 LTL LTL Maude model-checker.maude in (in model-checker) 2 LTL S 1 2 LTL 2 LTL 2 wait crit mod QLOCK-PREDS is pr QLOCK-INIT. inc SATISFACTION. subsort Sys < State. ops wait crit : Pid -> Prop. var P : Pid. var S : Sys. eq (pc[p] : ws) S = wait(p) = true. eq (pc[p] : cs) S = crit(p) = true. 16

Vol. 25 No. 2 Apr. 2008 83 SATISFACTION model-checker.maude ( ) _ =_ LTL mod QLOCK-CHECK is inc QLOCK-PREDS. inc MODEL-CHECKER. inc LTL-SIMPLIFIER. ops mutex lofree : -> Formula. eq mutex = ([] ~(crit(p1) /\ crit(p2))). eq lofree = (wait(p1) -> crit(p1)) /\ (wait(p2) -> crit(p2)). MODEL-CHECKER model-checker.maude modelcheck LTL-SIMPLIFIER LTL ~_ _/\_ ( ) ( ) []_ _ ->_ LTL Henceforth(Λ) Leads-to(ψ) f g LTL Λ f ( )f f ψ g f g mutex lofree LTL S 1 2 LTL ( ) red in QLOCK-CHECK : modelcheck(init,mutex). red in QLOCK-CHECK : modelcheck(init,lofree). 2 S 1 mutex ( ) 2 S 1 lofree ( ) {queue: empty (pc[p1]: rs) (pc[p2]: rs) (tmp[p1]: empty) tmp[p2]: empty, eq}... {queue: (p2 empty) (pc[p1]: rs) (pc[p2]: cs) (tmp[p1]: p2 empty) tmp[p2]: p1 empty, dq1} {queue: (p2 empty) (pc[p1]: rs) (pc[p2]: ds) (tmp[p1]: p2 empty) tmp[p2]: empty, eq} {queue: (p2 p1 empty) (pc[p1]: ws) (pc[p2]: ds) (tmp[p1]: p2 empty) tmp[p2]: empty, dq2}, {queue: empty (pc[p1]: ws) (pc[p2]: rs) (tmp[p1]: p2 empty) tmp[p2]: empty, eq} {queue: (p2 empty) (pc[p1]: ws) (pc[p2]: ws) (tmp[p1]: p2 empty) tmp[p2]: empty, wt} {queue: (p2 empty) (pc[p1]: ws) (pc[p2]: cs) (tmp[p1]: p2 empty) tmp[p2]: empty, dq1} {queue: (p2 empty) (pc[p1]: ws) (pc[p2]: ds) (tmp[p1]: p2 empty) tmp[p2]: empty, dq2}) p1 queue dq2 queue (p2 p1 empty) empty p1 ws queue cs ds 2 1 (cs: queue := deq(queue);) i S 1 2 dq1 i dq2 i 1 dq i S 2 S 1 Maude 2 dq1 dq2 1 S 2 Maude rl [dq] : (pc[i]: cs) (queue: Q) => (pc[i]: rs) (queue: deq(q)). 2 red 2 S 2 mutex lofree 17 17 lofree LTL LTL S 2 lofree queue (rl [xr] : (pc[i]: rs) (queue: Q) => (pc[i]: rs) (queue: Q).) lofree

84 7 Maude [5] [1] Clavel, M., et al.: All About Maude A High- Performance Logical Framework: How to Specify, Program and Verify Systems in Rewriting Logic, LNCS, Vol. 4350, Springer, 2007. [2] Futatsugi, K.: Verifying Specifications with Proof Scores in CafeOBJ, in 21st ASE, 2006, pp. 3 10. [3] Futatsugi, K., Goguen, J. A., Jouannaud, J. -P. and Meseguer, J.: Principles of OBJ2, in 12th POPL, 1985, pp. 52 66. [4] Meseguer, J.: From OBJ to Maude and Beyond, in Algebra, Meaning, and Computation: A Festschrift Symposium in Honor of Joseph Goguen, LNCS, Vol. 4060, Springer, 2006, pp. 252 280. [5] Ogata, K. and Futatsugi, K.: Comparison of Maude and SAL by Conducting Case Studies Model Checking a Distributed Algorithm, IEICE Trans. Fundamentals, Vol. E90-A(2007), pp. 1690 1703.