fix(tests/lean/map): make sure the unit test produce the same result in different platforms
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
e2add5c9f2
commit
87f9c9b27e
2 changed files with 28 additions and 29 deletions
|
@ -10,14 +10,13 @@ add_rewrite map_cons map_nil
|
|||
|
||||
(*
|
||||
local m = simplifier_monitor(function(s, e)
|
||||
print("Visit, depth: " .. s:depth() .. ", " .. tostring(e))
|
||||
print("Visit, depth: " .. s:depth())
|
||||
end,
|
||||
function(s, e, new_e, pr)
|
||||
print("Step: " .. tostring(e) .. " ===> " .. tostring(new_e))
|
||||
print("Step: " .. s:depth())
|
||||
end,
|
||||
function(s, e, new_e, ceq, ceq_id)
|
||||
print("Rewrite using: " .. tostring(ceq_id))
|
||||
print(" " .. tostring(e) .. " ===> " .. tostring(new_e))
|
||||
end
|
||||
)
|
||||
set_simplifier_monitor(m)
|
||||
|
|
|
@ -7,32 +7,32 @@
|
|||
Assumed: map
|
||||
Assumed: map_cons
|
||||
Assumed: map_nil
|
||||
Visit, depth: 1, map (λ x : ℕ, x + 1) (cons 1 (cons 2 nil)) = cons 2 (cons 3 nil)
|
||||
Visit, depth: 2, @eq
|
||||
Step: @eq ===> @eq
|
||||
Visit, depth: 2, map (λ x : ℕ, x + 1) (cons 1 (cons 2 nil))
|
||||
Visit, depth: 3, @map
|
||||
Step: @map ===> @map
|
||||
Visit, depth: 3, λ x : ℕ, x + 1
|
||||
Visit, depth: 4, 3::1 + 1
|
||||
Visit, depth: 5, Nat::add
|
||||
Visit, depth: 5, 3::1
|
||||
Step: 3::1 ===> 3::1
|
||||
Visit, depth: 5, 1
|
||||
Step: 3::1 + 1 ===> 3::1 + 1
|
||||
Step: λ x : ℕ, x + 1 ===> λ x : ℕ, x + 1
|
||||
Visit, depth: 3, cons 1 (cons 2 nil)
|
||||
Visit, depth: 4, @cons
|
||||
Step: @cons ===> @cons
|
||||
Visit, depth: 4, 1
|
||||
Visit, depth: 4, cons 2 nil
|
||||
Visit, depth: 5, 2
|
||||
Visit, depth: 5, nil
|
||||
Visit, depth: 6, @nil
|
||||
Step: @nil ===> @nil
|
||||
Step: nil ===> nil
|
||||
Step: cons 2 nil ===> cons 2 nil
|
||||
Step: cons 1 (cons 2 nil) ===> cons 1 (cons 2 nil)
|
||||
Visit, depth: 1
|
||||
Visit, depth: 2
|
||||
Step: 2
|
||||
Visit, depth: 2
|
||||
Visit, depth: 3
|
||||
Step: 3
|
||||
Visit, depth: 3
|
||||
Visit, depth: 4
|
||||
Visit, depth: 5
|
||||
Visit, depth: 5
|
||||
Step: 5
|
||||
Visit, depth: 5
|
||||
Step: 4
|
||||
Step: 3
|
||||
Visit, depth: 3
|
||||
Visit, depth: 4
|
||||
Step: 4
|
||||
Visit, depth: 4
|
||||
Visit, depth: 4
|
||||
Visit, depth: 5
|
||||
Visit, depth: 5
|
||||
Visit, depth: 6
|
||||
Step: 6
|
||||
Step: 5
|
||||
Step: 4
|
||||
Step: 3
|
||||
Rewrite using: map_cons
|
||||
map (λ x : ℕ, x + 1) (cons 1 (cons 2 nil)) ===> cons ((λ x : ℕ, x + 1) 1) (map (λ x : ℕ, x + 1) (cons 2 nil))
|
||||
Visit, depth: 3, cons ((λ x : ℕ, x + 1) 1) (map (λ x : ℕ, x + 1) (cons 2 nil))
|
||||
|
|
Loading…
Reference in a new issue