An Overview of the K Framework Grigore Rosu University of Illinois - - PowerPoint PPT Presentation

an overview of the k framework
SMART_READER_LITE
LIVE PREVIEW

An Overview of the K Framework Grigore Rosu University of Illinois - - PowerPoint PPT Presentation

An Overview of the K Framework Grigore Rosu University of Illinois at UrbanaChampaign (joint work with Traian Florin Serbanuta) Challenges in Programming Language Design / SemanIcs / Analysis Programming languages are conInuously born,


slide-1
SLIDE 1

An Overview of the K Framework

Grigore Rosu University of Illinois at Urbana‐Champaign (joint work with Traian Florin Serbanuta)

slide-2
SLIDE 2

Challenges in Programming Language Design / SemanIcs / Analysis

  • Programming languages are conInuously

born, updated and extended

– C#, CIL; Java memory model, Scheme R6RS, C1X – Concurrency is the norm, not the excepIon

  • Executable specificaIons could help

– Design and maintain mathemaIcal definiIons – Easily test/analyze language updates/extensions – Explore/Abstract non‐determinisIc execuIons

slide-3
SLIDE 3

K Project

  • Started in 2003, moIvated mainly by teaching

programming languages and noIcing that the exisIng semanIc frameworks have limitaIons

  • Project thesis:

– RewriIng gives an appropriate environment to formally define the semanIcs of real‐life programming languages and to test and analyze programs wri[en in those languages.

slide-4
SLIDE 4

Overview

  • RewriIng logic semanIcs project

– How it all started ...

  • K framework

– K definiIonal style – K concurrent rewriIng

  • Example

– Challenge language

slide-5
SLIDE 5

RewriIng Logic SemanIcs Project

  • RewriIng Logic (RWL)

– Meseguer 1992

  • RewriIng Logic SemanIcs (RLS) Project
  • Advance the use of rewriIng logic for defining

programming languages, and for execuIng and analyzing programs wri[en in them

  • ParIcipants (probably incomplete list):

– Wolfgang Ahrendt, Musab Al‐Turki, Marcelo d’Amorim, Irina M. Asavoae, Mihai Asavoae, Eyvind W. Axelsen, ChrisIano Braga, Illiano Cervesato, Fabricio Chalub, Feng Chen, Manuel Clavel, Chucky Ellison, Azadeh Farzan, Alejandra Garrido, Mark Hills, Michael Ilseman, Einar Broch Johnsen, Ralph Johnson, Michael Katelman, LaurenIu Leustean, Dorel Lucanu, Narciso Mard‐Oliet, Patrick Meredith, Jose Meseguer, Elena Naum, Olaf Owe, Stefan Reich, Grigore Rosu, Andreas Roth, Juan Santa‐Cruz, Ralf Sasse, Wolfram Schulte, Koushik Sen, Andrei S,tefanescu, Mark‐Oliver Stehr, Carolyn Talco[, Prasanna ThaI, Traian Serbanuta, Ram Prasad Venkatesan, Alberto Verdejo

slide-6
SLIDE 6

Why is RewriIng Logic Good for Programming Languages ?

  • Executability

– Language definiIons turn into interpreters

  • Concurrency

– The norm rather than the excepIon

  • EquaIonal abstracIon

– Collapse state space through equaIons

  • Generic tools (built around Maude)

– ExecuIon, tracing, debugging, state space search, model checker, inducIve theorem prover

slide-7
SLIDE 7

Guidelines for Defining Programming Languages in RWL

  • Represent program state as configuraIon term
  • Represent computaIonal steps as rewrite rules
  • Represent structural changes as equa-ons
  • These associate to any given configuraIon a

transi-on system

– In parIcular, it associates semanIcs to programs

  • ResulIng transiIon systems are amenable to

exploraIon, search and model checking

  • Great, but it does not tell us how to do it
slide-8
SLIDE 8

ConvenIonal semanIc frameworks become RWL definiIonal methodologies

  • This allows to define a language using one’s

favorite semanIc style, and then to execute, explore or model check it using RWL

slide-9
SLIDE 9

ConvenIonal semanIc frameworks become RWL definiIonal methodologies

  • This allows to define a language using one’s

favorite semanIc style, and then to execute, explore or model check it using RWL

Many authors contributed to this diagram, including all the abovemenIoned. See

[Serbanuta, Rosu, Meseguer 2007 – Inf. & Comp.]

for a recent survey.

slide-10
SLIDE 10

ExisIng SemanIcs Frameworks, From a Unified PerspecIve

  • The unified view of semanIc frameworks

within RWL also allows to be[er examine them and understand their limitaIons

  • For example, can exisIng styles define real

programming languages on a regular basis, as

  • pposed to only toy languages ?

– No, but their combined strengths might

slide-11
SLIDE 11

Shortcomings of ExisIng Frameworks

  • Hard to deal with control (except evaluaIon contexts)

– halt, break/conInue, excepIons, callcc

  • Non‐modular (except Modular SOS)

– Adding new features require changing unrelated rules

  • Lack of semanIcs for true concurrency (except CHAM)

– Big‐Step captures only all possible results of computaIon – ReducIon approaches only give interleaving semanIcs

  • Tedious to find next redex (except evaluaIon contexts)

– One has to write the same descent rules for each construct

  • Inefficient as interpreters (except for Big‐Step SOS)
slide-12
SLIDE 12

Towards an Ideal PL DefiniIonal Framework

  • Our iniIal goal was to search for an ideal

language definiIonal framework within RWL

– At least as expressive as evaluaIon contexts – At least as modular as Modular SOS – At least as concurrent as the CHAM

slide-13
SLIDE 13
slide-14
SLIDE 14
slide-15
SLIDE 15
slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20
slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23
slide-24
SLIDE 24
slide-25
SLIDE 25
slide-26
SLIDE 26
slide-27
SLIDE 27
slide-28
SLIDE 28
slide-29
SLIDE 29
slide-30
SLIDE 30
slide-31
SLIDE 31
slide-32
SLIDE 32
slide-33
SLIDE 33
slide-34
SLIDE 34
slide-35
SLIDE 35
slide-36
SLIDE 36
slide-37
SLIDE 37
slide-38
SLIDE 38
slide-39
SLIDE 39
slide-40
SLIDE 40
slide-41
SLIDE 41
slide-42
SLIDE 42
slide-43
SLIDE 43
slide-44
SLIDE 44
slide-45
SLIDE 45
slide-46
SLIDE 46
slide-47
SLIDE 47
slide-48
SLIDE 48
slide-49
SLIDE 49
slide-50
SLIDE 50
slide-51
SLIDE 51
slide-52
SLIDE 52
slide-53
SLIDE 53
slide-54
SLIDE 54
slide-55
SLIDE 55
slide-56
SLIDE 56
slide-57
SLIDE 57
slide-58
SLIDE 58
slide-59
SLIDE 59
slide-60
SLIDE 60
slide-61
SLIDE 61
slide-62
SLIDE 62
slide-63
SLIDE 63
slide-64
SLIDE 64
slide-65
SLIDE 65
slide-66
SLIDE 66
slide-67
SLIDE 67
slide-68
SLIDE 68
slide-69
SLIDE 69