language-toolkit-1.2.0.0: A set of tools for analyzing languages via logic and automata
Copyright(c) 2017-20192023 Dakotah Lambert
LicenseMIT
Safe HaskellSafe-Inferred
LanguageHaskell2010

LTK.Factors

Description

This module provides a means to define positive and negative factors over the adjacency or precedence relations, as well as unions and intersections thereof.

Synopsis

Constructions

required :: Factor e -> Literal e #

The factor is required to appear in every string. Note that a conjunctive constraint of (required (Substring x True True)) restricts the stringset to at most one word.

forbidden :: Factor e -> Literal e #

The factor is not allowed to appear in any word.

buildLiteral :: (Enum n, Ord n, Ord e) => Set e -> Literal e -> FSA n e #

Build an FSA representing a single constraint.

build :: (Enum n, NFData n, Ord n, NFData e, Ord e) => Set e -> Set (Conjunction e) -> FSA n e #

Build an FSA representing the conjunction of a set of constraints provided in conjunctive normal form.

makeConstraint :: Ord e => [[Literal e]] -> Conjunction e #

Combine inner lists by Disjunction, and form a Conjunction of the results.

Logical Expressions

data Factor e #

A substring or subsequence, from which to build constraints.

Constructors

Substring 

Fields

Subsequence [Set e] 

Instances

Instances details
(Read e, Ord e) => Read (Factor e) # 
Instance details

Defined in LTK.Factors

Show e => Show (Factor e) # 
Instance details

Defined in LTK.Factors

Methods

showsPrec :: Int -> Factor e -> ShowS #

show :: Factor e -> String #

showList :: [Factor e] -> ShowS #

Eq e => Eq (Factor e) # 
Instance details

Defined in LTK.Factors

Methods

(==) :: Factor e -> Factor e -> Bool #

(/=) :: Factor e -> Factor e -> Bool #

Ord e => Ord (Factor e) # 
Instance details

Defined in LTK.Factors

Methods

compare :: Factor e -> Factor e -> Ordering #

(<) :: Factor e -> Factor e -> Bool #

(<=) :: Factor e -> Factor e -> Bool #

(>) :: Factor e -> Factor e -> Bool #

(>=) :: Factor e -> Factor e -> Bool #

max :: Factor e -> Factor e -> Factor e #

min :: Factor e -> Factor e -> Factor e #

data Literal e #

A constraint.

Constructors

Literal Bool (Factor e) 

Instances

Instances details
(Read e, Ord e) => Read (Literal e) # 
Instance details

Defined in LTK.Factors

Show e => Show (Literal e) # 
Instance details

Defined in LTK.Factors

Methods

showsPrec :: Int -> Literal e -> ShowS #

show :: Literal e -> String #

showList :: [Literal e] -> ShowS #

Eq e => Eq (Literal e) # 
Instance details

Defined in LTK.Factors

Methods

(==) :: Literal e -> Literal e -> Bool #

(/=) :: Literal e -> Literal e -> Bool #

Ord e => Ord (Literal e) # 
Instance details

Defined in LTK.Factors

Methods

compare :: Literal e -> Literal e -> Ordering #

(<) :: Literal e -> Literal e -> Bool #

(<=) :: Literal e -> Literal e -> Bool #

(>) :: Literal e -> Literal e -> Bool #

(>=) :: Literal e -> Literal e -> Bool #

max :: Literal e -> Literal e -> Literal e #

min :: Literal e -> Literal e -> Literal e #

newtype Disjunction e #

Multiple constraints, joined by OR.

Constructors

Disjunction (Set (Literal e)) 

Instances

Instances details
(Read e, Ord e) => Read (Disjunction e) # 
Instance details

Defined in LTK.Factors

Show e => Show (Disjunction e) # 
Instance details

Defined in LTK.Factors

Eq e => Eq (Disjunction e) # 
Instance details

Defined in LTK.Factors

Ord e => Ord (Disjunction e) # 
Instance details

Defined in LTK.Factors

newtype Conjunction e #

Multiple disjunctions, joined by AND.

Constructors

Conjunction (Set (Disjunction e)) 

Instances

Instances details
(Read e, Ord e) => Read (Conjunction e) # 
Instance details

Defined in LTK.Factors

Show e => Show (Conjunction e) # 
Instance details

Defined in LTK.Factors

Eq e => Eq (Conjunction e) # 
Instance details

Defined in LTK.Factors

Ord e => Ord (Conjunction e) # 
Instance details

Defined in LTK.Factors