File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
CoqOfRust/examples/default/examples/custom Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ Require Import CoqOfRust.CoqOfRust.
2+ Require Import CoqOfRust.links.M.
3+ Require Import examples.default.examples.custom.loops_free.
4+
5+ (* pub fn max2(a: u32, b: u32) -> u32 *)
6+ Instance run_max2 (a b : U32.t) : Run.Trait max2 [] [] [φ a; φ b] U32.t.
7+ Proof .
8+ constructor.
9+ run_symbolic.
10+ Defined .
Original file line number Diff line number Diff line change 1+ Require Import CoqOfRust.CoqOfRust.
2+ Require Import CoqOfRust.links.M.
3+ Require Import CoqOfRust.simulate.M.
4+ Require Import examples.default.examples.custom.links.loops_free.
5+
6+ Definition max2 (a b : U32.t) : U32.t :=
7+ if a.(Integer.value) <? b.(Integer.value) then
8+ b
9+ else
10+ a.
11+
12+ Lemma max2_eq (a b : U32.t) :
13+ {{
14+ SimulateM.eval_f (Stack := []) (run_max2 a b) tt 🌲
15+ (Output.Success (max2 a b), tt)
16+ }}.
17+ Proof .
18+ unfold max2.
19+ repeat (
20+ cbn ||
21+ get_can_access ||
22+ eapply Run.Call ||
23+ apply Run.Pure ||
24+ destruct (_ <? _)
25+ ).
26+ Qed .
You can’t perform that action at this time.
0 commit comments