now in the command shell the primary type in the pipe is Expr not Tree. This makes the pt -compute and pt -typecheck more interesting

This commit is contained in:
krasimir
2009-05-23 21:33:52 +00:00
parent f9c877eec6
commit 0c46a129e6
10 changed files with 110 additions and 95 deletions

View File

@@ -48,7 +48,7 @@ module PGF(
parse, canParse, parseAllLang, parseAll,
-- ** Evaluation
tree2expr, PGF.expr2tree, paraphrase, typecheck,
tree2expr, expr2tree, PGF.compute, paraphrase, typecheck,
-- ** Word Completion (Incremental Parsing)
complete,
@@ -287,9 +287,6 @@ complete pgf from typ input =
| otherwise = (init ws, last ws)
where ws = words s
-- | Converts an expression to tree. The expression
-- is first reduced to beta-eta-alfa normal form and
-- after that converted to tree. The function definitions
-- are used in the computation.
expr2tree :: PGF -> Expr -> Tree
expr2tree pgf = PGF.Data.expr2tree (funs (abstract pgf))
-- | Converts an expression to normal form
compute :: PGF -> Expr -> Expr
compute pgf = PGF.Data.normalForm (funs (abstract pgf))