Changes between Version 112 and Version 113 of IR2


Ignore:
Timestamp:
05/29/21 00:06:02 (5 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IR2

    v112 v113  
    265265expr-pair-list: expr-pair (',' expr-pair)* ;
    266266expr-pair: '{' expr ',' expr '}' ;
     267
    267268}}}
    268269
     
    299300For a complete type T, the "undef-initializer" for T is defined as follows: if T is not an array type, the undef-initializer is defined exactly as above: either the symbolic constant `UNDEF` or a concrete struct of `UNDEF`s.   If T is the complete array type S[n], the undef-initializer is the array-lambda expression with length n and defining expression the undef-initializer for S. 
    300301
    301 `$new_array(n,T)` returns the undef-initializer for T[n].
     302`$new(T[n])` returns the undef-initializer for `T[n]`.
    302303
    303304Evaluation of `$defined(expr)` returns `!FORALL UNDEF:T . expr == UNDEF`, where `T` is the type of `expr`. 
     
    341342could be modeled as
    342343{{{
    343 $int * p = $undef;
    344 $int (*p1)[] = $undef; // pointer to array of $int
    345 p1 = $alloc(&heap, $new_array(10, $int));
    346 p = ($int*)p1; // equivalently, p = &(*p1)[0];
     344$int * p;
     345$int (*p1)[]; // pointer to array of $int
     346p1 = $alloc(&heap, $new($int[10]));
     347p = &(*p1)[0];
    347348}}}
    348349