ADPfusion-0.5.1.0: Efficient, high-level dynamic programming.

Safe HaskellNone
LanguageHaskell2010

ADP.Fusion.SynVar.Recursive.Type

Synopsis

Documentation

data IRec m c i x where Source

A syntactic variable that does not memoize but simplify recurses. One needs to be somewhat careful when using this one. ITbl performs memoization to perform DP in polynomial time (roughly speaking). If the rules for an IRec are of a particular type, they will exponential running time. Things like X -> X X are, for example, rather bad. Rules of the type X -> Y, Y -> Z are ok, if Y is an IRec since we just continue on. The same holds for Y -> a Y. Basically, things are safe if there is only a (small) constant number of parses of an IRec synvar.

Constructors

IRec :: !c -> !i -> !i -> !(i -> i -> m x) -> IRec m c i x 

Fields

iRecConstraint :: !c
 
iRecFrom :: !i
 
iRecTo :: !i
 
iRecFun :: !(i -> i -> m x)
 

Instances

(MutateCell CFG ts im om i, PrimMonad om) => MutateCell CFG ((:.) ts (IRec im c i x)) im om i Source 
(Monad mB, Element ls ((:.) is i), TableStaticVar ((:.) us u) ((:.) cs c) ((:.) is i), AddIndexDense (Elm ls ((:.) is i)) ((:.) us u) ((:.) cs c) ((:.) is i), MkStream mB ls ((:.) is i)) => MkStream mB ((:!:) ls (Backtrack (IRec mF ((:.) cs c) ((:.) us u) x) mF mB r)) ((:.) is i) Source 
(Monad m, Element ls ((:.) is i), TableStaticVar ((:.) us u) ((:.) cs c) ((:.) is i), AddIndexDense (Elm ls ((:.) is i)) ((:.) us u) ((:.) cs c) ((:.) is i), MkStream m ls ((:.) is i)) => MkStream m ((:!:) ls (IRec m ((:.) cs c) ((:.) us u) x)) ((:.) is i) Source 
TableOrder ts => TableOrder ((:.) ts (IRec im c i x)) Source

IRecs do not need an order, given that they do not memoize.

Element ls i => Element ((:!:) ls (Backtrack (IRec mF c u x) mF mB r)) i Source 
Element ls i => Element ((:!:) ls (IRec m c u x)) i Source 
(Monad mB, IndexStream i) => Axiom (Backtrack (IRec mF c i x) mF mB r) Source 
(Monad m, IndexStream i) => Axiom (IRec m c i x) Source 
Build (IRec m c i x) Source 
GenBacktrackTable (IRec mF c i x) mF mB r Source 
data Elm ((:!:) ls (Backtrack (IRec mF c u x) mF mB r)) = ElmBtIRec !x [r] !(RunningIndex i) !(Elm ls i) Source 
data Elm ((:!:) ls (IRec m c u x)) = ElmIRec !x !(RunningIndex i) !(Elm ls i) Source 
type Arg ((:!:) ls (Backtrack (IRec mF c u x) mF mB r)) = (:.) (Arg ls) (x, [r]) Source 
type Arg ((:!:) ls (IRec m c u x)) = (:.) (Arg ls) x Source 
type AxiomStream (Backtrack (IRec mF c i x) mF mB r) = mB [r] Source 
type AxiomStream (IRec m c i x) = m x Source 
type Stack (IRec m c i x) = (:!:) S (IRec m c i x) 
type TermArg (IRec m c i x) = x Source 
type BacktrackIndex (IRec mF c i x) = i Source 
data Backtrack (IRec mF c i x) mF = BtIRec !c !i !i !(i -> i -> mB x) !(i -> i -> mB [r]) Source