# HG changeset patch # User ryokka # Date 1575623964 -32400 # Node ID 7fb57243a8c994ec6d574d8ec0a243197e00baaa # Parent 8ab2e2f9469f516f88c694f47141bceaea0d56d3 fix diff -r 8ab2e2f9469f -r 7fb57243a8c9 hoareBinaryTree.agda --- a/hoareBinaryTree.agda Fri Dec 06 17:48:18 2019 +0900 +++ b/hoareBinaryTree.agda Fri Dec 06 18:19:24 2019 +0900 @@ -72,7 +72,7 @@ bt' {n} A l → bt' {n} A r → l ≤ key → key ≤ r → bt' A key data bt'-path {n : Level} (A : Set n) : Set n where -- (a : Setn) - bt'-left : (key : ℕ) → {left-key : ℕ} → (bt' A left-key ) → (key ≤ left-key) → bt'-path A + bt'-left : (key : ℕ) → {left-key : ℕ} → (bt' A left-key ) → (key ≤ left-key) → bt'-path A bt'-right : (key : ℕ) → {right-key : ℕ} → (bt' A right-key ) → (right-key ≤ key) → bt'-path A @@ -83,15 +83,19 @@ bt-find' key tr@(bt'-leaf key₁) stack next = next tr stack -- no key found bt-find' key (bt'-node key₁ value tree tree₁ x x₁) stack next with <-cmp key key₁ bt-find' key tr@(bt'-node {l} {r} key₁ value tree tree₁ x x₁) stack next | tri< a ¬b ¬c = - bt-find' key tree ( (bt'-left key {key₁} tr {!!} ) ∷ stack) next + bt-find' key tree ( (bt'-left key {key₁} tr (<⇒≤ a) ) ∷ stack) next bt-find' key found@(bt'-node key₁ value tree tree₁ x x₁) stack next | tri≈ ¬a b ¬c = next found stack bt-find' key tr@(bt'-node key₁ value tree tree₁ x x₁) stack next | tri> ¬a ¬b c = - bt-find' key tree ( (bt'-right key {key₁} tr {!!} ) ∷ stack) next + bt-find' key tree ( (bt'-right key {key₁} tr (<⇒≤ c) ) ∷ stack) next a