anchor.diff:              ArrayND.set idx ev res
           res
   
  +    /// returns the required number of arguments of the element expression
       let rec requiredNumberOfArgs expr =
           match expr with
           | Leaf (ArgElement (Arg n, _)) -> 
  
positive.code:             Unary (Sum (sumSym, first, last), expr) 
          | _ -> invalidArg "idx" "idx must be summation index obtained by calling sumIdx"
  
      /// expr if left = right, otherwise 0.
  //    let kroneckerIf left right expr =
  //        Unary (KroneckerIf (left, right), expr)
  
      /// If left=right, then thenExpr else elseExpr.
      let ifThenElse left right thenExpr elseExpr =
          Binary (IfThenElse (left, right), thenExpr, elseExpr)
  
negative.code:         | Power        
          | IfThenElse of SizeSpecT * SizeSpecT
          
      /// an element expression
      and ElemExprT<'T> =
          | Leaf of LeafOpT<'T>
          | Unary of UnaryOpT<'T> * ElemExprT<'T>
          | Binary of BinaryOpT<'T> * ElemExprT<'T> * ElemExprT<'T>
          
      /// a constant value
      let scalar a =
          Leaf (Const a)
                
      type ElemExprT<'T> with
  
          // elementwise unary
  