@@ -360,9 +360,7 @@ calcTotality fc n pats
360360 _ -> []
361361 case mapMaybe (checkLHS i) (map (\ (_, l, r) -> l) pats) of
362362 (failure : _) -> return failure
363− _ -> if (Coinductive `elem` opts)
364− then calcProd i fc n pats
365− else checkSizeChange n
363+ _ -> checkSizeChange n
366364 where
367365 checkLHS i (P _ fn _)
368366 = case lookupTotal fn (tt_ctxt i) of
@@ -471,7 +469,7 @@ buildSCG (_, n) = do
471469 do logLvl 2 $ "Building SCG for " ++ show n ++ " from\n"
472470 ++ show pats ++ "\n" ++ show sc
473471 let newscg = buildSCG' ist (rights pats) args
474− logLvl 5 $ show newscg
472+ logLvl 5 $ "SCG is: " ++ show newscg
475473 addToCG n ( cg { scg = newscg } )
476474 [] -> logLvl 5 $ "Could not build SCG for " ++ show n ++ "\n"
477475 x -> error $ "buildSCG: " ++ show (n, x)
@@ -489,13 +487,14 @@ delazy' all (Bind n b sc) = Bind n (fmap (delazy' all) b) (delazy' all sc)
489487delazy' all t = t
490488
491489data Guardedness = Toplevel | Unguarded | Guarded
490+ deriving Show
492491
493492buildSCG' :: IState -> [(Term, Term)] -> [Name] -> [SCGEntry]
494493buildSCG' ist pats args = nub $ concatMap scgPat pats where
495494 scgPat (lhs, rhs) = let lhs' = delazy lhs
496495 rhs' = delazy rhs
497496 (f, pargs) = unApply (dePat lhs') in
498− findCalls Toplevel (dePat rhs') (patvars lhs') pargs
497+ findCalls Toplevel (dePat rhs') (patvars lhs') pargs
499498
500499 findCalls guarded ap@(App f a) pvs pargs
501500 -- under a call to "assert_total", don't do any checking, just believe
@@ -506,10 +505,10 @@ buildSCG' ist pats args = nub $ concatMap scgPat pats where
506505 -- immediate call, as long as the call is guarded.
507506 -- Then check its arguments
508507 | (P _ (UN del) _, [_,_,arg]) <- unApply ap,
509− guarded <- Guarded,
508+ Guarded <- guarded,
510509 del == txt "Delay"
511510 = let (capp, args) = unApply arg in
512− concatMap (\x -> findCalls Toplevel x pvs pargs) args
511+ concatMap (\x -> findCalls guarded x pvs pargs) args
513512 | (P _ n _, args) <- unApply ap
514513 = let nguarded = case guarded of
515514 Unguarded -> Unguarded