Changes between Version 12 and Version 13 of PIL


Ignore:
Timestamp:
10/05/24 15:33:12 (19 months ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PIL

    v12 v13  
    3636 * `$int*[]($real) f`: function from Real to array of pointer to integer
    3737- basic types:
     38 * `$bool` : the set consisting of `$true` and `$false`
    3839 * `$int`: the set of integers
    3940 * `$real`: the set of Reals
    40  * `fint[lo,hi]`: set of integers between `lo` and `hi`, inclusive. `lo` and `hi` are constant expressions so are known at compile time.
    41  * `uint[hi]`: nonnegative integers less than the constant expression`hi`.  Arithmetic is performed modulo `hi` (like C's unsigned integer types).
     41 * `$int<lo,hi>`: set of integers between `lo` and `hi`, inclusive. `lo` and `hi` are constant expressions so are known at compile time.
     42 * `$uint<hi>`: nonnegative integers less than the constant expression `hi`.  Arithmetic is performed modulo `hi` (like C's unsigned integer types).
    4243 * `$float<p,emax>`: the set of IEEE binary floating point numbers with precision `p` and emax `emax`.  These are also constant expressions.
    4344- `T*`: pointer to `T`
     
    4950- `$set<T>` : finite set of `T`
    5051- `$map<T1,T2>` : finite map from `T1` to `T2`.  A map is a set of ordered pairs `(x,y)` with the property that if `(x,y)` and `(x,z)` are in the map, then `y`=`z`.
    51 - `$tuple<T,...>` : tuples of specified type.  This is similar to `struct`, but is anonymous and the fields do not have names.
     52- `$tuple<T,...>` : tuples of specified type.  This is similar to `struct`, but there is no tag and the fields do not have names.
    5253- Type definitions have the form: `typedef typename ID;`
    5354
     
    157158- `t.i` : the value of component `i` (a constant integer) of tuple `t`
    158159- `($tuple<T1,...>){ expr1, ... }` : the literal tuple with the given list of components.
    159 - `t[i : expr1]` : the tuple which is the same as `t`, except for component `i` (a constant integer), which has value `expr1`
     160- `t.[i : expr1]` : the tuple which is the same as `t`, except for component `i` (a constant integer), which has value `expr1`
    160161
    161162Mutating expressions:
    162 - `t[i] = expr` : sets component `i` of tuple `t` to `expr`
     163- `t.[i] = expr` : sets component `i` of tuple `t` to `expr`
    163164
    164165== Sets
     
    169170
    170171Logic functions:
    171 - `$pure $logic _Bool $set_contains($set<T> s, T x);` :  // is x an element of s?
    172 - `$pure $logic $set<T> $set_with($set<T> s, T x);` : // s U {x}
    173 - `$pure $logic $set<T> $set_without($set<T> s, T x);` : // s - {x}
    174 - `$pure $logic $set<T> $set_union($set<T> s1, $set<T> s2);` : // s1 U s2
    175 - `$pure $logic $set<T> $set_difference($set<T> s1, $set<T> s2);` : // s1-s2
    176 - `$pure $logic $set_intersection($set<T> s1, $set<T> s2);` : // s1 \cap s2
    177 - `$pure $logic T[] $set_elements($set<T> s);` : // returns the set of elements of `s` as an array in some deterministic order
    178 - `$pure $logic _Bool $set_isSubsetOf($set<T> s1, $set<T> s2);` : is `s1` a subset of `s2`?
    179 - `$pure $logic $set<U> $set_map($set<T> s, $fun<T,U> f);` : the set { f(x) | x in s}
    180 - `$pure logic $set<T> $set_comprehension($set<T>, $fun<T,_Bool> p);` : the set { x in s | p(x) }
     172- `$pure $logic $bool $set_contains($set<T> s, T x);`
     173 * is `x` an element of `s`?
     174- `$pure $logic $set<T> $set_with($set<T> s, T x);`
     175 * `s` U {`x`}
     176- `$pure $logic $set<T> $set_without($set<T> s, T x);`
     177 * `s` - {`x`}
     178- `$pure $logic $set<T> $set_union($set<T> s1, $set<T> s2);`
     179 * `s1` U `s2`
     180- `$pure $logic $set<T> $set_difference($set<T> s1, $set<T> s2);`
     181 * `s1`-`s2`
     182- `$pure $logic $set_intersection($set<T> s1, $set<T> s2);`
     183 * `s1`  \cap `s2`
     184- `$pure $logic T[] $set_elements($set<T> s);`
     185 * returns the set of elements of `s` as an array in some deterministic order
     186- `$pure $logic $bool $set_isSubsetOf($set<T> s1, $set<T> s2);`
     187 * is `s1` a subset of `s2`?
     188- `$pure $logic $set<U> $set_map($set<T> s, $fun<T,U> f);`
     189 * { `f`(`x`) | `x` in `s`}
     190- `$pure logic $set<T> $set_comprehension($set<T>, $fun<T,$bool> p);`
     191 * { `x` in `s` | `p`(`x`) }
    181192
    182193Mutating procedures:
    183 - ` _Bool $set_add($set<T> * this, T x);`
    184 - ` _Bool $set_remove($set<T> * this, T x);`
     194- `$bool $set_add($set<T> * this, T x);`
     195- `$bool $set_remove($set<T> * this, T x);`
    185196- `void $set_addAll($set<T> * this, $set<T> that);`
    186197- `void $set_removeAll($set<T> * this, $set<T> that);`
     
    189200==  Sequences (arrays)
    190201
    191 Non-mutating expressions:
     202Expressions:
    192203- `a1 == a2`
    193204- `a[i]`
    194 - `(T[]){ x1, ... }`
     205- `(T[]){ expr1, ... }`
    195206
    196207Logic functions:
    197 - `$logic T[] $seq_fun($int len, $fun<$int,T> f);`
    198 - `$logic T[] $seq_uniform($int n, T val);`
    199 - `$logic $int $length(T[] a);` // length of a
    200 - `$logic T[] $seq_write(T[] a, int i, T x);`  // a[i:=x]
    201 - `$logic T[] $seq_subseq(T[] a, int i, int n);`  // a[i..i+n-1]
    202 - `$logic T[] $seq_without(T[] a, int i);` // a with position i removed
    203 - `$logic T[] $seq_with(T[] a, int i, T x);`
    204 - `$logic T[] $seq_concat(T[] a1, T[] a2);`
    205 - `$logic U[] $seq_map(T[] a, $fun<T,U> f);`
    206 - `$logic T[] $seq_filter(T[] a, $fun<T,_Bool> f);`
    207 - `$logic U $seq_foldl(T[] a, $fun<$tuple<T,U>,U> f, U init);`
    208 - `$logic U $seq_foldr(T[] a, $fun<$tuple<T,U>,U> f, U init); `
     208- `$pure $logic T[] $seq_fun($int len, $fun<$int,T> f);`
     209- `$pure $logic T[] $seq_uniform($int n, T val);`
     210- `$pure $logic $int $length(T[] a);` // length of a
     211- `$pure $logic T[] $seq_write(T[] a, int i, T x);`  // a[i:=x]
     212- `$pure $logic T[] $seq_subseq(T[] a, int i, int n);`  // a[i..i+n-1]
     213- `$pure $logic T[] $seq_without(T[] a, int i);` // a with position i removed
     214- `$pure $logic T[] $seq_with(T[] a, int i, T x);`
     215- `$pure $logic T[] $seq_concat(T[] a1, T[] a2);`
     216- `$pure $logic U[] $seq_map(T[] a, $fun<T,U> f);`
     217- `$pure $logic T[] $seq_filter(T[] a, $fun<T,$bool> f);`
     218- `$pure $logic U $seq_foldl(T[] a, $fun<$tuple<T,U>,U> f, U init);`
     219- `$pure $logic U $seq_foldr(T[] a, $fun<$tuple<T,U>,U> f, U init);`
    209220
    210221Mutating expressions:
     
    222233- `($map<K,V>)$empty`
    223234- `$logic V $map_get($map<K,V> K key);`
    224 - `$logic _Bool $map_containsKey($map<K,V> map, K key);`
    225 - `$logic _Bool $map_containsValue($map<K,V> map, V val);`
     235- `$logic $bool $map_containsKey($map<K,V> map, K key);`
     236- `$logic $bool $map_containsValue($map<K,V> map, V val);`
    226237- `$logic $map<K,V> $map_with($map<K,V> map, K key, V val);`
    227238- `$logic $map<K,V> $map_without($map<K,V> map, K key);`