FAdo.sst
Set Specification Transducer supportt
-
NFA2SSFA(aut)[source]
Transforms a NFA to and SSFA
- Parameters:
aut (fa.NFA) – NFA
- Return type:
SSFA
-
class PSP[source]
Relation pair of set specifications
-
class PSPDiff(arg1, arg2)[source]
Relation pair of two set specifications (constrained by non equality)
-
inIntersection(other, alph)[source]
Evaluates the intersect on input wit anothe Set Specification
- Parameters:
-
- Return type:
PSP
-
class PSPEqual(arg1)[source]
Relation pair of two set specifications (constrained by equality)
-
inIntersection(other, alph)[source]
Evaluates the intersect on input wit anothe Set Specification
- Parameters:
-
- Return type:
PSP
-
class PSPVanila(arg1, arg2)[source]
Relation pair of two set specifications
-
alphabet()[source]
The covering alphabet of a PSP
- Return type:
set
-
behaviour(sigma)[source]
Expansion of a PSP
- Return type:
(set, set)
-
inIntersection(other, alph)[source]
Evaluates the intersect on input with another Set Specification
- Parameters:
-
- Return type:
PSP
-
inverse()[source]
Inverse of a PSP
- Return type:
PSPVanila
-
isAInvariant()[source]
Is this an alphabet invariant PSP?
- Return type:
bool
-
class SSAnyOf[source]
Set specification for ‘any’
-
SSConditionalNoneOf(oset)[source]
Auxiliary function that coalesces an SSNoneOf into an SSAnyOf if oset is empty
-
class SSEmpty[source]
-
class SSEpsilon[source]
-
class SSFA(alph)[source]
NFAs with Set Specifications as transition labels
- Parameters:
alph – alphabet
-
addEpsilonLoops()[source]
Add epsilon loops to every state
Attention
in-place modification
-
addTransition(sti1, spec, sti2)[source]
Add af Set Specification transition
- Parameters:
sti1 (int) – start state index
sti2 (int) – end state index
spec (SetSpec) – symbolic spec
-
emptyP()[source]
Tests if the automaton accepts an empty language
- Return type:
bool
-
epsilonP()[source]
Whether this NFA has epsilon-transitions
- Return type:
bool
-
toNFA()[source]
Dummy identity function
- Return type:
NFA
-
witness()[source]
Witness of non emptyness
- Returns:
word
- Return type:
str
-
class SSNoneOf(oset)[source]
Set specification for ‘none of…’
-
class SSOneOf(oset)[source]
Set specification for ‘one of…’
-
class SST(sigma=None)[source]
SFT with set specification labels
-
addEpsilonLoops()[source]
Add a loop transition with epsilon input and output to every state in the transducer.
-
addToSigma(sym)[source]
Adds a new symbol to the alphabet (it it is not already there)
- Parameters:
sym (unicode) – symbol to add
- Return type:
int
- Returns:
the index of the new symbol
-
addTransition(stsrc, pair, sti2)[source]
- Parameters:
sti2 – int
-
addTransitionProductQ(src, dest, ddest, sym, futQ, pastQ)[source]
Add transition to the new transducer instance.
Version for the optimized product
- Parameters:
-
-
epsilonOutP()[source]
Tests if epsilon occurs in transition outputs
- Return type:
bool
-
epsilonP()[source]
Test whether this transducer has input epsilon-transitions
- Return type:
bool
-
inIntersection(other)[source]
Conjunction of transducer and automata: X & Y.
Note
This is a fast version of the method that does not produce meaningfull state names.
Note
The resulting transducer is not trim.
- Parameters:
other (DFA|NFA) – the automata needs to be operated.
- Return type:
SFT
-
inverse()[source]
Switch the input label with the output label.
No initial or final state changed.
- Returns:
Transducer with transitions switched.
- Return type:
SFT
-
nonEmptyW()[source]
Witness of non emptyness
- Returns:
pair (in-word, out-word)
- Return type:
tuple
-
outIntersection(other)[source]
Conjunction of transducer and automaton: X & Y using output intersect operation.
- Parameters:
other (DFA|NFA) – the automaton used as a filter of the output
- Return type:
SFT
-
productInput(other)[source]
Returns a transducer (skeleton) resulting from the execution of the transducer with the automaton as
filter on the input.
Note
This version does not use stateIndex() with the price of generating some unreachable sates
- Parameters:
other (SSFA) – the automaton used as filter
- Return type:
SST
Changed in version 1.3.3.
-
reversal()[source]
Returns a transducer that recognizes the reversal of the relation.
- Returns:
Transducer recognizing reversal language
- Return type:
SFT
-
toInNFA()[source]
Delete the output labels in the transducer. Translate it into an NFA
- Return type:
NFA
-
toInSSFA()[source]
Delete the output labels in the transducer. Translate it into an SSFA
- Return type:
SSFA
-
toOutNFA()[source]
Returns the result of considering the output symbols of the transducer as input symbols of a NFA (ignoring
the input symbol, thus)
- Returns:
the NFA
- Return type:
NFA
-
toOutSSFA()[source]
Returns the result of considering the output symbols of the transducer as input symbols of a SSFA (ignoring
the input symbol, thus)
- Returns:
the SSFA
- Return type:
SSFA
-
toSFT()[source]
Expands a SST to an SFT
- Return type:
SFT
-
toXSSFA(side)[source]
Skeleton of a method that extracts both left & right language of a PSP
-
class SetSpec[source]
Set Specification labels