fact: Fixpoint insertUp (tet:tree * E * tree) (c:context) : tree := let '(tl,em,tr) := tet in match c with | Top_c => Two_t tl em tr | TwoLeftHole_c em' tr' c' => zip (Three_t tl em tr em' tr') c' | TwoRightHole_c tl' em' c' => zip (Three_t tl' em' tl em tr ) c' | ThreeLeftHole_c el tm er tr' c' => insertUp (Two_t tl em tr, el, Two_t tm er tr') c' | ThreeMiddleHole_c tl' el er tr' c' => insertUp (Two_t tl' el tl, em, Two_t tr er tr') c' | ThreeRightHole_c tl' el tm er c' => insertUp (Two_t tl' el tm, er, Two_t tl em tr) c' end.
imports: ExtLib.Structures.Monads ExtLib.Data.Monads.OptionMonad ExtLib.Programming.Extras