{-# OPTIONS --without-K #-}
module Explore.BinTree where

open import Data.Tree.Binary

open import Explore.Core
open import Explore.Properties

fromBinTree :  {m A}  BinTree A  Explore m A
fromBinTree (leaf x)   _ _   f = f x
fromBinTree (fork  r) ε _∙_ f = fromBinTree  ε _∙_ f  fromBinTree r ε _∙_ f

fromBinTree-ind :  {m p A} (t : BinTree A)  ExploreInd p (fromBinTree {m} t)
fromBinTree-ind (leaf x)   P _  P∙ Pf = Pf x
fromBinTree-ind (fork  r) P  P∙ Pf = P∙ (fromBinTree-ind  P  P∙ Pf)
                                           (fromBinTree-ind r P  P∙ Pf)