GrammarProducts-0.1.1.1: Grammar products and higher-dimensional grammars

Safe HaskellNone
LanguageHaskell2010

FormalLanguage.GrammarProduct.Op.Linear

Description

Direct product of two grammars.

Currently implemented for linear grammars. Once we move to context-free grammars with more than one non-terminal on the RHS, things become interesting.

Synopsis

Documentation

directProduct :: Semigroup (Linear a) => a -> a -> a Source

newtype Linear a Source

Constructors

Linear 

Fields

runLinear :: a
 

mergeRHS :: [Symbol] -> [Symbol] -> [Symbol] Source

Merges right-hand sides in a linear direct product. For full-fledged CFGs in different normal forms, see the GNF and CNF implementations.

TODO get prefix, get single NT, get suffix ;;; merge prefixes, merge single NTs, merge suffixes ;;; and in case of no NTs? prefer prefixes?