diff options
| author | krasimir <krasimir@chalmers.se> | 2009-09-06 20:31:52 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-09-06 20:31:52 +0000 |
| commit | b97d6abb8190cdcb595b9bf48051cc4a98f01156 (patch) | |
| tree | 744fc14acf55e09812f6e15bab831cd28c1e7187 /src/GF/Command/TreeOperations.hs | |
| parent | c99b64404dd6b776d80b36ae3e1b8ef4e80949f7 (diff) | |
hopefully complete and correct typechecker in PGF
Diffstat (limited to 'src/GF/Command/TreeOperations.hs')
| -rw-r--r-- | src/GF/Command/TreeOperations.hs | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/src/GF/Command/TreeOperations.hs b/src/GF/Command/TreeOperations.hs index 262ce35b5..45f927afc 100644 --- a/src/GF/Command/TreeOperations.hs +++ b/src/GF/Command/TreeOperations.hs @@ -20,9 +20,7 @@ allTreeOps pgf = [ ("paraphrase",("paraphrase by using semantic definitions (def)", map tree2expr . nub . concatMap (paraphrase pgf . expr2tree))), ("smallest",("sort trees from smallest to largest, in number of nodes", - smallest)), - ("typecheck",("type check and solve metavariables; reject if incorrect", - concatMap (typecheck pgf))) + smallest)) ] smallest :: [Expr] -> [Expr] @@ -31,35 +29,3 @@ smallest = sortBy (\t u -> compare (size t) (size u)) where EAbs _ e -> size e + 1 EApp e1 e2 -> size e1 + size e2 + 1 _ -> 1 - -{- -toTree :: G.Term -> Tree -toTree t = case M.termForm t of - Ok (xx,f,aa) -> Abs xx (Fun f (map toTree aa)) - -fromTree :: Tree -> G.Term -fromTree t = case t of - Abs xx b -> M.mkAbs xx (fromTree b) - Var x -> M.vr x - Fun f ts -> M.mkApp f (map fromTree ts) --} - -{- -data Tree = - Abs [CId] Tree -- ^ lambda abstraction. The list of variables is non-empty - | Var CId -- ^ variable - | Fun CId [Tree] -- ^ function application - | Lit Literal -- ^ literal - | Meta Int -- ^ meta variable - -data Literal = - LStr String -- ^ string constant - | LInt Integer -- ^ integer constant - | LFlt Double -- ^ floating point constant - -mkType :: A.Type -> C.Type -mkType t = case GM.typeForm t of - Ok (hyps,(_,cat),args) -> C.DTyp (mkContext hyps) (i2i cat) (map mkExp args) - -mkExp :: A.Term -> C.Expr --} |
