9
A Relational Virtual Machine for Program Evolution Sergio Pissanetzky [email protected] SER 3534 SER 3534 - A Relational Virtual Machine for Program Evolution. Sergio Pissanetzky. [email protected]

A Relational Virtual Machine for Program Evolution Sergio Pissanetzky [email protected] SER 3534 SER 3534 - A Relational Virtual Machine for Program

Embed Size (px)

Citation preview

Page 1: A Relational Virtual Machine for Program Evolution Sergio Pissanetzky Sergio@SciControls.com SER 3534 SER 3534 - A Relational Virtual Machine for Program

A Relational Virtual Machine for Program Evolution

Sergio Pissanetzky

[email protected]

SER 3534

SER 3534 - A Relational Virtual Machine for Program Evolution. Sergio Pissanetzky. [email protected]

Page 2: A Relational Virtual Machine for Program Evolution Sergio Pissanetzky Sergio@SciControls.com SER 3534 SER 3534 - A Relational Virtual Machine for Program

Motivation

SER 3534 - A Relational Virtual Machine for Program Evolution. Sergio Pissanetzky. [email protected] 2

The Problem

• Program evolution involves many repetitive tasks.

• But mechanizing the tasks has proved difficult.

The Solution

• Using a relational container for source code.

The Reason

• There is no common program representation.

Page 3: A Relational Virtual Machine for Program Evolution Sergio Pissanetzky Sergio@SciControls.com SER 3534 SER 3534 - A Relational Virtual Machine for Program

Using relations to represent a program is natural

3SER 3534 - A Relational Virtual Machine for Program Evolution. Sergio Pissanetzky. [email protected]

1. a = b / c;

K a b O c

1 C A / A

K b O 3

2 M + A

Variables can be ( A, M, C ).

Literals can only be ( A ).Service s : As × Ms → Ms × Cs

2. b = b + 3;

a service

Page 4: A Relational Virtual Machine for Program Evolution Sergio Pissanetzky Sergio@SciControls.com SER 3534 SER 3534 - A Relational Virtual Machine for Program

The RMC Model: M = (C, Q)

1 / C A A2 + M A3 f C A A4 δ M M C6 = C A7 = C A

C =

K O a b c Ω Г Λ 3

1. a = b / c;

2. b = b + 3;

3. a = f (b, c);

4. δ : Ω × Г → Ω × Г × Λ

5. if (b) a = c; else a = 3;

1 22 33 44 true 64 false 7

Q =

serv b next

4SER 3534 - A Relational Virtual Machine for Program Evolution. Sergio Pissanetzky. [email protected]

Page 5: A Relational Virtual Machine for Program Evolution Sergio Pissanetzky Sergio@SciControls.com SER 3534 SER 3534 - A Relational Virtual Machine for Program

SER 3534 - A Relational Virtual Machine for Program Evolution. Sergio Pissanetzky. [email protected] 5

1 / C A A2 + M A3 f C A A4 δ M M C6 = C A7 = C A

K O a b c Ω Г Λ 5

“CAA’MA’CAA’MMC’CA’CA”

”CCCAAA’ACA’MMC’ACAA’AAC’MAA”

RMC SequencesMatrix of Services

1 in C C C A A A2 rd A C A3 tr MM C4 gb A C A A5 wr A A C6 mv M A A7 ex

K O c Ω Г Λ g b h u n p qTuring Machine

Page 6: A Relational Virtual Machine for Program Evolution Sergio Pissanetzky Sergio@SciControls.com SER 3534 SER 3534 - A Relational Virtual Machine for Program

Submodeling, encapsulation, inheritance

1 2 3 4 5 6 7 8 9 10 11 12 13 14a x xb x x x xc x xd x xe x x xf x xg x x xh x x xi x x xj x x x

6SER 3534 - A Relational Virtual Machine for Program Evolution. Sergio Pissanetzky. [email protected]

P Q RS

1 2 3a xb x x

1 2 3a x xb x xc x1 2 3

a x xb xc x x x

1 2 3a x xb xc x x

P 4, 5, 6 b, e, g

Q 7, 8 a, d

R 9, 10 c, f

S 3

Matrix C Class diagram

Page 7: A Relational Virtual Machine for Program Evolution Sergio Pissanetzky Sergio@SciControls.com SER 3534 SER 3534 - A Relational Virtual Machine for Program

RMC Algebra• Matrix operations

submatricing, permutations.• Relational operations

joins, projections, normalization• Graph operations

searches, labels, paths• Set operations

sub-superset, union, products

SER 3534 - A Relational Virtual Machine for Program Evolution. Sergio Pissanetzky. [email protected] 7

Formal algorithms•

Page 8: A Relational Virtual Machine for Program Evolution Sergio Pissanetzky Sergio@SciControls.com SER 3534 SER 3534 - A Relational Virtual Machine for Program

An RMC-centric environment

SER 3534 - A Relational Virtual Machine for Program Evolution. Sergio Pissanetzky. [email protected] 8

RMC+ algorithms

business rules source code

parserdevelopers

languagemodule

other modelsUML, CFG, DFD

intermediaterepresentations

developers

low level codeassembly, 3-address

interpreter

Page 9: A Relational Virtual Machine for Program Evolution Sergio Pissanetzky Sergio@SciControls.com SER 3534 SER 3534 - A Relational Virtual Machine for Program

Summary

• Program Mathematical object.

• Turing complete Universal.

• Formal algebra Algorithms.

• Link to source code.

• Coherence in program evolution.

9SER 3534 - A Relational Virtual Machine for Program Evolution. Sergio Pissanetzky. [email protected]