Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /trunk/semantics/semantics
ViewVC logotype

View of /trunk/semantics/semantics

Parent Directory Parent Directory | Revision Log Revision Log


Revision 489 - (download) (annotate)
Wed Jan 19 17:13:29 2011 UTC (10 years, 10 months ago) by lamonts
File size: 1498 byte(s)
Adding the semantics directory and semantics file
Diderot Formal Semantics 
===============================

variable ::= string 
id ::= integer 

Arithmetic expression (Aexp)
e ::=  n       for n ∈ R or n ∈ Z 
     | x       for x = variable 
     | e1 + e2 for e1,e2 ∈ Aexp, Aexp 
     | e1 - e2 for e1,e2 ∈ Aexp, Aexp 
     | e1 * e2 for e1,e2 ∈ Aexp, Aexp 
     | e1 / e2 for e1,e2 ∈ Aexp, Aexp 

Relational expression (Rexp) 
b ::=   true 
	  | false
     | e1 == e2 for e1,e2 ∈ Aexp, Aexp 
     | e1 < e2 for e1,e2 ∈ Aexp, Aexp 
     | e1 > e2 for e1,e2 ∈ Aexp, Aexp 
     | e1 <= e2 for e1,e2 ∈ Aexp, Aexp 
     | e1 >= e2 for e1,e2 ∈ Aexp, Aexp 
     
Commands (Comm)
c ::=   x := e  			 for x = variable, e ∈ Aexp 
	  | c1; c2				 for c1,c2  ∈ Comm
	  | if b then c1 else c2 for c1,c2  ∈ Comm and b  ∈ Rexp

Values 
v := Num(n) | Bool(b) | String(s) | tensor...?? 

Strand_Status := Active | Dead | Stablized 
 
env = variable → value

Strand_Env = Strand_Status * id * commands * env 


Update: Strand_Env -> Strand_Env 

Rules: 
 
(1) -------------------------------------------------------------
     Update(<Stabalized,id,comm,env>) ⇓ <Stabalized,id,comm,env> 


(2)     (Doubt this will ever happen...?) 
    -------------------------------------------------------------
           Update(<Dead,id,comm,env>) ⇓ <Dead,id,comm,env> 

       				 Update(<Active,_,e,env>) ⇓ v     
(3)  -------------------------------------------------------------
        Update(<Active,_,x:=e,env>) ⇓ env[x:=v]


root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0