@@ -171,7 +171,7 @@ data IdeSlaveCommand = REPLCompletions String
171171 | AddProofClause Int String
172172 | AddMissing Int String
173173 | MakeWithBlock Int String
174− | ProofSearch Bool Int String [String]
174+ | ProofSearch Bool Int String [String] (Maybe Int) -- ^^ Recursive?, line, name, hints, depth
175175 | MakeLemma Int String
176176 | LoadFile String
177177 | DocsFor String
@@ -196,12 +196,17 @@ sexpToCommand (SexpList [SymbolAtom "make-with", IntegerAtom line, StringAtom na
196196-- The Boolean in ProofSearch means "search recursively"
197197-- If it's False, that means "refine", i.e. apply the name and fill in any
198198-- arguments which can be done by unification.
199−sexpToCommand (SexpList [SymbolAtom "proof-search", IntegerAtom line, StringAtom name, SexpList hintexp]) | Just hints <- getHints hintexp = Just (ProofSearch True (fromInteger line) name hints)
200− where getHints = mapM (\h -> case h of
201− StringAtom s -> Just s
202− _ -> Nothing)
199+sexpToCommand (SexpList (SymbolAtom "proof-search" : IntegerAtom line : StringAtom name : rest))
200+ | [] <- rest = Just (ProofSearch True (fromInteger line) name [] Nothing)
201+ | [SexpList hintexp] <- rest
202+ , Just hints <- getHints hintexp = Just (ProofSearch True (fromInteger line) name hints Nothing)
203+ | [SexpList hintexp, IntegerAtom depth] <- rest
204+ , Just hints <- getHints hintexp = Just (ProofSearch True (fromInteger line) name hints (Just (fromInteger depth)))
205+ where getHints = mapM (\h -> case h of
206+ StringAtom s -> Just s
207+ _ -> Nothing)
203208sexpToCommand (SexpList [SymbolAtom "make-lemma", IntegerAtom line, StringAtom name]) = Just (MakeLemma (fromInteger line) name)
204−sexpToCommand (SexpList [SymbolAtom "refine", IntegerAtom line, StringAtom name, StringAtom hint]) = Just (ProofSearch False (fromInteger line) name [hint])
209+sexpToCommand (SexpList [SymbolAtom "refine", IntegerAtom line, StringAtom name, StringAtom hint]) = Just (ProofSearch False (fromInteger line) name [hint] Nothing)
205210sexpToCommand (SexpList [SymbolAtom "docs-for", StringAtom name]) = Just (DocsFor name)
206211sexpToCommand (SexpList [SymbolAtom "apropos", StringAtom search]) = Just (Apropos search)
207212sexpToCommand (SymbolAtom "get-options") = Just GetOpts