Changes between Version 20 and Version 21 of IR
- Timestamp:
- 11/22/15 11:25:28 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IR
v20 v21 60 60 * lo, hi are integers, wrap is boolean 61 61 * 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?** 62 63 * `$hint` : Herbrand integers. Values are unsimplified symbolic expressions. 63 64 * `$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.** 65 66 * IEEE754 floating point numbers 66 67 * `$hreal` : Herbrand real numbers. Values are unsimplified symbolic expressions. 67 68 * `struct(T1,...,Tn)` 68 69 * 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?** 70 71 * `union(T1,...,Tn)` : similar to struct 71 72 * `T[]` : array-of-T … … 79 80 What are two types compatible? 80 81 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 87 This can be used in `sizeof`, ... 88 89 **Do we need to clearly distinguish dynamic type names and static type names?** 90 91 81 92 == Declarations == 82 93 83 94 Declarations follow the C notation. Function prototypes are considered to be declarations similar to variable declarations. 84 95 85 **Declarations for system, abstract/pure functions?** 96 Example of declaration of a function: 97 {{{ 98 $integer f($real x, $bool y); 99 }}} 100 101 Additional 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 105 System 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 112 Example 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 }}} 86 117 87 118 … … 125 156 * e1,...,en are expressions of integer type 126 157 * 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 ...? 128 160 * `$typeof(...)`: what is this for? 129 * ` $sizeof(T)` : T is a type name?161 * `sizeof(T)` : T is a type name? 130 162 * `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? 131 166 132 167 … … 174 209 175 210 == Libraries == 176
