# -*- coding: utf-8 -*-
#+TITLE: =autwords=
#+DESCRIPTION: Spot command-line tool for enumerating accepted lasso-shaped words of ω-automata.
#+INCLUDE: setup.org
#+HTML_LINK_UP: tools.html
#+PROPERTY: header-args:sh :results verbatim :exports both

=autwords= enumerates all lasso-shaped words accepted by an
ω-automaton.  A lasso-shaped word is represented as a finite stem
followed by a finite cycle repeated infinitely, and is written as
=STEM;cycle{CYCLE}=.

The lengths of the stem and the cycle can be bounded using the
=--stem=RANGE= and =--cycle=RANGE= options (default: =0..= and
=1..=), and the number of words can be limited with
=--max-count=N= (or =-n N=).  The =--count= (or =-c=) option
outputs only the number of found words.

* Examples

The following command generates a Büchi automaton for =GFa & GFb=,
and enumerates the first three lasso-shaped accepted words:

#+BEGIN_SRC sh
ltl2tgba 'GFa & FGb' | autwords -n 3
#+END_SRC

#+RESULTS:
: a & b; cycle{a & b}
: a & b; cycle{!a & b; a & b}
: a & b; cycle{a & b; !a & b}

The next command counts the number of words that have a step of size 1
and a cycle size of at most 2.

#+BEGIN_SRC sh
ltl2tgba 'GFa & GFb' | autwords --stem=1 --cycle=1..2 -c
#+END_SRC

#+RESULTS:
: 40

If the automaton has an empty language, =autwords= silently exits with
status 1:

#+BEGIN_SRC sh
ltl2tgba 'GFa & G!a' | autwords; echo "exit: $?"
#+END_SRC

#+RESULTS:
: exit: 1

#  LocalWords:  utf autwords html args lasso LTL SRC GFa GFb
