anchor.diff:          let cont() =
               match l1, l2 with 
               | (x1 :: t1), _ when not (isEmpty x1) ->
  -                match x1 with
  -                | :? SetTreeNode<'T> as x1n ->
  +                if x1.Height = 1 then
  +                    compareStacks comparer (empty :: SetTree x1.Key :: t1) l2
  +                else
  +                    let x1n = asNode x1
                       compareStacks comparer (x1n.Left :: (SetTreeNode (x1n.Key, empty, x1n.Right, 0) :> SetTree<'T>) :: t1) l2
  -                | _ -> compareStacks comparer (empty :: SetTree x1.Key :: t1) l2
               | _, (x2 :: t2) when not (isEmpty x2) ->
  -                match x2 with
  -                | :? SetTreeNode<'T> as x2n ->
  +                if x2.Height = 1 then
  +                    compareStacks comparer l1 (empty :: SetTree x2.Key :: t2)
  +                else
  +                    let x2n = asNode x2
                       compareStacks comparer l1 (x2n.Left :: (SetTreeNode (x2n.Key, empty, x2n.Right, 0) :> SetTree<'T>  ) :: t2)
  -                | _ -> compareStacks comparer l1 (empty :: SetTree x2.Key :: t2)
  -            | _ -> failwith "unexpected state in SetTree.compareStacks"
  +            | _ -> unexpectedstateInSetTreeCompareStacks()
           
           match l1, l2 with 
           | [], [] ->  0
  
positive.code:         else
              SetTreeNode (k, l, r, m+1) :> SetTree<'T>
  
      let inline private asNode(value:SetTree<'T>) : SetTreeNode<'T> =
          value :?> SetTreeNode<'T>
          
      let rebalance t1 v t2 =
          let t1h = height t1 
          let t2h = height t2 
  
negative.code:                     else
                          let sk, r' = spliceOutSuccessor tn.Right 
                          mk tn.Left sk r'
                  else rebalance tn.Left tn.Key (remove comparer k tn.Right)               
  
      let rec mem (comparer: IComparer<'T>) k (t:SetTree<'T>) = 
          if isEmpty t then false
          else
              let c = comparer.Compare(k, t.Key) 
              if t.Height = 1 then (c = 0)
              else
                  let tn = asNode t
                  if   c < 0 then mem comparer k tn.Left
                  elif c = 0 then true
                  else mem comparer k tn.Right
  
      let rec iter f (t:SetTree<'T>) = 
          if isEmpty t then ()
          else
              if t.Height = 1 then f t.Key
              else
                  let tn = asNode t
                  iter f tn.Left; f tn.Key; iter f tn.Right 
  
      let rec foldBackOpt (f:OptimizedClosures.FSharpFunc<_, _, _>) (t:SetTree<'T>) x = 
          if isEmpty t then x
          else
              if t.Height = 1 then f.Invoke(t.Key, x)
              else
                  let tn = asNode t
                  foldBackOpt f tn.Left (f.Invoke(tn.Key, (foldBackOpt f tn.Right x)))
  
      let foldBack f m x = foldBackOpt (OptimizedClosures.FSharpFunc<_, _, _>.Adapt f) m x
  
      let rec foldOpt (f:OptimizedClosures.FSharpFunc<_, _, _>) x (t:SetTree<'T>) = 
          if isEmpty t then x
          else
              if t.Height = 1 then f.Invoke(x, t.Key)
              else
                  let tn = asNode t 
                  let x = foldOpt f x tn.Left in 
                  let x = f.Invoke(x, tn.Key)
                  foldOpt f x tn.Right
  
      let fold f x m = foldOpt (OptimizedClosures.FSharpFunc<_, _, _>.Adapt f) x m
  
      let rec forall f (t:SetTree<'T>) = 
          if isEmpty t then true
          else
              if t.Height = 1 then f t.Key
              else
                  let tn = asNode t
                  f tn.Key && forall f tn.Left && forall f tn.Right
  
      let rec exists f (t:SetTree<'T>) = 
          if isEmpty t then false
          else
              if t.Height = 1 then f t.Key
              else
                  let tn = asNode t
                  f tn.Key || exists f tn.Left || exists f tn.Right
  
      let subset comparer a b  =
          forall (fun x -> mem comparer x b) a
  