linearCheck : Ref Ctxt Defs => Ref UST UState => FC -> RigCount -> Bool -> Env Term vars -> Term vars -> Core (Term vars)