summaryrefslogtreecommitdiff
path: root/src/PGF.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2009-05-23 21:33:52 +0000
committerkrasimir <krasimir@chalmers.se>2009-05-23 21:33:52 +0000
commite5c8636a5f608af83d918e62533306cf7ddc7118 (patch)
tree813d9b452133b4283de850bd1d634f76678f46b8 /src/PGF.hs
parent41b263cf6aa38e7c6ef090c0fa18949b86eec62c (diff)
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
Diffstat (limited to 'src/PGF.hs')
-rw-r--r--src/PGF.hs11
1 files changed, 4 insertions, 7 deletions
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))