Changes between Version 109 and Version 110 of IR2


Ignore:
Timestamp:
05/21/21 18:20:58 (5 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IR2

    v109 v110  
    128128  | '$herbrand' '<' type-name '>'  /* Herbrand type of non-Herbrand numeric type T */
    129129  | '$proc'  /* process type */
    130   | '$bundle'  /* bundle type for sequence of any type (same as seq<T>?) */
    131130  | '$heap'  /* heap type, for dynamic allocation */
    132131  | '$mem'  /* set of memory locations */
     
    169168  * a map cannot be executed in a call or spawn; nor can functions on maps have any side effects
    170169  * a function can return a map and can consume an argument of map type
    171 
    172 
     170* A type name in a type-args list may be `void`.  In this case, the type name designates the type whose domain is the union, over all types `T` of the type name obtained by substituting T for `void`.  For example, the domain of `$seq<void>` is the union over all types `T` of `$seq<T>`.  The sequence `{1,2,3}` is in the domain of `$seq<$int>` and of `$seq<void>`.  The sequence `{1,3.14}` is not in `$seq<void>` since there is no type `T` containing `$int` and `$real`.    Hence `$seq<void>` is a super type of all `$seq<T>`, and an expression of type `$seq<T>` can be used where one of type `$seq<void>` is required.  It is similar to the relation between `void*` and `T*`. 
     171  * A "bundle" type is not needed.  A bundle is just a `$seq<void>`.
     172  * A message in an MPI communication might be represented as an element of type `$seq<$seq<void>>`.  That is, a sequence, each element of which is a sequence of elements of the same type.  An example of a message would be `{{1,2,3}, {3.14,2.7},{'a','b','c'}}`.
     173  * A general C "object" might be represented as a structure
     174{{{
     175struct $object {
     176  $int size; // number of bytes
     177  $map<$int, $seq<void>> data; // offset (in bytes), contiguous values
     178};
     179}}}
    173180
    174181== Statements ==
     
    335342struct $object {
    336343  $int size; // in bytes
    337   $map<$int,$any> data; // byte offset -> element
     344  $map<$int,$seq<void>> data; // byte offset -> element sequence
    338345}
    339346typedef struct $object $object;
    340 }}}
    341 But this requires `$any` ... (think about this) ...
    342 
    343 
    344 === bundle.cvh ===
    345 
    346 {{{
    347 $int $bundle_size($bundle b); // number of elements in bundle or size in bytes?
    348 $bundle $bundle_pack(void *ptr, int size);
    349 void $bundle_unpack($bundle bundle, void *ptr);
    350 void $bundle_unpack_apply($bundle data, void *buf, $operation op, int count, void *result);
    351 
    352347}}}
    353348