Changes between Version 121 and Version 122 of IR


Ignore:
Timestamp:
12/09/15 17:15:23 (10 years ago)
Author:
zmanchun
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IR

    v121 v122  
    253253
    254254Pointers and Memory
    255 * `NULL` : value of type `Pointer`
     255* `null` : value of type `Pointer`
    256256* `deref(e)` : pointer dereference
    257257* `addr(e)` : address-of operator
     
    273273
    274274Scopes and Processes
    275 * `root`, `here` : values of type `Scope`
     275* `root`, `here`, `scope_null` : values of type `Scope`
    276276* `self`, `proc_null` : values of type `Proc`
    277277* `scopeof(e)`: scope of left-hand-side expression `e`
     
    417417* `atomic`: function definition is atomic, and it never blocks
    418418 * **ISN'T THIS TRUE OF EVERY SYSTEM FUNCTION?  IN WHICH CASE, IS THIS ONLY FOR NON-SYSTEM FUNCTIONS?**
     419* `package="..."`: the package where a system function is implemented
    419420* `lib="..."`: function is a system function defined in specified library
    420421* `guard="...":` the name of the guard function
     
    522523The CIVL core libraries include:
    523524
    524 * `civlc.cvh`: the basic library of CIVL, usually included in a CIVL-C program, defining types and functions that are frequently used;
    525 
    526 * `scope.cvh`: providing utility functions related to dynamic scopes;
    527 
    528 * `pointer.cvh`: providing utility functions dealing with pointers;
    529 
    530 * `seq.cvh`: providing operations on sequences which is realized using arrays;
    531 
    532 * `concurrency.cvh`: providing concurrency utilities such as barrier and collective record;
    533 
    534 * `bundle.cvh`: defining bundle types and their operations;
    535 
    536 * `comm.cvh`: defining communicators and their operations.
     525* `civlc`: the basic library of CIVL, usually included in a CIVL-C program, defining types and functions that are frequently used;
     526
     527* `scope`: providing utility functions related to dynamic scopes;
     528
     529* `pointer`: providing utility functions dealing with pointers;
     530
     531* `seq`: providing operations on sequences which is realized using arrays;
     532
     533* `concurrency`: providing concurrency utilities such as barrier and collective record;
     534
     535* `bundle`: defining bundle types and their operations;
     536
     537* `comm`: defining communicators and their operations.
    537538
    538539=== the basic library `civlc` ===
     
    544545  This function takes as input a positive integer `n` and nondeterministicaly returns an integer in the range `[0, n − 1]`.
    545546
    546 * is a scope reference defined?
    547 
    548   `_Bool $scope_defined($scope s);`
    549 
    550   It returns true if the dynamic scope specified by `s` is defined, else it returns false.
    551 
    552 * is a process reference defined?
    553 
    554   `_Bool $proc_defined($proc p);`
    555 
    556   It returns true if and only if the given object of `$proc` type is defined.
    557 
    558 === Scope utilities `scope.cvh` ===
    559 The header `scope.cvh` declares one function: `$scope` parent, which has signature
    560 
    561 `$scope $scope_parent($scope s);`
    562 
    563 This function returns the parent dynamic scope of the dynamic scope referenced by `s`. If `s` is the root dynamic scope, it returns the undefined value of type `$scope`.
     547=== Scope utilities `scope` ===
     548* parent of a scope
     549
     550`fun[lib="scope"] $scope_parent(s: Scope): Scope`
     551
     552This function returns the parent dynamic scope of the dynamic scope referenced by `s`. If `s` is the root dynamic scope, it returns the `scope_null`.
    564553
    565554=== Pointer utilities `pointer.cvh` ===
     
    567556
    568557* equality checking:
    569   `_Bool $equals(void *x, void *y);`
     558  `fun[lib="pointer"] $equals(x: Pointer, y: Pointer): Bool`
    570559  this function returns true iff the objects pointed to by the pointers `x` and `y` have the same type and value.
    571560
    572561* membership testing:
    573   `_Bool $contains(void *ptr1, void *ptr2);`
     562  `fun[lib="pointer"] $contains(ptr1: Pointer, ptr2: Pointer): Bool`
    574563  this function returns true iff the object pointed to by `ptr1` contains the object pointed to by `ptr2`. For example, `$contains(&a, &a[1].x)` would return true.
    575564
    576 * pointer creation:
    577  $translate ptr for pointer translation;
     565* pointer translation:
     566
     567    `fun[lib="pointer"] $translate_ptr(ptr: Pointer, obj: Pointer): Pointer`
     568
     569   this function returns a pointer which is the result of translating the pointer `ptr` (a pointer into one object) to a pointer into a different object `obj` with similar structure.
     570
    578571* copy through pointers:
     572  `fun[lib="pointer"] $copy(ptr: Pointer, value: pointer)`
     573
     574  copies the value pointed to by `value` to the memory location specified by `ptr`.
     575
     576* get leaf node pointers:
     577 
     578  `fun[lib="pointer"] $leaf_node_ptrs(array: Pointer, obj: Pointer)`
     579
     580  copies the references to the leaf nodes of `obj` to the given `array`. The type of `obj` is `Pointer[T']`, all leaf nodes of `T'` has type `T`, and `array` has type `Pointer[Array[T]]`. For example, `T'` could be `Tuple[<Integer, Array[Integer], Integer>]`
     581
     582* set leaf nodes:
     583  `fun[lib="pointer"] `
     584
     585
    579586
    580587Which libraries require system functions?