fact: Fixpoint removeUp (t:tree) (c:context) : tree := match c with | Top_c => t | TwoLeftHole_c em (Three_t tl' el' tm' er' tr') c' => zip (Two_t (Two_t t em tl') el' (Two_t tm' er' tr')) c' | TwoLeftHole_c em (Two_t tl' em' tr') c' => removeUp (Three_t t em tl' em' tr') c' | TwoRightHole_c (Three_t tl' el' tm' er' tr') em c' => zip (Two_t (Two_t tl' el' tm') er' (Two_t tr' em t)) c' | TwoRightHole_c (Two_t tl' em' tr') em c' => removeUp (Three_t tl' em' tr' em t) c' | ThreeLeftHole_c el (Three_t tl' el' tm' er' tr') er tr c' => zip (Three_t (Two_t t el' tl') el (Two_t tm' er' tr') er tr) c' | ThreeLeftHole_c el (Two_t tl' em' tr') er tr c' => zip (Two_t (Three_t t el tl' em' tr') er tr) c' | ThreeMiddleHole_c (Three_t tl' el' tm' er' tr') el er tr c' => zip (Three_t (Two_t tl' el' tm') er' (Two_t tr' el t) er tr) c' | ThreeMiddleHole_c tl el er (Three_t tl' el' tm' er' tr') c' => zip (Three_t tl el (Two_t t er tl') el' (Two_t tm' er' tr')) c' | ThreeMiddleHole_c (Two_t tl' em' tr') el er tr c' => zip (Two_t (Three_t tl' em' tr' el t) er tr) c' | ThreeMiddleHole_c tl el er (Two_t tl' em' tr') c' => zip (Two_t tl el (Three_t t er tl' em' tr')) c' | ThreeRightHole_c tl el (Three_t tl' el' tm' er' tr') er c' => zip (Three_t tl el (Two_t tl' el' tm') er' (Two_t tr' er t)) c' | ThreeRightHole_c tl el (Two_t tl' em' tr') er c' => zip (Two_t tl el (Three_t tl' em' tr' er t)) c' | TwoLeftHole_c _ Null_t _ => Null_t | TwoRightHole_c Null_t _ _ => Null_t | ThreeLeftHole_c _ Null_t _ _ _ => Null_t | ThreeMiddleHole_c Null_t _ _ _ _ => Null_t | ThreeRightHole_c _ _ Null_t _ _ => Null_t end.
imports: ExtLib.Structures.Monads ExtLib.Data.Monads.OptionMonad ExtLib.Programming.Extras