To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

### Partial work on optimizationsTheory

```uvmOptimizationsTheory proves the validity of optimizations on Mu
bytecode. Incomplete proofs are stubbed out with "cheat" or commented
out.```
parent 68dd6b4a
 ... ... @@ -7,5 +7,7 @@ sig val multi_case_tac : tactic val rw_assums : thm list -> tactic val rw_assums_once : thm list -> tactic end
 ... ... @@ -19,5 +19,8 @@ struct fun rw_assums xs = POP_ASSUM_LIST (map_every (assume_tac o REWRITE_RULE xs) o rev) fun rw_assums_once xs = POP_ASSUM_LIST (map_every (assume_tac o ONCE_REWRITE_RULE xs) o rev) end
 open HolKernel Parse boolLib bossLib; open sumSyntax open monadsLib open listTheory (* Monads for options, lists, and sum types. ... ... @@ -32,6 +33,9 @@ val bind_left_INR = store_thm("bind_left_INR", ``(∃y. x = INR y) ⇒ ∀f. bind_left x f = x``, Cases_on `x` >> simp[]) val bind_left_case = store_thm("bind_left_case", ``∀a f. bind_left a f = case a of INL l => f l | INR r => INR r``, Cases >> rw[]) val bind_right_def = Define` bind_right (sum : α + β) (fn : β -> α + γ) : α + γ = ... ... @@ -117,6 +121,16 @@ val right_list_def = Define` right_list (sum : α + β) = case sum of INL _ => [] | INR b => [b] ` val sequence_left_length = store_thm("sequence_left_length", ``∀xs xs'. (sequence_left xs = INL xs') ⇒ (LENGTH xs = LENGTH xs')``, Induct >> rw[] >> fs[definition "sequence_left_def"] >> prove_tac[LENGTH_CONS]) val el_sequence_left = store_thm("el_sequence_left", ``∀xs xs' n. (sequence_left xs = INL xs') ∧ n < LENGTH xs ⇒ (EL n xs = INL (EL n xs'))``, Induct >> rw[] >> fs[definition "sequence_left_def"] >> Cases_on `n` >> rw[]) (* Monad laws for bind_left: left identity, right identity, and associativity *) val bind_left_monad_left_id = store_thm("bind_left_monad_left_id[simp]", ``bind_left (INL a) f = f a``, simp[]) ... ...
 ... ... @@ -64,13 +64,30 @@ val lift_err_msg_def = Define` functionality are included in the default simpset. *) val or_fail_OK_proves = Q.store_thm("or_fail_OK_proves[simp]", `∀opt e. (opt or_fail e = OK x) = (opt = SOME x)`, val or_fail_OK_proves = store_thm("or_fail_OK_proves[simp]", ``∀opt e. (opt or_fail e = OK x) = (opt = SOME x)``, Cases >> rw[]) val assert_OK_proves = store_thm("assert_OK_proves[simp]", ``∀P e. (assert P or_fail e = OK ()) = P``, Cases >> rw[]) val assert_Fail_proves = store_thm("assert_Fail_proves[simp]", ``∀P e e'. (assert P or_fail e = Fail e') ⇔ (e' = e ∧ ¬P)``, Cases >> rw[] >> prove_tac[]) val lift_err_msg_OK = store_thm("lift_err_msg_OK[simp]", ``∀x f y. (lift_err_msg f x = OK y) ⇔ (x = OK y)``, Cases >| [rw[lift_err_msg_def], Cases_on `y` >> rw[lift_err_msg_def]]) val lift_err_msg_Fail = store_thm("lift_err_msg_Fail[simp]", ``∀x y f. (lift_err_msg f x = Fail y) ⇔ (case y of | UndefBehavior m => (∃m'. m = f m' ∧ x = Fail (UndefBehavior m')) | Impossible m => x = Fail (Impossible m) | NotImplemented m => x = Fail (NotImplemented m))``, Cases >> Cases >> rw[lift_err_msg_def] >> Cases_on `y` >> simp[lift_err_msg_def] >> prove_tac[]) val _ = export_theory()