now command 'ai' prints the list of functions for given category

This commit is contained in:
krasimir
2009-05-13 06:27:31 +00:00
parent b037cbc361
commit fdba7d20ee

View File

@@ -600,14 +600,15 @@ allCommands cod env@(pgf, mos) = Map.fromList [
exec = \opts arg -> do exec = \opts arg -> do
case arg of case arg of
[Fun id []] -> case Map.lookup id (funs (abstract pgf)) of [Fun id []] -> case Map.lookup id (funs (abstract pgf)) of
Just (ty,def) -> putStrLn (render (text "fun" <+> text (prCId id) <+> colon <+> ppType 0 ty $$ Just (ty,def) -> putStrLn (render (text "fun" <+> text (prCId id) <+> colon <+> ppType 0 ty $$
if def == EEq [] if def == EEq []
then empty then empty
else text "def" <+> text (prCId id) <+> char '=' <+> ppExpr 0 def)) else text "def" <+> text (prCId id) <+> char '=' <+> ppExpr 0 def))
Nothing -> case Map.lookup id (cats (abstract pgf)) of Nothing -> case Map.lookup id (cats (abstract pgf)) of
Just hyps -> putStrLn (render (text "cat" <+> Just hyps -> putStrLn (render (text "cat" <+> text (prCId id) <+> hsep (map ppHypo hyps) $$
text (prCId id) <+> space $$
hsep (map ppHypo hyps))) text "fun" <+> vcat [text (prCId fid) <+> colon <+> ppType 0 ty
| (fid,ty) <- functionsToCat pgf id]))
Nothing -> putStrLn "unknown identifier" Nothing -> putStrLn "unknown identifier"
_ -> putStrLn "a single identifier is expected from the command" _ -> putStrLn "a single identifier is expected from the command"
return void return void