-- ----------------------------

probsize :: Problem -> Int
probsize pr = sum (map sgv (prGlobVars pr)) + sum (map sgh (prGlobHyps pr)) + sum (map (sf . snd) (prConjectures pr))
 where
 sgv gv = st $ gvType gv
 sgh gh = sf $ ghForm gh
 sf (NotM f) = case f of
  C _ _ args -> 1 + sum (map sa args)
  App _ _ args -> 1 + sa2 args
  Lam _ t f -> st t + sf f
 sa (F f) = sf f
 sa (T t) = st t
 sa2 (NotM ArgNil) = 0
 sa2 (NotM (ArgCons f as)) = sf f + sa2 as
 st t = 0

-- ------------------------------
probsize :: Problem -> Int
probsize pr = sum (map sgv (prGlobVars pr)) + sum (map sgh (prGlobHyps pr)) + sum (map (sf . snd) (prConjectures pr))
 where
 sgv gv = st $ gvType gv
 sgh gh = sf $ ghForm gh
 sf (NotM f) = case f of
  C _ _ args -> 1 + sum (map sa args)
  App _ _ args -> 1 + sa2 args
  Lam _ t f -> st t + sf f
 sa (F f) = sf f
 sa (T t) = st t
 sa2 (NotM ArgNil) = 0
 sa2 (NotM (ArgCons f as)) = sf f + sa2 as
 st t = 0

-- ------------------------------
probsize pr = sum (map sgv (prGlobVars pr)) + sum (map sgh (prGlobHyps pr)) + sum (map (sf . snd) (prConjectures pr))
 where
 sgv gv = st $ gvType gv
 sgh gh = sf $ ghForm gh
 sf (NotM f) = case f of
  C _ _ args -> 1 + sum (map sa args)
  App _ _ args -> 1 + sa2 args
  Lam _ t f -> st t + sf f
 sa (F f) = sf f
 sa (T t) = st t
 sa2 (NotM ArgNil) = 0
 sa2 (NotM (ArgCons f as)) = sf f + sa2 as
 st t = 0

-- ------------------------------