13.07.2015 Views

A Graph-Based Generic Type System for Object-Oriented Programs

A Graph-Based Generic Type System for Object-Oriented Programs

A Graph-Based Generic Type System for Object-Oriented Programs

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Operational Semantics 46Table 10: Operational Semantics of Commands and Evaluation of Expressionsl ∈ L(Lit)eval(G, l) ̂= ln = eval(G, e) ∈ L(Op)eval(G, f(e)) ̂= f(n)(Var) w ∈ A ∪ {self } ∪ {x∗ | x ∈ A }eval(G, w) ̂= G(w)(Attr) eval(G, e) a −→ n ∈ Geval(G, e.a) ̂= nx ∈ A(L-Var)l-eval(G, x) ̂= search(G, x)x ∈ A(P-Var)po(G, x) ̂= null(Cast) n = eval(G, e) n −→ σ s ∈ G t ∈ R.sm(s),eval(G, (⌈t⌋)e) ̂= n(L-Attr) q = eval(G, e) a ∈ A q −→ a n ∈ Gl-eval(G, e.a) ̂= q −→ a ,nq = eval(G, e)(P-Attr) a ∈ A ,po(G, e.a) ̂= qq = null x ∈ A(R-Var)spo(G, x, q) ̂= l-eval(G, x)(R-Attr) q ≠ null q −→ a n ∈ Gspo(G, e.a, q) ̂= q −→ a n ,(Skip) 〈skip, G〉 → Gd = l-eval(G, le) n = eval(G, e)(Assign)〈le := e, G〉 → swing(G, d, n)(Decl) 〈var ⌈t⌋ x, G〉 → push(G, x, ini(t))d = l-eval(G, le)(New)〈⌈t⌋.new(le), G〉 → new(R, G, t, d)(End) 〈end x, G〉 → pop(G)n = eval(G, ve) q = po(G, re)(Enter)〈enter(o, ve, x, re), G〉 → push(G, (self , x, x ∗ ), (o, n, q))(Leave) d = spo(pop(G), re, eval(G, x∗ )) n = eval(G, x)〈leave(x, re), G〉 → pop(swing(G, d, n))o = eval(G, e) o −→ σ s ∈ G s −→ m k ∈ R(Invk)〈e.m(ve • x • re), G〉 → 〈enter(o, ve, x, re); k; leave(x, re), G〉〈c 1 , G〉 → 〈c ′ 1, G ′ 〉(Seq)〈c 1 ; c 2 , G〉 → 〈c ′ 1; c 2 , G ′ 〉〈c 1 , G〉 → G ′(Seq-Pri)〈c 1 ; c 2 , G〉 → 〈c 2 , G ′ 〉eval(G, b) = true(If-T)〈c 1 ⊳ b ⊲ c 2 , G〉 → 〈c 1 , G〉eval(G, b) = false(If-F)〈c 1 ⊳ b ⊲ c 2 , G〉 → 〈c 2 , G〉eval(G, b) = false(While-F)〈b ∗ c, G〉 → G(While-T)eval(G, b) = true〈b ∗ c, G〉 → 〈c; b ∗ c, G〉 .2. a terminated configuration is a state graph G, representing the completion of the execution ofa command.Report No. 448, June 2011UNU-IIST, P.O. Box 3058, Macao

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!