NAME
FLAT - Formal Language & Automata Toolkit
SYNOPSIS
FLAT.pm is the base class of all regular language objects. For more information, see other POD pages.
USAGE
All regular language objects in FLAT implement the following methods. Specific regular language representations (regex, NFA, DFA) may implement additional methods that are outlined in the repsective POD pages.
Conversions Among Representations
- $lang->as_nfa
- $lang->as_dfa
- $lang->as_min_dfa
- $lang->as_regex
-
Returns an equivalent regular language to $lang in the desired representation. Does not modify $lang (even if $lang is already in the desired representation).
For more information on the specific algorithms used in these conversions, see the POD pages for a specific representation.
Closure Properties
- $lang1->union($lang2, $lang3, ... )
- $lang1->intersect($lang2, $lang3, ... )
- $lang1->concat($lang2, $lang3, ... )
- $lang1->symdiff($lang2, $lang3, ... )
-
Returns a regular language object that is the union, intersection, concatenation, or symmetric difference of $lang1 ... $langN, respectively. The return value will have the same representation (regex, NFA, or DFA) as $lang1.
- $lang1->difference($lang2)
-
Returns a regular language object that is the set difference of $lang1 and $lang2. Equivalent to
$lang1->intersect($lang2->complement)
The return value will have the same representation (regex, NFA, or DFA) as $lang1.
- $lang->kleene
- $lang->star
-
Returns a regular language object for the Kleene star of $lang. The return value will have the same representation (regex, NFA, or DFA) as $lang.
- $lang->complement
-
Returns a regular language object for the complement of $lang. The return value will have the same representation (regex, NFA, or DFA) as $lang.
- $lang->reverse
-
Returns a regular language object for the stringwise reversal of $lang. The return value will have the same representation (regex, NFA, or DFA) as $lang.
Decision Properties
- $lang->is_finite
- $lang->is_infinite
-
Returns a boolean value indicating whether $lang represents a finite/infinite language.
- $lang->is_empty
-
Returns a boolean value indicating whether $lang represents the empty language.
- $lang1->equals($lang2)
-
Returns a boolean value indicating whether $lang1 and $lang2 are representations of the same language.
- $lang1->is_subset_of($lang2)
-
Returns a boolean value indicating whether $lang1 is a subset of $lang2.
- $lang->contains($string)
-
Returns a boolean value indicating whether $string is in the language represented by $lang.
AUTHORS & ACKNOWLEDGEMENTS
FLAT is written by Mike Rosulek <mike at mikero dot com> and Brett Estrade <estradb at gmail dot com>.
The initial version (FLAT::Legacy) by Brett Estrade was work towards an MS thesis at the University of Southern Mississippi.
LICENSE
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
MORE INFO
Please visit the Wiki at http://www.0x743.com/flat