diff options
| author | krasimir <krasimir@chalmers.se> | 2010-05-26 09:37:32 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-05-26 09:37:32 +0000 |
| commit | 6eda1118fcc497fda0939f02502569caf8625c7c (patch) | |
| tree | d5c208f79e701e48aa85a2bf08d995f7b28e9619 /src/runtime | |
| parent | b1441f2807a44c63a50382db93f49601550a95a8 (diff) | |
since now we don't do common subexpression elimination for PGF we could simplify the PMCFG generation
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/haskell/PGF/Binary.hs | 28 | ||||
| -rw-r--r-- | src/runtime/haskell/PGF/Check.hs | 8 | ||||
| -rw-r--r-- | src/runtime/haskell/PGF/Data.hs | 1 |
3 files changed, 0 insertions, 37 deletions
diff --git a/src/runtime/haskell/PGF/Binary.hs b/src/runtime/haskell/PGF/Binary.hs index 241c9cc99..623cbe7bb 100644 --- a/src/runtime/haskell/PGF/Binary.hs +++ b/src/runtime/haskell/PGF/Binary.hs @@ -72,34 +72,6 @@ instance Binary Alternative where put (Alt v x) = put (v,x)
get = liftM2 Alt get get
-instance Binary Term where
- put (R es) = putWord8 0 >> put es
- put (S es) = putWord8 1 >> put es
- put (FV es) = putWord8 2 >> put es
- put (P e v) = putWord8 3 >> put (e,v)
- put (W e v) = putWord8 4 >> put (e,v)
- put (C i ) = putWord8 5 >> put i
- put (TM i ) = putWord8 6 >> put i
- put (F f) = putWord8 7 >> put f
- put (V i) = putWord8 8 >> put i
- put (K (KS s)) = putWord8 9 >> put s
- put (K (KP d vs)) = putWord8 10 >> put (d,vs)
-
- get = do tag <- getWord8
- case tag of
- 0 -> liftM R get
- 1 -> liftM S get
- 2 -> liftM FV get
- 3 -> liftM2 P get get
- 4 -> liftM2 W get get
- 5 -> liftM C get
- 6 -> liftM TM get
- 7 -> liftM F get
- 8 -> liftM V get
- 9 -> liftM (K . KS) get
- 10 -> liftM2 (\d vs -> K (KP d vs)) get get
- _ -> decodingError
-
instance Binary Expr where
put (EAbs b x exp) = putWord8 0 >> put (b,x,exp)
put (EApp e1 e2) = putWord8 1 >> put (e1,e2)
diff --git a/src/runtime/haskell/PGF/Check.hs b/src/runtime/haskell/PGF/Check.hs index 8f3b82eb7..94713a745 100644 --- a/src/runtime/haskell/PGF/Check.hs +++ b/src/runtime/haskell/PGF/Check.hs @@ -137,14 +137,6 @@ lintype pgf lang fun = case typeSkeleton (lookFun pgf fun) of vlinc (i,c) = case linc c of R ts -> R (ts ++ replicate i str) -inline :: PGFSig -> CId -> Term -> Term -inline pgf lang t = case t of - F c -> inl $ look c - _ -> composSafeOp inl t - where - inl = inline pgf lang - look = lookLin pgf lang - composOp :: Monad m => (Term -> m Term) -> Term -> m Term composOp f trm = case trm of R ts -> liftM R $ mapM f ts diff --git a/src/runtime/haskell/PGF/Data.hs b/src/runtime/haskell/PGF/Data.hs index 7623a05f3..12f945151 100644 --- a/src/runtime/haskell/PGF/Data.hs +++ b/src/runtime/haskell/PGF/Data.hs @@ -75,7 +75,6 @@ data Term = | K Tokn | V Int | C Int - | F CId | FV [Term] | W String Term | TM String |
