Skip to content

Commit a057d3a

Browse files
Port LambdaANF_to_Clight_correct.v to Coq 8.19 and advance correctness proof
1 parent b7f62a1 commit a057d3a

3 files changed

Lines changed: 7752 additions & 4702 deletions

File tree

theories/Codegen/LambdaANF_to_Clight.v

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,10 @@ Notation "'call' f " := (Scall None f (tinf :: nil)) (at level 35).
377377
Notation "'[' t ']' e " := (Ecast e t) (at level 34).
378378

379379
Notation "'Field(' t ',' n ')'" :=
380-
( *(add ([valPtr] t) (c_int n%Z val))) (at level 36). (* what is the type of int being added? *)
380+
( *(add ([valPtr] t) (c_int n%Z uval))) (at level 36). (* must be uval (integer), not val (pointer), for classify_add *)
381381

382382
Notation "'args[' n ']'" :=
383-
( *(add args (c_int n%Z val))) (at level 36).
383+
( *(add args (c_int n%Z uval))) (at level 36).
384384

385385

386386

@@ -470,8 +470,8 @@ Definition assignConstructorS
470470
ret (x ::= tag)
471471
| boxed _ a =>
472472
let stm := assignConstructorS' fenv map x 0 vs in
473-
ret (x ::= [val] (allocPtr +' (c_int Z.one val)) ;;;
474-
allocIdent ::= allocPtr +' (c_int (Z.of_N (a + 1)) val) ;;;
473+
ret (x ::= [val] (allocPtr +' (c_int Z.one uval)) ;;;
474+
allocIdent ::= allocPtr +' (c_int (Z.of_N (a + 1)) uval) ;;;
475475
Field(var x, -1) :::= tag ;;;
476476
stm)
477477
end.
@@ -687,8 +687,8 @@ Definition make_case_switch
687687
isPtr caseIdent x;;;
688688
Sifthenelse
689689
(bvar caseIdent)
690-
(Sswitch (Ebinop Oand (Field(var x, -1)) (make_cint 255 val) val) ls)
691-
(Sswitch (Ebinop Oshr (var x) (make_cint 1 val) val) ls').
690+
(Sswitch (Ebinop Oand (Ecast (Field(var x, -1)) uval) (make_cint 255 uval) uval) ls)
691+
(Sswitch (Ebinop Oshr (Ecast (var x) uval) (make_cint 1 uval) uval) ls').
692692

693693
Definition to_int64 (i : PrimInt63.int) : int64.
694694
exists (Uint63.to_Z i * 2 + 1)%Z.

0 commit comments

Comments
 (0)