Changeset 1872 for src/Cminor/syntax.ma


Ignore:
Timestamp:
Apr 4, 2012, 6:48:23 PM (8 years ago)
Author:
campbell
Message:

Make binary operations in Cminor/RTLabs properly typed.
A few extra bits and pieces that help:
Separate out Clight operation classification to its own file.
Use dependently typed classification to refine the types.
Fix bug in cast simplification.
Remove memory_chunk in favour of the low-level typ, as this now contains
exactly the right amount of information (unlike in CompCert?).
Make Cminor/RTLabs comparisons produce an 8-bit result (and cast if
necessary).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Cminor/syntax.ma

    r1680 r1872  
    1010| Cst : ∀t. constant → expr t
    1111| Op1 : ∀t,t'. unary_operation t t' → expr t → expr t'
    12 | Op2 : ∀t1,t2,t'. binary_operation → expr t1 → expr t2 → expr t'
    13 | Mem : ∀t,r. memory_chunk → expr (ASTptr r) → expr t
     12| Op2 : ∀t1,t2,t'. binary_operation t1 t2 t' → expr t1 → expr t2 → expr t'
     13| Mem : ∀t,r. expr (ASTptr r) → expr t
    1414| Cond : ∀sz,sg,t. expr (ASTint sz sg) → expr t → expr t → expr t
    1515| Ecost : ∀t. costlabel → expr t → expr t.
     
    2222| Op1 _ _ _ e ⇒ expr_vars ? e P
    2323| Op2 _ _ _ _ e1 e2 ⇒ expr_vars ? e1 P ∧ expr_vars ? e2 P
    24 | Mem _ _ _ e ⇒ expr_vars ? e P
     24| Mem _ _ e ⇒ expr_vars ? e P
    2525| Cond _ _ _ e1 e2 e3 ⇒ expr_vars ? e1 P ∧ expr_vars ? e2 P ∧ expr_vars ? e3 P
    2626| Ecost _ _ e ⇒ expr_vars ? e P
     
    4040| St_skip : stmt
    4141| St_assign : ∀t. ident → expr t → stmt
    42 | St_store : ∀t,r. memory_chunk → expr (ASTptr r) → expr t → stmt
     42| St_store : ∀t,r. expr (ASTptr r) → expr t → stmt
    4343(* ident for returned value, expression to identify fn, args. *)
    4444| St_call : option (ident × typ) → expr (ASTptr Code) → list (𝚺t. expr t) → stmt
     
    8282match s with
    8383[ St_assign t i e ⇒ P i t ∧ expr_vars ? e P
    84 | St_store _ _ _ e1 e2 ⇒ expr_vars ? e1 P ∧ expr_vars ? e2 P
     84| St_store _ _ e1 e2 ⇒ expr_vars ? e1 P ∧ expr_vars ? e2 P
    8585| St_call oi e es ⇒ match oi with [ None ⇒ True | Some i ⇒ P (\fst i) (\snd i) ] ∧ expr_vars ? e P ∧ All ? (λe.match e with [ mk_DPair _ e ⇒ expr_vars ? e P ]) es
    8686(*
     
    115115[ //
    116116| #t #id #e * /4/
    117 | #t #r #q #e1 #e2 * /4/
     117| #t #r #e1 #e2 * /4/
    118118| * normalize [ 2: #id ] #e #es * * #H1 #H2 #H3 % [ 1,3: % /3/ | *: @(All_mp … H3) * #t #e normalize @expr_vars_mp @H ]
    119119(*
Note: See TracChangeset for help on using the changeset viewer.