Changes between Initial Version and Version 1 of Changes2023


Ignore:
Timestamp:
05/24/23 22:47:15 (3 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Changes2023

    v1 v1  
     1
     2Name Changes
     3{{{
     4$local_start  --> $begin_local
     5$local_end    --> $end_local
     6$pathCondition --> $print_path_condition
     7$hidden --> $is_hidden
     8$assume_push --> $push_assumption
     9$assume_pop --> $pop_assumption
     10$read_set_push --> $push_reads
     11$write_set_push --> $push_writes
     12$read_set_pop --> $pop_reads
     13$write_set_pop --> $pop_writes
     14$read_set_peek --> $peek_reads
     15$write_set_peek --> $peek_writes
     16$atomic_f --> ?
     17$default_value --> $initialize
     18}}}
     19
     20
     21add doc for `$is_concrete_int` (`civlc.cvh`).
     22
     23change def of `$choose_int` to:
     24
     25{{{
     26$atomic_f int $choose_int(int n) {
     27  if ($is_concrete_int(n))
     28    return $choose_int_concrete(n);
     29  else {
     30    int x=0;
     31    for (; x<n-1; x++) {
     32      $choose {
     33        ;
     34        break;
     35      }
     36    }
     37    return x;
     38  }
     39}
     40}}}
     41
     42
     43Move functions from civlc.cvh to libraries...
     44{{{
     45is_derefable, hide, reveal, hidden: pointer.cvh
     46elaborate_domain: domain.cvh
     47}}}
     48
     49`#pragma CIVL` --> `#pragma civl`  (OK?)
     50
     51`\executes_when`: make it work for atomic_f functions?
     52
     53
     54
     55Some functions do not appear in any header:
     56  `$scope_defined`
     57  `$proc_defined`
     58
     59Note: `$proc_null` is defined in `PP2CivlcTokenCConverter.java`
     60from the preprocessor, `$proc_null` is just an IDENTIFIER.
     61This class converts identifiers to the proper token.
     62
     63We should probably replaced these with a single primitive: `$defined`.
     64
     65Language change: atomic/yield/depends:
     66
     67Get rid of begin/end local funtions.
     68
     69Change grammar to allow the following kinds of statements:
     70{{{
     71  $atomic stmt
     72  $yield stmt
     73  $depends_on (expr) stmt
     74}}}
     75
     76Example:
     77{{{
     78$depends_on(expr) $atomic {
     79  A;
     80  $atomic {
     81    B;
     82    $yield {
     83      C // this code is outside of atomic
     84    }
     85    $depends_on(expr) ...;
     86  }
     87}
     88}}}
     89
     90translation:
     91{{{
     92  $atomic S --> begin_atomic; S end_atomic;
     93  $yield S --> begin_yield; S end_yield;
     94}}}
     95
     96semantics:
     97state:
     98{{{
     99  atomicStack: stack of {0,1}. (1=begin_atomic, 0=begin_yield), initially empty
     100}}}
     101transitions:
     102{{{
     103  begin_atomic:
     104    enabled when lock is free or I own it, and first statement after begin_atomic is enabled
     105    if I don't own lock, obtain lock
     106    if atomicStack.length >= max : error
     107    atomicStack.push(1)
     108  end_atomic:
     109    assert !atomicStack.isEmpty() && atomicStack.top==1
     110    atomicStack.pop()
     111    if atomicStack.isEmpty() || atomicStack.top==0, release lock
     112  begin_yield:
     113    enabled when true;
     114    if I own lock, release lock;
     115    if atomicStack.length >= max: error
     116    atomicStack.push(0);
     117  end_yield:
     118    enabled when atomicStack==01* => (lock.isFree && first stmt after yield is enabled);
     119    assert !atomicStack.isEmpty && atomicStack.top==0
     120    atomicStack.pop()
     121    if !atomicStack.isEmpty && atomicStack.top==1, obtain lock
     122}}}
     123
     124Language change:
     125
     126  `$assuming`
     127
     128  `$track (rs,ws) stmt`
     129
     130  `$untrack stmt`
     131