@cella-lang/cpp 0.1.202610110442 → 0.1.202610110926

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGES.md CHANGED
@@ -5,6 +5,15 @@
5
5
 
6
6
  ## 未發佈
7
7
 
8
+ ### 執行時遇到未定義行為就停下(**不相容**)
9
+
10
+ - 新增:`Why`(`mkWhy` 前置條件名 標準條文 參與的值 失敗運算的標籤——這是 UB 的身分;某個平台的 sanitizer 怎麼報是證據,不在語意裡)、`Ck`(`ckOk`/`ckUndef`)、`onCk`、`bindCk`、`checked`(`checkedAt`)、`andCk`、`orCk`、`condCk`;組合子 `assignC`、`returnSC`、`ifSC`、`whileFC`、`doWhileFC`、`switchIC`、`callUC`;`haltUb`、`whileStepAt`。
11
+ - 有前置條件的運算寫成 `checked why pre (fun h => …)`:執行時把 `pre` 算出來,成立才把等式當證明交給運算,不成立就停在 `undef why`(帶這個運算的標籤)。`andCk`/`orCk`/`condCk` 只算被求值的一側(短路)。
12
+ - **不相容**:`Flow` 多了 `undef (w : Why)`;`Call` 多了 `ubOut (w : Why)`。對它們做 match 的程式要補這一支。
13
+ - **不相容**:小步語意的建構子改成收帶檢查的計算——`sAssignC`、`sIfC`、`sWhileC`、`sReturnC`、`sCallC`、`sDoWhileC`、`sSwitchC`(運算式的位置是 `S -> Ck _`);`kLoop` 的條件是 `S -> Ck Bool`。原本的名字 `sAssign`、`sIf`、`sWhile`、`sReturn`、`sCall`、`sDoWhile`、`sSwitch` 改成定義(包一層 `ckOk`),**建構的寫法不變**,只有對建構子做 match 的程式要改名。
14
+ - 整數運算的執行時檢查版本:`addC`、`subC`、`mulC`、`divC`、`remC`、`negC`、`shlC`、`shrC`(`p lab a b`,結果是 `Ck (Val _)`);前置條件依序檢查——除法先 `nonZero` 再 `noOverflow`,左移先 `shiftAmount` 再 `shiftBase`(C++17)。輔助:`okB`、`okOf`、`checkedOk`、`checkedNz`、`opC`、`divOpC`、`remOpC`、`shlBaseB`、`vals2`、`notTrueFalse`。
15
+ - 一致性證明(`execDenote`、`execDenoteLoop`)涵蓋 undef:小步執行停在 undef 時,組合子的指稱也是同一個 undef。
16
+
8
17
  ### string 修改的丟例外版
9
18
 
10
19
  - `strInsertX`、`strEraseX`、`strReplaceX`。
package/cpp.cell CHANGED
Binary file