Changes between Version 20 and Version 21 of IR


Ignore:
Timestamp:
11/22/15 11:25:28 (10 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IR

    v20 v21  
    6060 * lo, hi are integers, wrap is boolean
    6161 * finite interval of integers [lo,hi].  If `wrap` is true then all operations "wrap", otherwise, any operation resulting in a value outside of the interval results in an exception being thrown.
     62 * **Do we want to allow `lo` and `hi` to be any values of type `$integer`, which means they are dynamic types, like complete array types?**
    6263* `$hint` : Herbrand integers.  Values are unsimplified symbolic expressions.
    6364* `$real` : the mathematical real numbers
    64 * `$float(e,f)`, e, f are integers, each at least 1
     65* `$float(e,f)`, e, f are integers, each at least 1.  **Same question for e and f as for lo and hi.**
    6566 * IEEE754 floating point numbers
    6667* `$hreal` : Herbrand real numbers.  Values are unsimplified symbolic expressions.
    6768* `struct(T1,...,Tn)`
    6869 * structure type with named fields.  Names may not seem necessary but if you want a subset of CIVL-C...
    69  * What about bit-widths?
     70 * **What about bit-widths?**
    7071* `union(T1,...,Tn)` : similar to struct
    7172* `T[]` : array-of-T
     
    7980What are two types compatible?
    8081
     82== Type names ==
     83
     84**Do we need another syntactic category for code that specifies a dynamic type**, for example
     85* `int[n*m+3]`.
     86
     87This can be used in `sizeof`, ...
     88
     89**Do we need to clearly distinguish dynamic type names and static type names?**
     90
     91
    8192== Declarations ==
    8293
    8394Declarations follow the C notation.   Function prototypes are considered to be declarations similar to variable declarations.
    8495
    85 **Declarations for system, abstract/pure functions?**
     96Example of declaration of a function:
     97{{{
     98$integer f($real x, $bool y);
     99}}}
     100
     101Additional modifiers that may be placed on any of above:
     102* `$pure` : the function has no side effects, but may be nondeterministic
     103* `$abstract`: function is a pure, mathematical function: deterministic function of inputs
     104
     105System functions:
     106* A function declaration which is not abstract and for which no definition is provided is a system function.
     107* If the system function is called anywhere in the program, it must be defined by providing Java code in an Enabler and Executor.  Failure to do so will result in an exception.
     108* A system function may modify any memory it can reach.  This includes allocating new data on heaps it can reach.
     109* A system function may have an implicit guard.  This is specified **how**?
     110* A system function may have an explicit guard.  This is specified **how**?
     111
     112Example of a declaration of a system function with guard.  **Fix me:**
     113{{{
     114$bool g($real x, $bool y) { ... }
     115$integer f($real x, $bool y) $guard g;
     116}}}
    86117
    87118
     
    125156 * e1,...,en are expressions of integer type
    126157 * the type of this expression is T[e1]...[en]
    127  * array value with base type `T` and length e1,...,en
     158 * array value with base type `T` and lengths e1,...,en
     159 * **do we need this for more types?**  E.g., structs of arrays of structs of arrays of ...?
    128160* `$typeof(...)`: what is this for?
    129 * `$sizeof(T)` : T is a type name?
     161* `sizeof(T)` : T is a type name?
    130162* `e1&e2`, `e1|e2`, `e1^e2`, `~e1` : bit-wise operations: arguments are arrays of booleans
     163* **MemoryUnitExpressions?**: are these literal values of type `$mem`?
     164 * could we use Frama-C notation `p+(e1..e2)` for example?
     165 * are there conversions between pointers and mems?
    131166
    132167
     
    174209
    175210== Libraries ==
    176