1 / 20

An Executable Formal Semantics for SDL-2000

An Executable Formal Semantics for SDL-2000. Andreas Prinz DResearch GmbH Berlin. Contents. SDL-2000 Formal Description static part dynamic part SDL-2000 Formal Implementation Conclusion. Concrete Syntax. BNF. Rewriting. PC1. Formality: Static Part. language part. formalisation.

wynona
Download Presentation

An Executable Formal Semantics for SDL-2000

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An Executable Formal Semantics for SDL-2000 Andreas Prinz DResearch GmbH Berlin

  2. Contents • SDL-2000 Formal Description • static part • dynamic part • SDL-2000 Formal Implementation • Conclusion

  3. Concrete Syntax BNF Rewriting PC1 Formality: Static Part language part formalisation transformations (e.g. RPC) conditions (e.g. types) Abstract Syntax BNF

  4. Example: Concrete Syntax state s; input a; output b,c; nextstate s; endstate; <output> ::= output <output body> <output body> ::= <signal identifier> {, <signal identifier>}*

  5. Example: Abstract Syntax State-node(Name(s), Input-node(Identifier(a), Transition( Output-node(Identifier(b)), Output-node(Identifier(c)), Nextstate-node(Name(s)) ) ) ) Output-node :: Signal-identifier Signal-identifier = Identifier

  6. Example: Transformations If several <signal identifier>s are specified in an <output body>, this is derived syntax for specifying a sequence of <output>s in the same order as specified in the original <output body>. < <output>(<output body>(< o > // r) ) > provided r  empty => < <output>(<output body>(< o >) ), <output>(<output body>(r) ) >

  7. Example: Conditions The <signal identifier> in an <output body> must denote a <signal definition>.  o <output body>: o.s-<signal identifier>.refersto  <signal definition>  o Output-node: o.s-Signal-identifier.refersto  Signal-definition

  8. Example: Mapping <output>(<output body>(< id >)) => Output-node(Mapping(id))

  9. Abstract Syntax structure behaviour data compilation initialisation structure connections primitives SDL Abstract Machine (SAM) ASM Formality: Dynamic Part data interface

  10. Example: SAM Link_Module if Self.from.queue<>empty then let S=Self.from.queue.head in if Applicable(Self,S) then DELETE(S,Self.from) INSERT(S,Delay(Self),Self.to) Self.last_time:=Delay(Self) where Applicable(Self,S)= ... Delay(Self)=max(now+Self.delay,Self.last_time)

  11. Example: Initialisation Init_Agent_Module if mode(Self)=initial then mode(Self):= starting CREATEVARIABLES(Self.ref.Variable-definition) do forall a:Self.ref.Agent extend Agent with ag ref(ag):= a, mode(ag):= initial Mod(ag):= Init_Agent_Module else CREATECHANNELS(Self.ref.Channel-definition) Mod(Self):= Execute_Module

  12. Example: Compilation l1: STATENODE( {<a, l2>}) l2: OUTPUT(b) => l3 l3: OUTPUT(c) => l4 l4: SKIP => l1

  13. Implementation tools used: lex, yacc, kimwitu, make, workbench lexical structure sdl.l concrete syntax sdl.y, sdl_cs.k abstract syntax sdl_as.k transformations sdl_trans.k conditions sdl_cond.k mapping CS -> AS sdl_map.k compilation sdl_compile.k ASM parts sdl.asm

  14. Conclusions • ASM very well suited for SDL semantics • difficult to cover the whole language • flexible use of different techniques in dynamic semantics • executability of the semantics • implementation already for a restricted version of SDL

  15. An Executable Formal Semantics for SDL-2000 Dr. A. Prinz DResearch GmbH Berlin

  16. Abstract State Machines • general • state transitions • introduced by Gurevich • based on mathematics • states • transitions • programs • concurrency/time Y. Gurevich. Evolving Algebra 1993: Lipari GuideIn E. Börger, editor, Specification and Validation Methods; Oxford University Press 1995 Y. Gurevich.ASM Guide 97CSE Technical Report, University of Michigan-Ann Arbor, 1997

  17. Abstract State Machines state element domain function boolean function vocabulary 0-ary function 1-ary predicate function name predicate name • general • states • algebras • sets,functions • domains • reserve elements • transitions • programs • concurrency/time

  18. Abstract State Machines Jill.Account:= 1000000 Jack.Account:= 0 Account(Jill):= 1000000 Account(Jack):= 0 • general • state • transitions • locations, updates • firing of updates • runs • programs • concurrency/time

  19. if strike then else extend Flyer by f do forall s: Student • do-forall • choose choose s: Student focus(Self):= s • if-then-else • extend Abstract State Machines • general • states • transitions • programs • concurrency/time know(s):= know(s)+SDL

  20. Abstract State Machines ag2 • general • states • transitions • programs • concurrency/time • agents • Mod, Self • partially ordered runs • now ag1 M1 M2 ag3 M3 ag4 Mod(agX) S View(agX,S)

More Related