Methodo Methodo ology (1) ology (1) Pla an Strict separation - - PowerPoint PPT Presentation

methodo methodo ology 1 ology 1 pla an
SMART_READER_LITE
LIVE PREVIEW

Methodo Methodo ology (1) ology (1) Pla an Strict separation - - PowerPoint PPT Presentation

Methodo Methodo ology (1) ology (1) Pla an Strict separation between St i t ti b t n syntax definitions and d fi iti d Booleans signature definitions Steps towards a Pico e S d Pi nvironment i Modularize syntax definit


slide-1
SLIDE 1

Pla

  • Booleans

S d Pi

  • Steps towards a Pico e

– Step 1: define syntax – Step 2: define a type che – Step 3: define an evaluat

Step 3: define an evaluat

– Step 4: define a compile

T l f ti

  • Traversal functions
  • Methodology

Introduction

an

i nvironment

ecker tor tor er

to ASF+SDF 1

Methodo Methodo

St i t ti b t

  • Strict separation between

signature definitions

  • Modularize syntax definit

“functionality”: statement

  • Modularize signature def

functionality: type check, functionality: type check,

Introduction

  • logy (1)
  • logy (1)

d fi iti d n syntax definitions and tions based on sorts or ts, expressions, types, etc. finitions based on , evaluate, collect, etc. , evaluate, collect, etc.

to ASF+SDF

Methodo Methodo

T t l f ifi ti

  • Two styles of specificatio

– Functional (e.g. PICO typ

  • Explicit control over applic
  • Tedious except in combina

– Algebraic (e.g. Booleans)

  • No control over application
  • Concise
  • Very local behavior no glo

Introduction

  • logy (2)
  • logy (2)
  • ns:

e checker)

cation of functions/rewrite rules ation with traversal functions n of rewrite rules

  • bal information can be used

to ASF+SDF

Methodo Methodo

St i t ti b t

  • Strict separation between

signature definitions

  • Modularize syntax definit

“functionality”: statement

  • Modularize signature def

functionality: type check, functionality: type check,

  • Use predefined libraries w

Introduction

  • logy (3)
  • logy (3)

d fi iti d n syntax definitions and tions based on sorts or ts, expressions, types, etc. finitions based on , evaluate, collect, etc. , evaluate, collect, etc. whenever possible

to ASF+SDF

slide-2
SLIDE 2

Methodo Methodo

U fi f ti f

  • Use prefix functions for s
  • Make auxiliary signature

y g

  • Make variables sectio

M k th t t f

  • Make the context-fre

section hidden

  • Use proper indentation, e

– for each section 2 spaces i

for each section 2 spaces i

– for each production rules e

Introduction

  • logy (4)
  • logy (4)

i t d fi iti signature definitions definitions hidden

  • n always hidden

t t b l ee start-symbols .g.

indentation indentation

  • etc. 4 spaces indentation

to ASF+SDF

Methodo Methodo

P t i t ti f l

  • Prevent intervention of le

variable definitions, e.g.

– Start each variable name w

“$cat”[0-9]* -> Cate [ ]

– Use “*” or “+” in the va

for a list for a list

“$cat+”[0-9]* -> Cate

Use “[0 9]*” to create

– Use [0-9]* to create

Introduction

  • logy (5)
  • logy (5)

i l d fi iti d exical definitions and

with a special character

egory g y

ariable name if it is a variable

egory+

e multiple variable occurrences e multiple variable occurrences.

to ASF+SDF

Methodo Methodo

Add t t f

  • Add a comment per set of equ
  • utermost function symbol:

%% %% %% hidden: convert-categories(Categor %% More explanatory comments %% [cc-1] convert-categories() = [cc-2] convert-categories({$idenlst make-cat(convert-ident convert categories($ca convert-categories($ca

  • Hidden auxiliary functions en
  • ne module!
  • ne module!

Introduction

  • logy (6)
  • logy (6)

ti ith th uations with the same

ry*) -> Ast-category* t} $cat*) = ts($idenlst)) at*) at*)

nforce grouping equations in

to ASF+SDF

Methodo Methodo

B i t t ith th d

  • Be consistent with the ord

– Recursion terminating eith – Use consistently the same

===>, when, ========

– Ensure that all equations a – Use the same order of con

Use e s e o de o co multiple conditions

L = R1 when C1, C2, … , ,

vs.

L = R2 when C1 C2 L = R2 when C1, C2, …

Introduction

  • logy (7)
  • logy (7)

d i f ti dering of equations:

her first of last layout of conditions, e.g. ===== are excluding via conditions nditions if equations have d

  • s

equ

  • s

ve

…, Ci, Ci+1, …, Cn , , , , Ci C’i+1 C’m …, Ci, C’i+1. …, C’m

to ASF+SDF

slide-3
SLIDE 3

Further

(

  • www.meta-environment.org (

– Guided Tour: Playing w – ASF+SDF by Example – Writing Language Defin

Writing Language Defin

– The Language Specifica

The Syntax Definition F

– The Syntax Definition F – An Explanation of Error – An Explanation of Error – The Architecture of The

Introduction

reading

( l D i ) (select Documentation):

with Booleans (flash) nitions in ASF+SDF nitions in ASF SDF ation Formalism ASF+SDF Formalism SDF Formalism SDF r Messages of SDF (draft) r Messages of ASF (draft) e Meta-Environment

to ASF+SDF 9