@@ -198,12 +198,20 @@ proofSearch rec fromProver ambigok deferonfail maxDepth elab fn nroot psnames hi
198198 return $ and (map (notHole hs) (zip as cs))
199199 Nothing -> fail "Can't happen"
200200
201+ -- if n is a metavariable, and c is a constructor form, we're not ready
202+ -- to run yet
201203 notHole hs (P _ n _, c)
202204 | (P _ cn _, _) <- unApply c,
203205 n `elem` hs && isConName cn (tt_ctxt ist) = False
204206 | Constant _ <- c = not (n `elem` hs)
207+ -- if fa is a metavariable applied to anything, we're not ready to run yet.
208+ notHole hs (fa, c)
209+ | (P _ fn _, args) <- unApply fa = fn `notElem` hs
205210 notHole _ _ = True
206211
212+ inHS hs (P _ n _) = n `elem` hs
213+ isHS _ _ = False
214+
207215 toUN t@(P nt (MN i n) ty)
208216 | ('_':xs) <- str n = t
209217 | otherwise = P nt (UN n) ty