url
stringclasses
147 values
commit
stringclasses
147 values
file_path
stringlengths
7
101
full_name
stringlengths
1
94
start
stringlengths
6
10
end
stringlengths
6
11
tactic
stringlengths
1
11.2k
state_before
stringlengths
3
2.09M
state_after
stringlengths
6
2.09M
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_rem
[640, 1]
[652, 52]
cases br <;> simp
sz : ℕ n m : FinInt sz br : Bool r' : FinInt sz h_full : addfull n m = next br r' ⊢ (match next br r' with | next false a => toUint n + toUint m | next true a => toUint n + toUint m - 2 ^ sz) = if toUint n + toUint m < 2 ^ sz then toUint n + toUint m else toUint n + toUint m - 2 ^ sz
case false sz : ℕ n m r' : FinInt sz h_full : addfull n m = next false r' ⊢ toUint n + toUint m = if toUint n + toUint m < 2 ^ sz then toUint n + toUint m else toUint n + toUint m - 2 ^ sz case true sz : ℕ n m r' : FinInt sz h_full : addfull n m = next true r' ⊢ toUint n + toUint m - 2 ^ sz = if toUint n + toUint m < 2 ^ sz then toUint n + toUint m else toUint n + toUint m - 2 ^ sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_rem
[640, 1]
[652, 52]
. have h := O_lt r'; rw [←h_full] at h simp [FinInt.addfull_toUint] at h; simp [h]
case false sz : ℕ n m r' : FinInt sz h_full : addfull n m = next false r' ⊢ toUint n + toUint m = if toUint n + toUint m < 2 ^ sz then toUint n + toUint m else toUint n + toUint m - 2 ^ sz case true sz : ℕ n m r' : FinInt sz h_full : addfull n m = next true r' ⊢ toUint n + toUint m - 2 ^ sz = if toUint n + toUint m < 2 ^ sz then toUint n + toUint m else toUint n + toUint m - 2 ^ sz
case true sz : ℕ n m r' : FinInt sz h_full : addfull n m = next true r' ⊢ toUint n + toUint m - 2 ^ sz = if toUint n + toUint m < 2 ^ sz then toUint n + toUint m else toUint n + toUint m - 2 ^ sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_rem
[640, 1]
[652, 52]
. have h := I_not_lt r'; rw [←h_full] at h; sorry
case true sz : ℕ n m r' : FinInt sz h_full : addfull n m = next true r' ⊢ toUint n + toUint m - 2 ^ sz = if toUint n + toUint m < 2 ^ sz then toUint n + toUint m else toUint n + toUint m - 2 ^ sz
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint
[654, 1]
[658, 16]
rw [add_toUint_rem]
sz : ℕ n m : FinInt sz ⊢ toUint (n + m) = mod2 (toUint n + toUint m) sz
sz : ℕ n m : FinInt sz ⊢ (if toUint n + toUint m < 2 ^ sz then toUint n + toUint m else toUint n + toUint m - 2 ^ sz) = mod2 (toUint n + toUint m) sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint
[654, 1]
[658, 16]
split
sz : ℕ n m : FinInt sz ⊢ (if toUint n + toUint m < 2 ^ sz then toUint n + toUint m else toUint n + toUint m - 2 ^ sz) = mod2 (toUint n + toUint m) sz
case inl sz : ℕ n m : FinInt sz h✝ : toUint n + toUint m < 2 ^ sz ⊢ toUint n + toUint m = mod2 (toUint n + toUint m) sz case inr sz : ℕ n m : FinInt sz h✝ : ¬toUint n + toUint m < 2 ^ sz ⊢ toUint n + toUint m - 2 ^ sz = mod2 (toUint n + toUint m) sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint
[654, 1]
[658, 16]
. simp [mod2_idem ⟨Int.add_ge_zero _ _ toUint_ge toUint_ge, by assumption⟩]
case inl sz : ℕ n m : FinInt sz h✝ : toUint n + toUint m < 2 ^ sz ⊢ toUint n + toUint m = mod2 (toUint n + toUint m) sz case inr sz : ℕ n m : FinInt sz h✝ : ¬toUint n + toUint m < 2 ^ sz ⊢ toUint n + toUint m - 2 ^ sz = mod2 (toUint n + toUint m) sz
case inr sz : ℕ n m : FinInt sz h✝ : ¬toUint n + toUint m < 2 ^ sz ⊢ toUint n + toUint m - 2 ^ sz = mod2 (toUint n + toUint m) sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint
[654, 1]
[658, 16]
. sorry_arith
case inr sz : ℕ n m : FinInt sz h✝ : ¬toUint n + toUint m < 2 ^ sz ⊢ toUint n + toUint m - 2 ^ sz = mod2 (toUint n + toUint m) sz
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint
[654, 1]
[658, 16]
assumption
sz : ℕ n m : FinInt sz h✝ : toUint n + toUint m < 2 ^ sz ⊢ toUint ?m.152087 + toUint ?m.152089 < 2 ^ ?m.152070
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_cong2
[660, 1]
[662, 46]
simp [cong2, toUint_mod2]
sz : ℕ n m : FinInt sz ⊢ toUint (n + m) ≡ toUint n + toUint m [2^sz]
sz : ℕ n m : FinInt sz ⊢ toUint (n + m) = mod2 (toUint n + toUint m) sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toUint_cong2
[660, 1]
[662, 46]
apply add_toUint
sz : ℕ n m : FinInt sz ⊢ toUint (n + m) = mod2 (toUint n + toUint m) sz
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
have h := addfull_toSint n m
sz : ℕ n m : FinInt (sz + 1) ⊢ toSint (n + m) = match n, m with | next false n', next false m' => match n + m with | next false a => toSint n + toSint m | next true a => toSint n + toSint m - 2 ^ (sz + 1) | next false n', next true m' => toSint n + toSint m | next true n', next false m' => toSint n + toSint m | next true n', next true m' => match n + m with | next false a => toSint n + toSint m + 2 ^ (sz + 1) | next true a => toSint n + toSint m
sz : ℕ n m : FinInt (sz + 1) h : toSint (addfull n m) = match n, m with | next false n', next false m' => toSint n + toSint m | next false n', next true m' => match addfull n m with | next false a => toSint n + toSint m + 2 ^ (sz + 1) | next true a => toSint n + toSint m - 2 ^ (sz + 1) | next true n', next false m' => match addfull n m with | next false a => toSint n + toSint m + 2 ^ (sz + 1) | next true a => toSint n + toSint m - 2 ^ (sz + 1) | next true n', next true m' => toSint n + toSint m ⊢ toSint (n + m) = match n, m with | next false n', next false m' => match n + m with | next false a => toSint n + toSint m | next true a => toSint n + toSint m - 2 ^ (sz + 1) | next false n', next true m' => toSint n + toSint m | next true n', next false m' => toSint n + toSint m | next true n', next true m' => match n + m with | next false a => toSint n + toSint m + 2 ^ (sz + 1) | next true a => toSint n + toSint m
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
cases n
sz : ℕ n m : FinInt (sz + 1) h : toSint (addfull n m) = match n, m with | next false n', next false m' => toSint n + toSint m | next false n', next true m' => match addfull n m with | next false a => toSint n + toSint m + 2 ^ (sz + 1) | next true a => toSint n + toSint m - 2 ^ (sz + 1) | next true n', next false m' => match addfull n m with | next false a => toSint n + toSint m + 2 ^ (sz + 1) | next true a => toSint n + toSint m - 2 ^ (sz + 1) | next true n', next true m' => toSint n + toSint m ⊢ toSint (n + m) = match n, m with | next false n', next false m' => match n + m with | next false a => toSint n + toSint m | next true a => toSint n + toSint m - 2 ^ (sz + 1) | next false n', next true m' => toSint n + toSint m | next true n', next false m' => toSint n + toSint m | next true n', next true m' => match n + m with | next false a => toSint n + toSint m + 2 ^ (sz + 1) | next true a => toSint n + toSint m
case next sz : ℕ m : FinInt (sz + 1) a✝¹ : Bool a✝ : FinInt sz h : toSint (addfull (next a✝¹ a✝) m) = match next a✝¹ a✝, m with | next false n', next false m' => toSint (next a✝¹ a✝) + toSint m | next false n', next true m' => match addfull (next a✝¹ a✝) m with | next false a => toSint (next a✝¹ a✝) + toSint m + 2 ^ (sz + 1) | next true a => toSint (next a✝¹ a✝) + toSint m - 2 ^ (sz + 1) | next true n', next false m' => match addfull (next a✝¹ a✝) m with | next false a => toSint (next a✝¹ a✝) + toSint m + 2 ^ (sz + 1) | next true a => toSint (next a✝¹ a✝) + toSint m - 2 ^ (sz + 1) | next true n', next true m' => toSint (next a✝¹ a✝) + toSint m ⊢ toSint (next a✝¹ a✝ + m) = match next a✝¹ a✝, m with | next false n', next false m' => match next a✝¹ a✝ + m with | next false a => toSint (next a✝¹ a✝) + toSint m | next true a => toSint (next a✝¹ a✝) + toSint m - 2 ^ (sz + 1) | next false n', next true m' => toSint (next a✝¹ a✝) + toSint m | next true n', next false m' => toSint (next a✝¹ a✝) + toSint m | next true n', next true m' => match next a✝¹ a✝ + m with | next false a => toSint (next a✝¹ a✝) + toSint m + 2 ^ (sz + 1) | next true a => toSint (next a✝¹ a✝) + toSint m
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
case next bn n' => cases m; case next bm m' => cases bn <;> cases bm <;> simp [addfull] at * case false.false => match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, toSint] at * <;> sorry_arith case false.true => match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith case true.false => match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith case true.true => match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, toSint] at * <;> sorry_arith
sz : ℕ m : FinInt (sz + 1) bn : Bool n' : FinInt sz h : toSint (addfull (next bn n') m) = match next bn n', m with | next false n'_1, next false m' => toSint (next bn n') + toSint m | next false n'_1, next true m' => match addfull (next bn n') m with | next false a => toSint (next bn n') + toSint m + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint m - 2 ^ (sz + 1) | next true n'_1, next false m' => match addfull (next bn n') m with | next false a => toSint (next bn n') + toSint m + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint m - 2 ^ (sz + 1) | next true n'_1, next true m' => toSint (next bn n') + toSint m ⊢ toSint (next bn n' + m) = match next bn n', m with | next false n'_1, next false m' => match next bn n' + m with | next false a => toSint (next bn n') + toSint m | next true a => toSint (next bn n') + toSint m - 2 ^ (sz + 1) | next false n'_1, next true m' => toSint (next bn n') + toSint m | next true n'_1, next false m' => toSint (next bn n') + toSint m | next true n'_1, next true m' => match next bn n' + m with | next false a => toSint (next bn n') + toSint m + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint m
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
cases m
sz : ℕ m : FinInt (sz + 1) bn : Bool n' : FinInt sz h : toSint (addfull (next bn n') m) = match next bn n', m with | next false n'_1, next false m' => toSint (next bn n') + toSint m | next false n'_1, next true m' => match addfull (next bn n') m with | next false a => toSint (next bn n') + toSint m + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint m - 2 ^ (sz + 1) | next true n'_1, next false m' => match addfull (next bn n') m with | next false a => toSint (next bn n') + toSint m + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint m - 2 ^ (sz + 1) | next true n'_1, next true m' => toSint (next bn n') + toSint m ⊢ toSint (next bn n' + m) = match next bn n', m with | next false n'_1, next false m' => match next bn n' + m with | next false a => toSint (next bn n') + toSint m | next true a => toSint (next bn n') + toSint m - 2 ^ (sz + 1) | next false n'_1, next true m' => toSint (next bn n') + toSint m | next true n'_1, next false m' => toSint (next bn n') + toSint m | next true n'_1, next true m' => match next bn n' + m with | next false a => toSint (next bn n') + toSint m + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint m
case next sz : ℕ bn : Bool n' : FinInt sz a✝¹ : Bool a✝ : FinInt sz h : toSint (addfull (next bn n') (next a✝¹ a✝)) = match next bn n', next a✝¹ a✝ with | next false n'_1, next false m' => toSint (next bn n') + toSint (next a✝¹ a✝) | next false n'_1, next true m' => match addfull (next bn n') (next a✝¹ a✝) with | next false a => toSint (next bn n') + toSint (next a✝¹ a✝) + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint (next a✝¹ a✝) - 2 ^ (sz + 1) | next true n'_1, next false m' => match addfull (next bn n') (next a✝¹ a✝) with | next false a => toSint (next bn n') + toSint (next a✝¹ a✝) + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint (next a✝¹ a✝) - 2 ^ (sz + 1) | next true n'_1, next true m' => toSint (next bn n') + toSint (next a✝¹ a✝) ⊢ toSint (next bn n' + next a✝¹ a✝) = match next bn n', next a✝¹ a✝ with | next false n'_1, next false m' => match next bn n' + next a✝¹ a✝ with | next false a => toSint (next bn n') + toSint (next a✝¹ a✝) | next true a => toSint (next bn n') + toSint (next a✝¹ a✝) - 2 ^ (sz + 1) | next false n'_1, next true m' => toSint (next bn n') + toSint (next a✝¹ a✝) | next true n'_1, next false m' => toSint (next bn n') + toSint (next a✝¹ a✝) | next true n'_1, next true m' => match next bn n' + next a✝¹ a✝ with | next false a => toSint (next bn n') + toSint (next a✝¹ a✝) + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint (next a✝¹ a✝)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
case next bm m' => cases bn <;> cases bm <;> simp [addfull] at * case false.false => match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, toSint] at * <;> sorry_arith case false.true => match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith case true.false => match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith case true.true => match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, toSint] at * <;> sorry_arith
sz : ℕ bn : Bool n' : FinInt sz bm : Bool m' : FinInt sz h : toSint (addfull (next bn n') (next bm m')) = match next bn n', next bm m' with | next false n'_1, next false m'_1 => toSint (next bn n') + toSint (next bm m') | next false n'_1, next true m'_1 => match addfull (next bn n') (next bm m') with | next false a => toSint (next bn n') + toSint (next bm m') + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint (next bm m') - 2 ^ (sz + 1) | next true n'_1, next false m'_1 => match addfull (next bn n') (next bm m') with | next false a => toSint (next bn n') + toSint (next bm m') + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint (next bm m') - 2 ^ (sz + 1) | next true n'_1, next true m'_1 => toSint (next bn n') + toSint (next bm m') ⊢ toSint (next bn n' + next bm m') = match next bn n', next bm m' with | next false n'_1, next false m'_1 => match next bn n' + next bm m' with | next false a => toSint (next bn n') + toSint (next bm m') | next true a => toSint (next bn n') + toSint (next bm m') - 2 ^ (sz + 1) | next false n'_1, next true m'_1 => toSint (next bn n') + toSint (next bm m') | next true n'_1, next false m'_1 => toSint (next bn n') + toSint (next bm m') | next true n'_1, next true m'_1 => match next bn n' + next bm m' with | next false a => toSint (next bn n') + toSint (next bm m') + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint (next bm m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
cases bn <;> cases bm <;> simp [addfull] at *
sz : ℕ bn : Bool n' : FinInt sz bm : Bool m' : FinInt sz h : toSint (addfull (next bn n') (next bm m')) = match next bn n', next bm m' with | next false n'_1, next false m'_1 => toSint (next bn n') + toSint (next bm m') | next false n'_1, next true m'_1 => match addfull (next bn n') (next bm m') with | next false a => toSint (next bn n') + toSint (next bm m') + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint (next bm m') - 2 ^ (sz + 1) | next true n'_1, next false m'_1 => match addfull (next bn n') (next bm m') with | next false a => toSint (next bn n') + toSint (next bm m') + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint (next bm m') - 2 ^ (sz + 1) | next true n'_1, next true m'_1 => toSint (next bn n') + toSint (next bm m') ⊢ toSint (next bn n' + next bm m') = match next bn n', next bm m' with | next false n'_1, next false m'_1 => match next bn n' + next bm m' with | next false a => toSint (next bn n') + toSint (next bm m') | next true a => toSint (next bn n') + toSint (next bm m') - 2 ^ (sz + 1) | next false n'_1, next true m'_1 => toSint (next bn n') + toSint (next bm m') | next true n'_1, next false m'_1 => toSint (next bn n') + toSint (next bm m') | next true n'_1, next true m'_1 => match next bn n' + next bm m' with | next false a => toSint (next bn n') + toSint (next bm m') + 2 ^ (sz + 1) | next true a => toSint (next bn n') + toSint (next bm m')
case false.false sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next false (next false r) | next true r => next false (next true r)) = toSint (next false n') + toSint (next false m') ⊢ toSint (next false n' + next false m') = match next false n' + next false m' with | next false a => toSint (next false n') + toSint (next false m') | next true a => toSint (next false n') + toSint (next false m') - 2 ^ (sz + 1) case false.true sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next false (next (false != true) r) | next true r => next true (next (false == true) r)) = match match addfull n' m' with | next false r => next false (next (false != true) r) | next true r => next true (next (false == true) r) with | next false a => toSint (next false n') + toSint (next true m') + 2 ^ (sz + 1) | next true a => toSint (next false n') + toSint (next true m') - 2 ^ (sz + 1) ⊢ toSint (next false n' + next true m') = toSint (next false n') + toSint (next true m') case true.false sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next false (next (true != false) r) | next true r => next true (next (true == false) r)) = match match addfull n' m' with | next false r => next false (next (true != false) r) | next true r => next true (next (true == false) r) with | next false a => toSint (next true n') + toSint (next false m') + 2 ^ (sz + 1) | next true a => toSint (next true n') + toSint (next false m') - 2 ^ (sz + 1) ⊢ toSint (next true n' + next false m') = toSint (next true n') + toSint (next false m') case true.true sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next true (next false r) | next true r => next true (next true r)) = toSint (next true n') + toSint (next true m') ⊢ toSint (next true n' + next true m') = match next true n' + next true m' with | next false a => toSint (next true n') + toSint (next true m') + 2 ^ (sz + 1) | next true a => toSint (next true n') + toSint (next true m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
case false.false => match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, toSint] at * <;> sorry_arith
sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next false (next false r) | next true r => next false (next true r)) = toSint (next false n') + toSint (next false m') ⊢ toSint (next false n' + next false m') = match next false n' + next false m' with | next false a => toSint (next false n') + toSint (next false m') | next true a => toSint (next false n') + toSint (next false m') - 2 ^ (sz + 1)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
case false.true => match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next false (next (false != true) r) | next true r => next true (next (false == true) r)) = match match addfull n' m' with | next false r => next false (next (false != true) r) | next true r => next true (next (false == true) r) with | next false a => toSint (next false n') + toSint (next true m') + 2 ^ (sz + 1) | next true a => toSint (next false n') + toSint (next true m') - 2 ^ (sz + 1) ⊢ toSint (next false n' + next true m') = toSint (next false n') + toSint (next true m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
case true.false => match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next false (next (true != false) r) | next true r => next true (next (true == false) r)) = match match addfull n' m' with | next false r => next false (next (true != false) r) | next true r => next true (next (true == false) r) with | next false a => toSint (next true n') + toSint (next false m') + 2 ^ (sz + 1) | next true a => toSint (next true n') + toSint (next false m') - 2 ^ (sz + 1) ⊢ toSint (next true n' + next false m') = toSint (next true n') + toSint (next false m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
case true.true => match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, toSint] at * <;> sorry_arith
sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next true (next false r) | next true r => next true (next true r)) = toSint (next true n') + toSint (next true m') ⊢ toSint (next true n' + next true m') = match next true n' + next true m' with | next false a => toSint (next true n') + toSint (next true m') + 2 ^ (sz + 1) | next true a => toSint (next true n') + toSint (next true m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, toSint] at * <;> sorry_arith
sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next false (next false r) | next true r => next false (next true r)) = toSint (next false n') + toSint (next false m') ⊢ toSint (next false n' + next false m') = match next false n' + next false m' with | next false a => toSint (next false n') + toSint (next false m') | next true a => toSint (next false n') + toSint (next false m') - 2 ^ (sz + 1)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
rw [h'] at h
sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next false (next false r) | next true r => next false (next true r)) = toSint (next false n') + toSint (next false m') br : Bool r : FinInt sz h' : addfull n' m' = next br r ⊢ toSint (next false n' + next false m') = match next false n' + next false m' with | next false a => toSint (next false n') + toSint (next false m') | next true a => toSint (next false n') + toSint (next false m') - 2 ^ (sz + 1)
sz : ℕ n' m' : FinInt sz br : Bool r : FinInt sz h : toSint (match next br r with | next false r => next false (next false r) | next true r => next false (next true r)) = toSint (next false n') + toSint (next false m') h' : addfull n' m' = next br r ⊢ toSint (next false n' + next false m') = match next false n' + next false m' with | next false a => toSint (next false n') + toSint (next false m') | next true a => toSint (next false n') + toSint (next false m') - 2 ^ (sz + 1)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
cases br <;> simp [bne, toSint] at * <;> sorry_arith
sz : ℕ n' m' : FinInt sz br : Bool r : FinInt sz h : toSint (match next br r with | next false r => next false (next false r) | next true r => next false (next true r)) = toSint (next false n') + toSint (next false m') h' : addfull n' m' = next br r ⊢ toSint (next false n' + next false m') = match next false n' + next false m' with | next false a => toSint (next false n') + toSint (next false m') | next true a => toSint (next false n') + toSint (next false m') - 2 ^ (sz + 1)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next false (next (false != true) r) | next true r => next true (next (false == true) r)) = match match addfull n' m' with | next false r => next false (next (false != true) r) | next true r => next true (next (false == true) r) with | next false a => toSint (next false n') + toSint (next true m') + 2 ^ (sz + 1) | next true a => toSint (next false n') + toSint (next true m') - 2 ^ (sz + 1) ⊢ toSint (next false n' + next true m') = toSint (next false n') + toSint (next true m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
rw [h'] at h
sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next false (next (false != true) r) | next true r => next true (next (false == true) r)) = match match addfull n' m' with | next false r => next false (next (false != true) r) | next true r => next true (next (false == true) r) with | next false a => toSint (next false n') + toSint (next true m') + 2 ^ (sz + 1) | next true a => toSint (next false n') + toSint (next true m') - 2 ^ (sz + 1) br : Bool r : FinInt sz h' : addfull n' m' = next br r ⊢ toSint (next false n' + next true m') = toSint (next false n') + toSint (next true m')
sz : ℕ n' m' : FinInt sz br : Bool r : FinInt sz h : toSint (match next br r with | next false r => next false (next (false != true) r) | next true r => next true (next (false == true) r)) = match match next br r with | next false r => next false (next (false != true) r) | next true r => next true (next (false == true) r) with | next false a => toSint (next false n') + toSint (next true m') + 2 ^ (sz + 1) | next true a => toSint (next false n') + toSint (next true m') - 2 ^ (sz + 1) h' : addfull n' m' = next br r ⊢ toSint (next false n' + next true m') = toSint (next false n') + toSint (next true m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
sz : ℕ n' m' : FinInt sz br : Bool r : FinInt sz h : toSint (match next br r with | next false r => next false (next (false != true) r) | next true r => next true (next (false == true) r)) = match match next br r with | next false r => next false (next (false != true) r) | next true r => next true (next (false == true) r) with | next false a => toSint (next false n') + toSint (next true m') + 2 ^ (sz + 1) | next true a => toSint (next false n') + toSint (next true m') - 2 ^ (sz + 1) h' : addfull n' m' = next br r ⊢ toSint (next false n' + next true m') = toSint (next false n') + toSint (next true m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next false (next (true != false) r) | next true r => next true (next (true == false) r)) = match match addfull n' m' with | next false r => next false (next (true != false) r) | next true r => next true (next (true == false) r) with | next false a => toSint (next true n') + toSint (next false m') + 2 ^ (sz + 1) | next true a => toSint (next true n') + toSint (next false m') - 2 ^ (sz + 1) ⊢ toSint (next true n' + next false m') = toSint (next true n') + toSint (next false m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
rw [h'] at h
sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next false (next (true != false) r) | next true r => next true (next (true == false) r)) = match match addfull n' m' with | next false r => next false (next (true != false) r) | next true r => next true (next (true == false) r) with | next false a => toSint (next true n') + toSint (next false m') + 2 ^ (sz + 1) | next true a => toSint (next true n') + toSint (next false m') - 2 ^ (sz + 1) br : Bool r : FinInt sz h' : addfull n' m' = next br r ⊢ toSint (next true n' + next false m') = toSint (next true n') + toSint (next false m')
sz : ℕ n' m' : FinInt sz br : Bool r : FinInt sz h : toSint (match next br r with | next false r => next false (next (true != false) r) | next true r => next true (next (true == false) r)) = match match next br r with | next false r => next false (next (true != false) r) | next true r => next true (next (true == false) r) with | next false a => toSint (next true n') + toSint (next false m') + 2 ^ (sz + 1) | next true a => toSint (next true n') + toSint (next false m') - 2 ^ (sz + 1) h' : addfull n' m' = next br r ⊢ toSint (next true n' + next false m') = toSint (next true n') + toSint (next false m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
cases br <;> simp [bne, BEq.beq, toSint] at * <;> sorry_arith
sz : ℕ n' m' : FinInt sz br : Bool r : FinInt sz h : toSint (match next br r with | next false r => next false (next (true != false) r) | next true r => next true (next (true == false) r)) = match match next br r with | next false r => next false (next (true != false) r) | next true r => next true (next (true == false) r) with | next false a => toSint (next true n') + toSint (next false m') + 2 ^ (sz + 1) | next true a => toSint (next true n') + toSint (next false m') - 2 ^ (sz + 1) h' : addfull n' m' = next br r ⊢ toSint (next true n' + next false m') = toSint (next true n') + toSint (next false m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
match h': addfull n' m' with | .next br r => rw [h'] at h cases br <;> simp [bne, toSint] at * <;> sorry_arith
sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next true (next false r) | next true r => next true (next true r)) = toSint (next true n') + toSint (next true m') ⊢ toSint (next true n' + next true m') = match next true n' + next true m' with | next false a => toSint (next true n') + toSint (next true m') + 2 ^ (sz + 1) | next true a => toSint (next true n') + toSint (next true m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
rw [h'] at h
sz : ℕ n' m' : FinInt sz h : toSint (match addfull n' m' with | next false r => next true (next false r) | next true r => next true (next true r)) = toSint (next true n') + toSint (next true m') br : Bool r : FinInt sz h' : addfull n' m' = next br r ⊢ toSint (next true n' + next true m') = match next true n' + next true m' with | next false a => toSint (next true n') + toSint (next true m') + 2 ^ (sz + 1) | next true a => toSint (next true n') + toSint (next true m')
sz : ℕ n' m' : FinInt sz br : Bool r : FinInt sz h : toSint (match next br r with | next false r => next true (next false r) | next true r => next true (next true r)) = toSint (next true n') + toSint (next true m') h' : addfull n' m' = next br r ⊢ toSint (next true n' + next true m') = match next true n' + next true m' with | next false a => toSint (next true n') + toSint (next true m') + 2 ^ (sz + 1) | next true a => toSint (next true n') + toSint (next true m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.add_toSint_msb
[664, 1]
[703, 59]
cases br <;> simp [bne, toSint] at * <;> sorry_arith
sz : ℕ n' m' : FinInt sz br : Bool r : FinInt sz h : toSint (match next br r with | next false r => next true (next false r) | next true r => next true (next true r)) = toSint (next true n') + toSint (next true m') h' : addfull n' m' = next br r ⊢ toSint (next true n' + next true m') = match next true n' + next true m' with | next false a => toSint (next true n') + toSint (next true m') + 2 ^ (sz + 1) | next true a => toSint (next true n') + toSint (next true m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_comm
[716, 1]
[718, 49]
simp [addv]
sz : ℕ n m : FinInt (sz + 1) ⊢ addv n m = addv m n
sz : ℕ n m : FinInt (sz + 1) ⊢ (match n, m with | next false n', next false m' => match n + m with | next msb r' => (next msb r', msb) | next true n', next true m' => match n + m with | next msb r' => (next msb r', !msb) | x, x_1 => (n + m, false)) = match m, n with | next false n', next false m' => match m + n with | next msb r' => (next msb r', msb) | next true n', next true m' => match m + n with | next msb r' => (next msb r', !msb) | x, x_1 => (m + n, false)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_comm
[716, 1]
[718, 49]
cases n
sz : ℕ n m : FinInt (sz + 1) ⊢ (match n, m with | next false n', next false m' => match n + m with | next msb r' => (next msb r', msb) | next true n', next true m' => match n + m with | next msb r' => (next msb r', !msb) | x, x_1 => (n + m, false)) = match m, n with | next false n', next false m' => match m + n with | next msb r' => (next msb r', msb) | next true n', next true m' => match m + n with | next msb r' => (next msb r', !msb) | x, x_1 => (m + n, false)
case next sz : ℕ m : FinInt (sz + 1) a✝¹ : Bool a✝ : FinInt sz ⊢ (match next a✝¹ a✝, m with | next false n', next false m' => match next a✝¹ a✝ + m with | next msb r' => (next msb r', msb) | next true n', next true m' => match next a✝¹ a✝ + m with | next msb r' => (next msb r', !msb) | x, x_1 => (next a✝¹ a✝ + m, false)) = match m, next a✝¹ a✝ with | next false n', next false m' => match m + next a✝¹ a✝ with | next msb r' => (next msb r', msb) | next true n', next true m' => match m + next a✝¹ a✝ with | next msb r' => (next msb r', !msb) | x, x_1 => (m + next a✝¹ a✝, false)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_comm
[716, 1]
[718, 49]
cases m
case next sz : ℕ m : FinInt (sz + 1) a✝¹ : Bool a✝ : FinInt sz ⊢ (match next a✝¹ a✝, m with | next false n', next false m' => match next a✝¹ a✝ + m with | next msb r' => (next msb r', msb) | next true n', next true m' => match next a✝¹ a✝ + m with | next msb r' => (next msb r', !msb) | x, x_1 => (next a✝¹ a✝ + m, false)) = match m, next a✝¹ a✝ with | next false n', next false m' => match m + next a✝¹ a✝ with | next msb r' => (next msb r', msb) | next true n', next true m' => match m + next a✝¹ a✝ with | next msb r' => (next msb r', !msb) | x, x_1 => (m + next a✝¹ a✝, false)
case next.next sz : ℕ a✝³ : Bool a✝² : FinInt sz a✝¹ : Bool a✝ : FinInt sz ⊢ (match next a✝³ a✝², next a✝¹ a✝ with | next false n', next false m' => match next a✝³ a✝² + next a✝¹ a✝ with | next msb r' => (next msb r', msb) | next true n', next true m' => match next a✝³ a✝² + next a✝¹ a✝ with | next msb r' => (next msb r', !msb) | x, x_1 => (next a✝³ a✝² + next a✝¹ a✝, false)) = match next a✝¹ a✝, next a✝³ a✝² with | next false n', next false m' => match next a✝¹ a✝ + next a✝³ a✝² with | next msb r' => (next msb r', msb) | next true n', next true m' => match next a✝¹ a✝ + next a✝³ a✝² with | next msb r' => (next msb r', !msb) | x, x_1 => (next a✝¹ a✝ + next a✝³ a✝², false)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_comm
[716, 1]
[718, 49]
case next.next bn n' bm m' => simp [add_comm]; cases bn <;> cases bm <;> rfl
sz : ℕ bn : Bool n' : FinInt sz bm : Bool m' : FinInt sz ⊢ (match next bn n', next bm m' with | next false n'_1, next false m'_1 => match next bn n' + next bm m' with | next msb r' => (next msb r', msb) | next true n'_1, next true m'_1 => match next bn n' + next bm m' with | next msb r' => (next msb r', !msb) | x, x_1 => (next bn n' + next bm m', false)) = match next bm m', next bn n' with | next false n'_1, next false m'_1 => match next bm m' + next bn n' with | next msb r' => (next msb r', msb) | next true n'_1, next true m'_1 => match next bm m' + next bn n' with | next msb r' => (next msb r', !msb) | x, x_1 => (next bm m' + next bn n', false)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_comm
[716, 1]
[718, 49]
simp [add_comm]
sz : ℕ bn : Bool n' : FinInt sz bm : Bool m' : FinInt sz ⊢ (match next bn n', next bm m' with | next false n'_1, next false m'_1 => match next bn n' + next bm m' with | next msb r' => (next msb r', msb) | next true n'_1, next true m'_1 => match next bn n' + next bm m' with | next msb r' => (next msb r', !msb) | x, x_1 => (next bn n' + next bm m', false)) = match next bm m', next bn n' with | next false n'_1, next false m'_1 => match next bm m' + next bn n' with | next msb r' => (next msb r', msb) | next true n'_1, next true m'_1 => match next bm m' + next bn n' with | next msb r' => (next msb r', !msb) | x, x_1 => (next bm m' + next bn n', false)
sz : ℕ bn : Bool n' : FinInt sz bm : Bool m' : FinInt sz ⊢ (match next bn n', next bm m' with | next false n'_1, next false m'_1 => match next bn n' + next bm m' with | next msb r' => (next msb r', msb) | next true n'_1, next true m'_1 => match next bn n' + next bm m' with | next msb r' => (next msb r', !msb) | x, x_1 => (next bn n' + next bm m', false)) = match next bm m', next bn n' with | next false n'_1, next false m'_1 => match next bn n' + next bm m' with | next msb r' => (next msb r', msb) | next true n'_1, next true m'_1 => match next bn n' + next bm m' with | next msb r' => (next msb r', !msb) | x, x_1 => (next bn n' + next bm m', false)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_comm
[716, 1]
[718, 49]
cases bn <;> cases bm <;> rfl
sz : ℕ bn : Bool n' : FinInt sz bm : Bool m' : FinInt sz ⊢ (match next bn n', next bm m' with | next false n'_1, next false m'_1 => match next bn n' + next bm m' with | next msb r' => (next msb r', msb) | next true n'_1, next true m'_1 => match next bn n' + next bm m' with | next msb r' => (next msb r', !msb) | x, x_1 => (next bn n' + next bm m', false)) = match next bm m', next bn n' with | next false n'_1, next false m'_1 => match next bn n' + next bm m' with | next msb r' => (next msb r', msb) | next true n'_1, next true m'_1 => match next bn n' + next bm m' with | next msb r' => (next msb r', !msb) | x, x_1 => (next bn n' + next bm m', false)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
intros h_nov
sz : ℕ n m : FinInt (sz + 1) ⊢ (addv n m).snd = false → toSint (addv n m).fst = toSint n + toSint m
sz : ℕ n m : FinInt (sz + 1) h_nov : (addv n m).snd = false ⊢ toSint (addv n m).fst = toSint n + toSint m
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
simp [addv] at *
sz : ℕ n m : FinInt (sz + 1) h_nov : (addv n m).snd = false ⊢ toSint (addv n m).fst = toSint n + toSint m
sz : ℕ n m : FinInt (sz + 1) h_nov : (match n, m with | next false n', next false m' => match n + m with | next msb r' => (next msb r', msb) | next true n', next true m' => match n + m with | next msb r' => (next msb r', !msb) | x, x_1 => (n + m, false)).snd = false ⊢ toSint (match n, m with | next false n', next false m' => match n + m with | next msb r' => (next msb r', msb) | next true n', next true m' => match n + m with | next msb r' => (next msb r', !msb) | x, x_1 => (n + m, false)).fst = toSint n + toSint m
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
have h := add_toSint_msb n m
sz : ℕ n m : FinInt (sz + 1) h_nov : (match n, m with | next false n', next false m' => match n + m with | next msb r' => (next msb r', msb) | next true n', next true m' => match n + m with | next msb r' => (next msb r', !msb) | x, x_1 => (n + m, false)).snd = false ⊢ toSint (match n, m with | next false n', next false m' => match n + m with | next msb r' => (next msb r', msb) | next true n', next true m' => match n + m with | next msb r' => (next msb r', !msb) | x, x_1 => (n + m, false)).fst = toSint n + toSint m
sz : ℕ n m : FinInt (sz + 1) h_nov : (match n, m with | next false n', next false m' => match n + m with | next msb r' => (next msb r', msb) | next true n', next true m' => match n + m with | next msb r' => (next msb r', !msb) | x, x_1 => (n + m, false)).snd = false h : toSint (n + m) = match n, m with | next false n', next false m' => match n + m with | next false a => toSint n + toSint m | next true a => toSint n + toSint m - 2 ^ (sz + 1) | next false n', next true m' => toSint n + toSint m | next true n', next false m' => toSint n + toSint m | next true n', next true m' => match n + m with | next false a => toSint n + toSint m + 2 ^ (sz + 1) | next true a => toSint n + toSint m ⊢ toSint (match n, m with | next false n', next false m' => match n + m with | next msb r' => (next msb r', msb) | next true n', next true m' => match n + m with | next msb r' => (next msb r', !msb) | x, x_1 => (n + m, false)).fst = toSint n + toSint m
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
cases n
sz : ℕ n m : FinInt (sz + 1) h_nov : (match n, m with | next false n', next false m' => match n + m with | next msb r' => (next msb r', msb) | next true n', next true m' => match n + m with | next msb r' => (next msb r', !msb) | x, x_1 => (n + m, false)).snd = false h : toSint (n + m) = match n, m with | next false n', next false m' => match n + m with | next false a => toSint n + toSint m | next true a => toSint n + toSint m - 2 ^ (sz + 1) | next false n', next true m' => toSint n + toSint m | next true n', next false m' => toSint n + toSint m | next true n', next true m' => match n + m with | next false a => toSint n + toSint m + 2 ^ (sz + 1) | next true a => toSint n + toSint m ⊢ toSint (match n, m with | next false n', next false m' => match n + m with | next msb r' => (next msb r', msb) | next true n', next true m' => match n + m with | next msb r' => (next msb r', !msb) | x, x_1 => (n + m, false)).fst = toSint n + toSint m
case next sz : ℕ m : FinInt (sz + 1) a✝¹ : Bool a✝ : FinInt sz h_nov : (match next a✝¹ a✝, m with | next false n', next false m' => match next a✝¹ a✝ + m with | next msb r' => (next msb r', msb) | next true n', next true m' => match next a✝¹ a✝ + m with | next msb r' => (next msb r', !msb) | x, x_1 => (next a✝¹ a✝ + m, false)).snd = false h : toSint (next a✝¹ a✝ + m) = match next a✝¹ a✝, m with | next false n', next false m' => match next a✝¹ a✝ + m with | next false a => toSint (next a✝¹ a✝) + toSint m | next true a => toSint (next a✝¹ a✝) + toSint m - 2 ^ (sz + 1) | next false n', next true m' => toSint (next a✝¹ a✝) + toSint m | next true n', next false m' => toSint (next a✝¹ a✝) + toSint m | next true n', next true m' => match next a✝¹ a✝ + m with | next false a => toSint (next a✝¹ a✝) + toSint m + 2 ^ (sz + 1) | next true a => toSint (next a✝¹ a✝) + toSint m ⊢ toSint (match next a✝¹ a✝, m with | next false n', next false m' => match next a✝¹ a✝ + m with | next msb r' => (next msb r', msb) | next true n', next true m' => match next a✝¹ a✝ + m with | next msb r' => (next msb r', !msb) | x, x_1 => (next a✝¹ a✝ + m, false)).fst = toSint (next a✝¹ a✝) + toSint m
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
case next dn n' => cases m; case next dm m' => cases dn <;> cases dm <;> simp [h] at * case false.false => match h: next false n' + next false m' with | .next br r => rw [h] at h_nov cases br <;> simp at * rw [←h]; simp [add_toSint_msb]; simp [h] case true.true => match h: next true n' + next true m' with | .next br r => rw [h] at h_nov cases br <;> simp at * rw [←h]; simp [add_toSint_msb]; simp [h]
sz : ℕ m : FinInt (sz + 1) dn : Bool n' : FinInt sz h_nov : (match next dn n', m with | next false n'_1, next false m' => match next dn n' + m with | next msb r' => (next msb r', msb) | next true n'_1, next true m' => match next dn n' + m with | next msb r' => (next msb r', !msb) | x, x_1 => (next dn n' + m, false)).snd = false h : toSint (next dn n' + m) = match next dn n', m with | next false n'_1, next false m' => match next dn n' + m with | next false a => toSint (next dn n') + toSint m | next true a => toSint (next dn n') + toSint m - 2 ^ (sz + 1) | next false n'_1, next true m' => toSint (next dn n') + toSint m | next true n'_1, next false m' => toSint (next dn n') + toSint m | next true n'_1, next true m' => match next dn n' + m with | next false a => toSint (next dn n') + toSint m + 2 ^ (sz + 1) | next true a => toSint (next dn n') + toSint m ⊢ toSint (match next dn n', m with | next false n'_1, next false m' => match next dn n' + m with | next msb r' => (next msb r', msb) | next true n'_1, next true m' => match next dn n' + m with | next msb r' => (next msb r', !msb) | x, x_1 => (next dn n' + m, false)).fst = toSint (next dn n') + toSint m
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
cases m
sz : ℕ m : FinInt (sz + 1) dn : Bool n' : FinInt sz h_nov : (match next dn n', m with | next false n'_1, next false m' => match next dn n' + m with | next msb r' => (next msb r', msb) | next true n'_1, next true m' => match next dn n' + m with | next msb r' => (next msb r', !msb) | x, x_1 => (next dn n' + m, false)).snd = false h : toSint (next dn n' + m) = match next dn n', m with | next false n'_1, next false m' => match next dn n' + m with | next false a => toSint (next dn n') + toSint m | next true a => toSint (next dn n') + toSint m - 2 ^ (sz + 1) | next false n'_1, next true m' => toSint (next dn n') + toSint m | next true n'_1, next false m' => toSint (next dn n') + toSint m | next true n'_1, next true m' => match next dn n' + m with | next false a => toSint (next dn n') + toSint m + 2 ^ (sz + 1) | next true a => toSint (next dn n') + toSint m ⊢ toSint (match next dn n', m with | next false n'_1, next false m' => match next dn n' + m with | next msb r' => (next msb r', msb) | next true n'_1, next true m' => match next dn n' + m with | next msb r' => (next msb r', !msb) | x, x_1 => (next dn n' + m, false)).fst = toSint (next dn n') + toSint m
case next sz : ℕ dn : Bool n' : FinInt sz a✝¹ : Bool a✝ : FinInt sz h_nov : (match next dn n', next a✝¹ a✝ with | next false n'_1, next false m' => match next dn n' + next a✝¹ a✝ with | next msb r' => (next msb r', msb) | next true n'_1, next true m' => match next dn n' + next a✝¹ a✝ with | next msb r' => (next msb r', !msb) | x, x_1 => (next dn n' + next a✝¹ a✝, false)).snd = false h : toSint (next dn n' + next a✝¹ a✝) = match next dn n', next a✝¹ a✝ with | next false n'_1, next false m' => match next dn n' + next a✝¹ a✝ with | next false a => toSint (next dn n') + toSint (next a✝¹ a✝) | next true a => toSint (next dn n') + toSint (next a✝¹ a✝) - 2 ^ (sz + 1) | next false n'_1, next true m' => toSint (next dn n') + toSint (next a✝¹ a✝) | next true n'_1, next false m' => toSint (next dn n') + toSint (next a✝¹ a✝) | next true n'_1, next true m' => match next dn n' + next a✝¹ a✝ with | next false a => toSint (next dn n') + toSint (next a✝¹ a✝) + 2 ^ (sz + 1) | next true a => toSint (next dn n') + toSint (next a✝¹ a✝) ⊢ toSint (match next dn n', next a✝¹ a✝ with | next false n'_1, next false m' => match next dn n' + next a✝¹ a✝ with | next msb r' => (next msb r', msb) | next true n'_1, next true m' => match next dn n' + next a✝¹ a✝ with | next msb r' => (next msb r', !msb) | x, x_1 => (next dn n' + next a✝¹ a✝, false)).fst = toSint (next dn n') + toSint (next a✝¹ a✝)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
case next dm m' => cases dn <;> cases dm <;> simp [h] at * case false.false => match h: next false n' + next false m' with | .next br r => rw [h] at h_nov cases br <;> simp at * rw [←h]; simp [add_toSint_msb]; simp [h] case true.true => match h: next true n' + next true m' with | .next br r => rw [h] at h_nov cases br <;> simp at * rw [←h]; simp [add_toSint_msb]; simp [h]
sz : ℕ dn : Bool n' : FinInt sz dm : Bool m' : FinInt sz h_nov : (match next dn n', next dm m' with | next false n'_1, next false m'_1 => match next dn n' + next dm m' with | next msb r' => (next msb r', msb) | next true n'_1, next true m'_1 => match next dn n' + next dm m' with | next msb r' => (next msb r', !msb) | x, x_1 => (next dn n' + next dm m', false)).snd = false h : toSint (next dn n' + next dm m') = match next dn n', next dm m' with | next false n'_1, next false m'_1 => match next dn n' + next dm m' with | next false a => toSint (next dn n') + toSint (next dm m') | next true a => toSint (next dn n') + toSint (next dm m') - 2 ^ (sz + 1) | next false n'_1, next true m'_1 => toSint (next dn n') + toSint (next dm m') | next true n'_1, next false m'_1 => toSint (next dn n') + toSint (next dm m') | next true n'_1, next true m'_1 => match next dn n' + next dm m' with | next false a => toSint (next dn n') + toSint (next dm m') + 2 ^ (sz + 1) | next true a => toSint (next dn n') + toSint (next dm m') ⊢ toSint (match next dn n', next dm m' with | next false n'_1, next false m'_1 => match next dn n' + next dm m' with | next msb r' => (next msb r', msb) | next true n'_1, next true m'_1 => match next dn n' + next dm m' with | next msb r' => (next msb r', !msb) | x, x_1 => (next dn n' + next dm m', false)).fst = toSint (next dn n') + toSint (next dm m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
cases dn <;> cases dm <;> simp [h] at *
sz : ℕ dn : Bool n' : FinInt sz dm : Bool m' : FinInt sz h_nov : (match next dn n', next dm m' with | next false n'_1, next false m'_1 => match next dn n' + next dm m' with | next msb r' => (next msb r', msb) | next true n'_1, next true m'_1 => match next dn n' + next dm m' with | next msb r' => (next msb r', !msb) | x, x_1 => (next dn n' + next dm m', false)).snd = false h : toSint (next dn n' + next dm m') = match next dn n', next dm m' with | next false n'_1, next false m'_1 => match next dn n' + next dm m' with | next false a => toSint (next dn n') + toSint (next dm m') | next true a => toSint (next dn n') + toSint (next dm m') - 2 ^ (sz + 1) | next false n'_1, next true m'_1 => toSint (next dn n') + toSint (next dm m') | next true n'_1, next false m'_1 => toSint (next dn n') + toSint (next dm m') | next true n'_1, next true m'_1 => match next dn n' + next dm m' with | next false a => toSint (next dn n') + toSint (next dm m') + 2 ^ (sz + 1) | next true a => toSint (next dn n') + toSint (next dm m') ⊢ toSint (match next dn n', next dm m' with | next false n'_1, next false m'_1 => match next dn n' + next dm m' with | next msb r' => (next msb r', msb) | next true n'_1, next true m'_1 => match next dn n' + next dm m' with | next msb r' => (next msb r', !msb) | x, x_1 => (next dn n' + next dm m', false)).fst = toSint (next dn n') + toSint (next dm m')
case false.false sz : ℕ n' m' : FinInt sz h_nov : (match next false n' + next false m' with | next msb r' => (next msb r', msb)).snd = false h : True ⊢ toSint (match next false n' + next false m' with | next msb r' => (next msb r', msb)).fst = toSint (next false n') + toSint (next false m') case true.true sz : ℕ n' m' : FinInt sz h_nov : (match next true n' + next true m' with | next msb r' => (next msb r', !msb)).snd = false h : True ⊢ toSint (match next true n' + next true m' with | next msb r' => (next msb r', !msb)).fst = toSint (next true n') + toSint (next true m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
case false.false => match h: next false n' + next false m' with | .next br r => rw [h] at h_nov cases br <;> simp at * rw [←h]; simp [add_toSint_msb]; simp [h]
sz : ℕ n' m' : FinInt sz h_nov : (match next false n' + next false m' with | next msb r' => (next msb r', msb)).snd = false h : True ⊢ toSint (match next false n' + next false m' with | next msb r' => (next msb r', msb)).fst = toSint (next false n') + toSint (next false m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
case true.true => match h: next true n' + next true m' with | .next br r => rw [h] at h_nov cases br <;> simp at * rw [←h]; simp [add_toSint_msb]; simp [h]
sz : ℕ n' m' : FinInt sz h_nov : (match next true n' + next true m' with | next msb r' => (next msb r', !msb)).snd = false h : True ⊢ toSint (match next true n' + next true m' with | next msb r' => (next msb r', !msb)).fst = toSint (next true n') + toSint (next true m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
match h: next false n' + next false m' with | .next br r => rw [h] at h_nov cases br <;> simp at * rw [←h]; simp [add_toSint_msb]; simp [h]
sz : ℕ n' m' : FinInt sz h_nov : (match next false n' + next false m' with | next msb r' => (next msb r', msb)).snd = false h : True ⊢ toSint (match next false n' + next false m' with | next msb r' => (next msb r', msb)).fst = toSint (next false n') + toSint (next false m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
rw [h] at h_nov
sz : ℕ n' m' : FinInt sz h_nov : (match next false n' + next false m' with | next msb r' => (next msb r', msb)).snd = false h✝ : True br : Bool r : FinInt sz h : next false n' + next false m' = next br r ⊢ toSint (match next br r with | next msb r' => (next msb r', msb)).fst = toSint (next false n') + toSint (next false m')
sz : ℕ n' m' : FinInt sz h✝ : True br : Bool r : FinInt sz h_nov : (match next br r with | next msb r' => (next msb r', msb)).snd = false h : next false n' + next false m' = next br r ⊢ toSint (match next br r with | next msb r' => (next msb r', msb)).fst = toSint (next false n') + toSint (next false m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
cases br <;> simp at *
sz : ℕ n' m' : FinInt sz h✝ : True br : Bool r : FinInt sz h_nov : (match next br r with | next msb r' => (next msb r', msb)).snd = false h : next false n' + next false m' = next br r ⊢ toSint (match next br r with | next msb r' => (next msb r', msb)).fst = toSint (next false n') + toSint (next false m')
case false sz : ℕ n' m' : FinInt sz h✝ : True r : FinInt sz h : next false n' + next false m' = next false r h_nov : True ⊢ toSint (next false r) = toSint (next false n') + toSint (next false m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
rw [←h]
case false sz : ℕ n' m' : FinInt sz h✝ : True r : FinInt sz h : next false n' + next false m' = next false r h_nov : True ⊢ toSint (next false r) = toSint (next false n') + toSint (next false m')
case false sz : ℕ n' m' : FinInt sz h✝ : True r : FinInt sz h : next false n' + next false m' = next false r h_nov : True ⊢ toSint (next false n' + next false m') = toSint (next false n') + toSint (next false m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
simp [add_toSint_msb]
case false sz : ℕ n' m' : FinInt sz h✝ : True r : FinInt sz h : next false n' + next false m' = next false r h_nov : True ⊢ toSint (next false n' + next false m') = toSint (next false n') + toSint (next false m')
case false sz : ℕ n' m' : FinInt sz h✝ : True r : FinInt sz h : next false n' + next false m' = next false r h_nov : True ⊢ (match next false n' + next false m' with | next false a => toSint (next false n') + toSint (next false m') | next true a => toSint (next false n') + toSint (next false m') - 2 ^ (sz + 1)) = toSint (next false n') + toSint (next false m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
simp [h]
case false sz : ℕ n' m' : FinInt sz h✝ : True r : FinInt sz h : next false n' + next false m' = next false r h_nov : True ⊢ (match next false n' + next false m' with | next false a => toSint (next false n') + toSint (next false m') | next true a => toSint (next false n') + toSint (next false m') - 2 ^ (sz + 1)) = toSint (next false n') + toSint (next false m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
match h: next true n' + next true m' with | .next br r => rw [h] at h_nov cases br <;> simp at * rw [←h]; simp [add_toSint_msb]; simp [h]
sz : ℕ n' m' : FinInt sz h_nov : (match next true n' + next true m' with | next msb r' => (next msb r', !msb)).snd = false h : True ⊢ toSint (match next true n' + next true m' with | next msb r' => (next msb r', !msb)).fst = toSint (next true n') + toSint (next true m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
rw [h] at h_nov
sz : ℕ n' m' : FinInt sz h_nov : (match next true n' + next true m' with | next msb r' => (next msb r', !msb)).snd = false h✝ : True br : Bool r : FinInt sz h : next true n' + next true m' = next br r ⊢ toSint (match next br r with | next msb r' => (next msb r', !msb)).fst = toSint (next true n') + toSint (next true m')
sz : ℕ n' m' : FinInt sz h✝ : True br : Bool r : FinInt sz h_nov : (match next br r with | next msb r' => (next msb r', !msb)).snd = false h : next true n' + next true m' = next br r ⊢ toSint (match next br r with | next msb r' => (next msb r', !msb)).fst = toSint (next true n') + toSint (next true m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
cases br <;> simp at *
sz : ℕ n' m' : FinInt sz h✝ : True br : Bool r : FinInt sz h_nov : (match next br r with | next msb r' => (next msb r', !msb)).snd = false h : next true n' + next true m' = next br r ⊢ toSint (match next br r with | next msb r' => (next msb r', !msb)).fst = toSint (next true n') + toSint (next true m')
case true sz : ℕ n' m' : FinInt sz h✝ : True r : FinInt sz h : next true n' + next true m' = next true r h_nov : True ⊢ toSint (next true r) = toSint (next true n') + toSint (next true m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
rw [←h]
case true sz : ℕ n' m' : FinInt sz h✝ : True r : FinInt sz h : next true n' + next true m' = next true r h_nov : True ⊢ toSint (next true r) = toSint (next true n') + toSint (next true m')
case true sz : ℕ n' m' : FinInt sz h✝ : True r : FinInt sz h : next true n' + next true m' = next true r h_nov : True ⊢ toSint (next true n' + next true m') = toSint (next true n') + toSint (next true m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
simp [add_toSint_msb]
case true sz : ℕ n' m' : FinInt sz h✝ : True r : FinInt sz h : next true n' + next true m' = next true r h_nov : True ⊢ toSint (next true n' + next true m') = toSint (next true n') + toSint (next true m')
case true sz : ℕ n' m' : FinInt sz h✝ : True r : FinInt sz h : next true n' + next true m' = next true r h_nov : True ⊢ (match next true n' + next true m' with | next false a => toSint (next true n') + toSint (next true m') + 2 ^ (sz + 1) | next true a => toSint (next true n') + toSint (next true m')) = toSint (next true n') + toSint (next true m')
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.addv_toSint
[720, 1]
[740, 47]
simp [h]
case true sz : ℕ n' m' : FinInt sz h✝ : True r : FinInt sz h : next true n' + next true m' = next true r h_nov : True ⊢ (match next true n' + next true m' with | next false a => toSint (next true n') + toSint (next true m') + 2 ^ (sz + 1) | next true a => toSint (next true n') + toSint (next true m')) = toSint (next true n') + toSint (next true m')
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.neg_toUint
[752, 1]
[754, 8]
sorry
sz : ℕ n : FinInt sz ⊢ toUint (-n) = mod2 (-toUint n) sz
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.neg_toUint_cong2
[756, 1]
[758, 46]
simp [cong2, toUint_mod2]
sz : ℕ n : FinInt sz ⊢ toUint (-n) ≡ -toUint n [2^sz]
sz : ℕ n : FinInt sz ⊢ toUint (-n) = mod2 (-toUint n) sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.neg_toUint_cong2
[756, 1]
[758, 46]
apply neg_toUint
sz : ℕ n : FinInt sz ⊢ toUint (-n) = mod2 (-toUint n) sz
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.neg_minusOne
[760, 1]
[771, 18]
match H: sz with | 0 => decide | sz'+1 => have h: sz' + 1 > 0 := by sorry_arith apply eq_of_toUint_cong2 simp [toUint_minusOne] simp [neg_toUint] apply cong2_mod2_left simp [ofInt_1, toUint_one h] sorry_arith
sz : ℕ ⊢ -1 = minusOne
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.neg_minusOne
[760, 1]
[771, 18]
decide
sz : ℕ H : sz = 0 ⊢ -1 = minusOne
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.neg_minusOne
[760, 1]
[771, 18]
have h: sz' + 1 > 0 := by sorry_arith
sz sz' : ℕ H : sz = Nat.succ sz' ⊢ -1 = minusOne
sz sz' : ℕ H : sz = Nat.succ sz' h : sz' + 1 > 0 ⊢ -1 = minusOne
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.neg_minusOne
[760, 1]
[771, 18]
apply eq_of_toUint_cong2
sz sz' : ℕ H : sz = Nat.succ sz' h : sz' + 1 > 0 ⊢ -1 = minusOne
case a sz sz' : ℕ H : sz = Nat.succ sz' h : sz' + 1 > 0 ⊢ toUint (-1) ≡ toUint minusOne [2^sz' + 1]
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.neg_minusOne
[760, 1]
[771, 18]
simp [toUint_minusOne]
case a sz sz' : ℕ H : sz = Nat.succ sz' h : sz' + 1 > 0 ⊢ toUint (-1) ≡ toUint minusOne [2^sz' + 1]
case a sz sz' : ℕ H : sz = Nat.succ sz' h : sz' + 1 > 0 ⊢ toUint (-1) ≡ 2 ^ sz' + (2 ^ sz' - 1) [2^sz' + 1]
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.neg_minusOne
[760, 1]
[771, 18]
simp [neg_toUint]
case a sz sz' : ℕ H : sz = Nat.succ sz' h : sz' + 1 > 0 ⊢ toUint (-1) ≡ 2 ^ sz' + (2 ^ sz' - 1) [2^sz' + 1]
case a sz sz' : ℕ H : sz = Nat.succ sz' h : sz' + 1 > 0 ⊢ mod2 (-toUint 1) (sz' + 1) ≡ 2 ^ sz' + (2 ^ sz' - 1) [2^sz' + 1]
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.neg_minusOne
[760, 1]
[771, 18]
apply cong2_mod2_left
case a sz sz' : ℕ H : sz = Nat.succ sz' h : sz' + 1 > 0 ⊢ mod2 (-toUint 1) (sz' + 1) ≡ 2 ^ sz' + (2 ^ sz' - 1) [2^sz' + 1]
case a.a sz sz' : ℕ H : sz = Nat.succ sz' h : sz' + 1 > 0 ⊢ (-toUint 1) ≡ 2 ^ sz' + (2 ^ sz' - 1) [2^sz' + 1]
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.neg_minusOne
[760, 1]
[771, 18]
sorry_arith
case a.a sz sz' : ℕ H : sz = Nat.succ sz' h : sz' + 1 > 0 ⊢ (-toUint 1) ≡ 2 ^ sz' + (2 ^ sz' - 1) [2^sz' + 1]
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.neg_minusOne
[760, 1]
[771, 18]
sorry_arith
sz sz' : ℕ H : sz = Nat.succ sz' ⊢ sz' + 1 > 0
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_eq_xor_minusOne
[773, 1]
[782, 40]
simp [neg_minusOne, HXor.hXor]
sz : ℕ n : FinInt sz ⊢ comp n = n ^^^ -1
sz : ℕ n : FinInt sz ⊢ comp n = xor n minusOne
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_eq_xor_minusOne
[773, 1]
[782, 40]
induction sz <;> simp [comp, xor, logic1, logic2, minusOne] at *
sz : ℕ n : FinInt sz ⊢ comp n = xor n minusOne
case zero n : FinInt Nat.zero ⊢ logic1 (fun x => !x) n = logic2 (fun x x_1 => x != x_1) n nil case succ n✝ : ℕ n_ih✝ : ∀ (n : FinInt n✝), logic1 (fun x => !x) n = logic2 (fun x x_1 => x != x_1) n minusOne n : FinInt (Nat.succ n✝) ⊢ logic1 (fun x => !x) n = logic2 (fun x x_1 => x != x_1) n (I minusOne)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_eq_xor_minusOne
[773, 1]
[782, 40]
case zero => cases n; simp
n : FinInt Nat.zero ⊢ logic1 (fun x => !x) n = logic2 (fun x x_1 => x != x_1) n nil
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_eq_xor_minusOne
[773, 1]
[782, 40]
case succ sz ih => match n with | .I m => simp [logic1, logic2, ih] | .O m => simp [logic1, logic2, ih]
sz : ℕ ih : ∀ (n : FinInt sz), logic1 (fun x => !x) n = logic2 (fun x x_1 => x != x_1) n minusOne n : FinInt (Nat.succ sz) ⊢ logic1 (fun x => !x) n = logic2 (fun x x_1 => x != x_1) n (I minusOne)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_eq_xor_minusOne
[773, 1]
[782, 40]
cases n
n : FinInt Nat.zero ⊢ logic1 (fun x => !x) n = logic2 (fun x x_1 => x != x_1) n nil
case nil ⊢ logic1 (fun x => !x) nil = logic2 (fun x x_1 => x != x_1) nil nil
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_eq_xor_minusOne
[773, 1]
[782, 40]
simp
case nil ⊢ logic1 (fun x => !x) nil = logic2 (fun x x_1 => x != x_1) nil nil
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_eq_xor_minusOne
[773, 1]
[782, 40]
match n with | .I m => simp [logic1, logic2, ih] | .O m => simp [logic1, logic2, ih]
sz : ℕ ih : ∀ (n : FinInt sz), logic1 (fun x => !x) n = logic2 (fun x x_1 => x != x_1) n minusOne n : FinInt (Nat.succ sz) ⊢ logic1 (fun x => !x) n = logic2 (fun x x_1 => x != x_1) n (I minusOne)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_eq_xor_minusOne
[773, 1]
[782, 40]
simp [logic1, logic2, ih]
sz : ℕ ih : ∀ (n : FinInt sz), logic1 (fun x => !x) n = logic2 (fun x x_1 => x != x_1) n minusOne n : FinInt (Nat.succ sz) m : FinInt sz ⊢ logic1 (fun x => !x) (I m) = logic2 (fun x x_1 => x != x_1) (I m) (I minusOne)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.comp_eq_xor_minusOne
[773, 1]
[782, 40]
simp [logic1, logic2, ih]
sz : ℕ ih : ∀ (n : FinInt sz), logic1 (fun x => !x) n = logic2 (fun x x_1 => x != x_1) n minusOne n : FinInt (Nat.succ sz) m : FinInt sz ⊢ logic1 (fun x => !x) (O m) = logic2 (fun x x_1 => x != x_1) (O m) (I minusOne)
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.sub_toUint
[794, 1]
[796, 8]
sorry
sz : ℕ n m : FinInt sz ⊢ toUint (n - m) = mod2 (toUint n - toUint m) sz
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.sub_toUint_cong2
[798, 1]
[800, 46]
simp [cong2, toUint_mod2]
sz : ℕ m n : FinInt sz ⊢ toUint (n - m) ≡ toUint n - toUint m [2^sz]
sz : ℕ m n : FinInt sz ⊢ toUint (n - m) = mod2 (toUint n - toUint m) sz
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.sub_toUint_cong2
[798, 1]
[800, 46]
apply sub_toUint
sz : ℕ m n : FinInt sz ⊢ toUint (n - m) = mod2 (toUint n - toUint m) sz
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.zext_toUint
[811, 1]
[812, 28]
simp [zext, toUint_ofInt]
sz₁ sz₂ : ℕ n : FinInt sz₁ ⊢ toUint (zext sz₂ n) = mod2 (toUint n) sz₂
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Util/FinInt.lean
FinInt.zext_toUint'
[814, 1]
[815, 8]
sorry
sz₁ sz₂ : ℕ n : FinInt sz₁ ⊢ sz₁ < sz₂ → toUint (zext sz₂ n) = toUint n
no goals
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ScfSemantics.lean
SCF.IF.equivalent
[100, 1]
[149, 10]
simp[LHS]
r₁ r₂ : Region scf b : Bool ⊢ run ⟦ LHS r₁ r₂ ⟧ (INPUT b) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
r₁ r₂ : Region scf b : Bool ⊢ run (denoteRegion scf (Region.mk "entry" [] [Op.mk "scf.if" [] [(SSAVal.SSAVal "b", MLIRType.int Signedness.Signless 1)] [r₁, r₂] (AttrDict.mk [])]) []) (INPUT b) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ScfSemantics.lean
SCF.IF.equivalent
[100, 1]
[149, 10]
simp[run_denoteRegion]
r₁ r₂ : Region scf b : Bool ⊢ run (denoteRegion scf (Region.mk "entry" [] [Op.mk "scf.if" [] [(SSAVal.SSAVal "b", MLIRType.int Signedness.Signless 1)] [r₁, r₂] (AttrDict.mk [])]) []) (INPUT b) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
r₁ r₂ : Region scf b : Bool ⊢ run (do denoteTypedArgs [] [] denoteOps scf [Op.mk "scf.if" [] [(SSAVal.SSAVal "b", MLIRType.int Signedness.Signless 1)] [r₁, r₂] (AttrDict.mk [])]) (INPUT b) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ScfSemantics.lean
SCF.IF.equivalent
[100, 1]
[149, 10]
rw[run_seq]
r₁ r₂ : Region scf b : Bool ⊢ run (do denoteTypedArgs [] [] denoteOps scf [Op.mk "scf.if" [] [(SSAVal.SSAVal "b", MLIRType.int Signedness.Signless 1)] [r₁, r₂] (AttrDict.mk [])]) (INPUT b) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
r₁ r₂ : Region scf b : Bool ⊢ (match run (denoteTypedArgs [] []) (INPUT b) with | Except.ok (PUnit.unit, env') => run (denoteOps scf [Op.mk "scf.if" [] [(SSAVal.SSAVal "b", MLIRType.int Signedness.Signless 1)] [r₁, r₂] (AttrDict.mk [])]) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ScfSemantics.lean
SCF.IF.equivalent
[100, 1]
[149, 10]
simp[run_denoteTypedArgs_nil]
r₁ r₂ : Region scf b : Bool ⊢ (match run (denoteTypedArgs [] []) (INPUT b) with | Except.ok (PUnit.unit, env') => run (denoteOps scf [Op.mk "scf.if" [] [(SSAVal.SSAVal "b", MLIRType.int Signedness.Signless 1)] [r₁, r₂] (AttrDict.mk [])]) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
r₁ r₂ : Region scf b : Bool ⊢ run (denoteOps scf [Op.mk "scf.if" [] [(SSAVal.SSAVal "b", MLIRType.int Signedness.Signless 1)] [r₁, r₂] (AttrDict.mk [])]) (INPUT b) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ScfSemantics.lean
SCF.IF.equivalent
[100, 1]
[149, 10]
simp [run_denoteOps_singleton]
r₁ r₂ : Region scf b : Bool ⊢ run (denoteOps scf [Op.mk "scf.if" [] [(SSAVal.SSAVal "b", MLIRType.int Signedness.Signless 1)] [r₁, r₂] (AttrDict.mk [])]) (INPUT b) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
r₁ r₂ : Region scf b : Bool ⊢ run (denoteOp scf (Op.mk "scf.if" [] [(SSAVal.SSAVal "b", MLIRType.int Signedness.Signless 1)] [r₁, r₂] (AttrDict.mk []))) (INPUT b) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ScfSemantics.lean
SCF.IF.equivalent
[100, 1]
[149, 10]
simp[run_denoteOp]
r₁ r₂ : Region scf b : Bool ⊢ run (denoteOp scf (Op.mk "scf.if" [] [(SSAVal.SSAVal "b", MLIRType.int Signedness.Signless 1)] [r₁, r₂] (AttrDict.mk []))) (INPUT b) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
r₁ r₂ : Region scf b : Bool ⊢ run (do let args ← denoteOpArgs scf [(SSAVal.SSAVal "b", MLIRType.int Signedness.Signless 1)] OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] args (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) (INPUT b) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ScfSemantics.lean
SCF.IF.equivalent
[100, 1]
[149, 10]
simp[run_bind]
r₁ r₂ : Region scf b : Bool ⊢ run (do let args ← denoteOpArgs scf [(SSAVal.SSAVal "b", MLIRType.int Signedness.Signless 1)] OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] args (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) (INPUT b) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
r₁ r₂ : Region scf b : Bool ⊢ (match run (denoteOpArgs scf [(SSAVal.SSAVal "b", MLIRType.int Signedness.Signless 1)]) (INPUT b) with | Except.ok (a, env') => run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] a (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ScfSemantics.lean
SCF.IF.equivalent
[100, 1]
[149, 10]
simp[run_denoteOpArgs_cons_]
r₁ r₂ : Region scf b : Bool ⊢ (match run (denoteOpArgs scf [(SSAVal.SSAVal "b", MLIRType.int Signedness.Signless 1)]) (INPUT b) with | Except.ok (a, env') => run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] a (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
r₁ r₂ : Region scf b : Bool ⊢ (match run (do let x ← TopM.get (MLIRType.int Signedness.Signless 1) (SSAVal.SSAVal "b") let xs ← denoteOpArgs scf [] pure ({ fst := MLIRType.int Signedness.Signless 1, snd := x } :: xs)) (INPUT b) with | Except.ok (a, env') => run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] a (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ScfSemantics.lean
SCF.IF.equivalent
[100, 1]
[149, 10]
simp[run_bind]
r₁ r₂ : Region scf b : Bool ⊢ (match run (do let x ← TopM.get (MLIRType.int Signedness.Signless 1) (SSAVal.SSAVal "b") let xs ← denoteOpArgs scf [] pure ({ fst := MLIRType.int Signedness.Signless 1, snd := x } :: xs)) (INPUT b) with | Except.ok (a, env') => run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] a (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
r₁ r₂ : Region scf b : Bool ⊢ (match match run (TopM.get (MLIRType.int Signedness.Signless 1) (SSAVal.SSAVal "b")) (INPUT b) with | Except.ok (a, env') => match run (denoteOpArgs scf []) env' with | Except.ok (a_1, env') => run (pure ({ fst := MLIRType.int Signedness.Signless 1, snd := a } :: a_1)) env' | Except.error e => Except.error e | Except.error e => Except.error e with | Except.ok (a, env') => run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] a (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ScfSemantics.lean
SCF.IF.equivalent
[100, 1]
[149, 10]
simp[INPUT]
r₁ r₂ : Region scf b : Bool ⊢ (match match run (TopM.get (MLIRType.int Signedness.Signless 1) (SSAVal.SSAVal "b")) (INPUT b) with | Except.ok (a, env') => match run (denoteOpArgs scf []) env' with | Except.ok (a_1, env') => run (pure ({ fst := MLIRType.int Signedness.Signless 1, snd := a } :: a_1)) env' | Except.error e => Except.error e | Except.error e => Except.error e with | Except.ok (a, env') => run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] a (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (INPUT b)
r₁ r₂ : Region scf b : Bool ⊢ (match match run (TopM.get (MLIRType.int Signedness.Signless 1) (SSAVal.SSAVal "b")) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty) with | Except.ok (a, env') => match run (denoteOpArgs scf []) env' with | Except.ok (a_1, env') => run (pure ({ fst := MLIRType.int Signedness.Signless 1, snd := a } :: a_1)) env' | Except.error e => Except.error e | Except.error e => Except.error e with | Except.ok (a, env') => run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] a (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ScfSemantics.lean
SCF.IF.equivalent
[100, 1]
[149, 10]
rw[run_TopM_get_]
r₁ r₂ : Region scf b : Bool ⊢ (match match run (TopM.get (MLIRType.int Signedness.Signless 1) (SSAVal.SSAVal "b")) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty) with | Except.ok (a, env') => match run (denoteOpArgs scf []) env' with | Except.ok (a_1, env') => run (pure ({ fst := MLIRType.int Signedness.Signless 1, snd := a } :: a_1)) env' | Except.error e => Except.error e | Except.error e => Except.error e with | Except.ok (a, env') => run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] a (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty)
r₁ r₂ : Region scf b : Bool ⊢ (match match Except.ok (match SSAEnv.get (SSAVal.SSAVal "b") (MLIRType.int Signedness.Signless 1) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty) with | some v => v | none => default, SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty) with | Except.ok (a, env') => match run (denoteOpArgs scf []) env' with | Except.ok (a_1, env') => run (pure ({ fst := MLIRType.int Signedness.Signless 1, snd := a } :: a_1)) env' | Except.error e => Except.error e | Except.error e => Except.error e with | Except.ok (a, env') => run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] a (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ScfSemantics.lean
SCF.IF.equivalent
[100, 1]
[149, 10]
simp[SSAEnv.get_set_eq]
r₁ r₂ : Region scf b : Bool ⊢ (match match Except.ok (match SSAEnv.get (SSAVal.SSAVal "b") (MLIRType.int Signedness.Signless 1) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty) with | some v => v | none => default, SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty) with | Except.ok (a, env') => match run (denoteOpArgs scf []) env' with | Except.ok (a_1, env') => run (pure ({ fst := MLIRType.int Signedness.Signless 1, snd := a } :: a_1)) env' | Except.error e => Except.error e | Except.error e => Except.error e with | Except.ok (a, env') => run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] a (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty)
r₁ r₂ : Region scf b : Bool ⊢ (match match run (denoteOpArgs scf []) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty) with | Except.ok (a, env') => run (pure ({ fst := MLIRType.int Signedness.Signless 1, snd := if b = true then 1 else 0 } :: a)) env' | Except.error e => Except.error e with | Except.ok (a, env') => run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] a (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ScfSemantics.lean
SCF.IF.equivalent
[100, 1]
[149, 10]
simp[run_denoteOpArgs_nil]
r₁ r₂ : Region scf b : Bool ⊢ (match match run (denoteOpArgs scf []) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty) with | Except.ok (a, env') => run (pure ({ fst := MLIRType.int Signedness.Signless 1, snd := if b = true then 1 else 0 } :: a)) env' | Except.error e => Except.error e with | Except.ok (a, env') => run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] a (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty)
r₁ r₂ : Region scf b : Bool ⊢ (match run (pure [{ fst := MLIRType.int Signedness.Signless 1, snd := if b = true then 1 else 0 }]) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty) with | Except.ok (a, env') => run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] a (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty)
https://github.com/opencompl/lean-mlir.git
e43d21592801e5e40477b14b7a554e356060c40c
MLIR/Dialects/ScfSemantics.lean
SCF.IF.equivalent
[100, 1]
[149, 10]
simp[run_pure]
r₁ r₂ : Region scf b : Bool ⊢ (match run (pure [{ fst := MLIRType.int Signedness.Signless 1, snd := if b = true then 1 else 0 }]) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty) with | Except.ok (a, env') => run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] a (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) env' | Except.error e => Except.error e) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty)
r₁ r₂ : Region scf b : Bool ⊢ run (OpM.toTopM (TopM.mapDenoteRegion scf [r₁, r₂]) (Semantics.semantics_op (IOp.mk "scf.if" [] [{ fst := MLIRType.int Signedness.Signless 1, snd := if b = true then 1 else 0 }] (OpM.denoteRegions [r₁, r₂] 0) (AttrDict.mk [])))) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty) = run (TopM.scoped (denoteRegion scf (if b = true then r₁ else r₂) [])) (SSAEnv.set (SSAVal.SSAVal "b") MLIRType.i1 (if b = true then 1 else 0) SSAEnv.empty)