MOTION-GRAMMAR-KIT - Formal Language Tools for Robots


 

Abstract

This package provides a variety of functions for symbolic manipulation of formal language models. The code comes with a BSD-style license so you can basically do with it whatever you want.

Repository: git clone https://github.com/golems/motion-grammar-kit


 

Contents

  1. Download
  2. The MOTION-GRAMMAR-KIT dictionary
    1. dfa-eq
    2. dfa-p
    3. fa->regex
    4. fa->right-regular-grammar
    5. fa-canonicalize
    6. fa-complement
    7. fa-dot
    8. fa-empty-p
    9. fa-equiv
    10. fa-intersection
    11. fa-union
    12. fa-universal-p
    13. finite-automaton
    14. grammar->cnf
    15. grammar->fa
    16. grammar->pda
    17. grammar->right-regular
    18. grammar-remove-useless
    19. make-empty-fa
    20. make-fa
    21. make-pda
    22. make-universal-fa
    23. nfa->dfa
    24. pda-dot
    25. pda-fa-intersection
    26. pda-reachability-automaton
    27. pushdown-automaton
    28. regex->dfa
    29. regex->nfa
    30. regex-sweeten
  3. Acknowledgements

 

Download

MOTION-GRAMMAR-KIT together with this documentation can be downloaded from http://github.com/golems/motion-grammar-kit. Detailed install instructions are included with the source.
 

The MOTION-GRAMMAR-KIT dictionary


[Function]
dfa-eq a bresult

Check equivalence up to state names of DFAs


[Function]
dfa-p faresult

True if FA is deterministic


[Function]
fa->regex faresult

Convert FA to a regular expression.


[Function]
fa->right-regular-grammar faresult

Convert FA to a right-regular grammar.


[Function]
fa-canonicalize faresult

Return a canonical representation of FA. Minimize the state of FA and rename state variables.


[Function]
fa-complement fa &optional terminalsresult

Return the complement of FA. This is the finite-automaton that accepts all strings NOT in FA.


[Function]
fa-dot fa &key output font-size accept-shaperesult

Generate Graphviz output for FA. FA: finite automaton. OUTPUT: output file, type determined by suffix (png,pdf,eps).


[Function]
fa-empty-p faresult

Does FA include no strings?


[Function]
fa-equiv a bresult

Check if two FAs recognize the same language.


[Function]
fa-intersection fa1 fa2result

Intersection of FA1 and FA2


[Function]
fa-union fa1 fa2 &optional uniqueresult

Union of finite automata FA1 and FA2.


[Function]
fa-universal-p fa &optional terminalsresult

Does FA recognize all strings over TERMINALS?


[Standard class]
finite-automaton

A Finite Automaton.


[Function]
grammar->cnf grammarresult

Convert grammar to Chomsky Normal Form


[Function]
grammar->fa grammar &key acceptresult

Convert grammar to a finite automata. GRAMMAR: a right regular grammar (or something close to right regular) RESULT: a finite automaton


[Function]
grammar->pda grammarresult

Convert GRAMMAR to a PDA.


[Function]
grammar->right-regular grammarresult

Attempt to convert this grammar to right-regular form. Please note that this operation is not always possible.


[Function]
grammar-remove-useless grammar &optional terminals nonterminalsresult

Remove 'useless' symbols from GRAMMAR.


[Function]
make-empty-fa terminalsresult

Create an FA including no strings.


[Function]
make-fa edges start acceptresult

Create a finite-automaton. EDGES: List of edges, each (list state-0 terminal state-1). START: The automaton start state. ACCEPT: Set of automaton accept states.


[Function]
make-pda edges start acceptresult

Make a pushdown automaton.


[Function]
make-universal-fa terminalsresult

Create an FA recognizing all strings over TERMINALS.


[Function]
nfa->dfa nfaresult

Convert an NFA to a DFA


[Function]
pda-dot pda &key output font-sizeresult

Generate Graphviz output for PDA.


[Function]
pda-fa-intersection pda fa &optional gensymresult

Compute the intersection of PDA and DFA. RESULT: a pda


[Function]
pda-reachability-automaton pdaresult

Compute the reachability automaton for the PDA. This is an FA with the same control states as PDA and whose language defines the set of all stack contents possible at each control state.


[Standard class]
pushdown-automaton

A Pushdown Automaton.


[Function]
regex->dfa regexresult

Convert a regular expression to a DFA.


[Function]
regex->nfa regexresult

Convert a regular expression to an NFA.


[Function]
regex-sweeten regex terminals &key concatenate-stringsresult

Apply some syntactic sugar to REGEX. Supports the following operators: :complement : match complement :not : any symbol except this :+ : A A* :. : match anything REGEX: An extended regular expression. TERMINALS: Set of all terminal symbols in the language.

 

Acknowledgements

This documentation was prepared with DOCUMENTATION-TEMPLATE.