From e5c8636a5f608af83d918e62533306cf7ddc7118 Mon Sep 17 00:00:00 2001 From: krasimir Date: Sat, 23 May 2009 21:33:52 +0000 Subject: 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 --- src/PGF.hs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/PGF.hs') diff --git a/src/PGF.hs b/src/PGF.hs index 7eb79cd8a..fef4682da 100644 --- a/src/PGF.hs +++ b/src/PGF.hs @@ -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)) -- cgit v1.2.3