bin: introduce autcross

Fixes #252.

* NEWS: Mention it.
* bin/autcross.cc, bin/man/autcross.x, doc/org/autcross.org: New
files.
* bin/Makefile.am, bin/man/Makefile.am, doc/org/tools.org,
doc/Makefile.am: Add them.
* bin/autfilt.cc: Use is_universal() instead of is_deterministic().
* bin/common_hoaread.hh, bin/common_trans.cc, bin/common_trans.hh,
bin/ltlcross.cc, bin/ltldo.cc: Factor some bits common between
ltlcross, ltldo and autcross.
* tests/core/autcross.test, tests/core/autcross2.test: New files.
* tests/Makefile.am: Add them.
* tests/core/dra2dba.test, tests/core/sbacc.test,
tests/core/streett.test: Use autcross.
This commit is contained in:
Alexandre Duret-Lutz 2017-07-27 18:42:05 +02:00
parent b9fff6a4b1
commit 0cf250d839
21 changed files with 1726 additions and 53 deletions

View file

@ -28,9 +28,13 @@
#include <spot/twa/twagraph.hh>
extern const struct argp trans_argp;
extern const struct argp trans_argp; // ltlcross, ltldo
extern const struct argp autproc_argp; // autcross
extern bool opt_relabel;
struct shorthands_t;
struct tool_spec
{
// The translator command, as specified on the command-line.
@ -44,7 +48,7 @@ struct tool_spec
// name of the translator (or spec)
const char* name;
tool_spec(const char* spec);
tool_spec(const char* spec, shorthands_t* begin, shorthands_t* end);
tool_spec(const tool_spec& other);
tool_spec& operator=(const tool_spec& other);
~tool_spec();
@ -52,6 +56,9 @@ struct tool_spec
extern std::vector<tool_spec> tools;
void tools_push_trans(const char* trans);
void tools_push_autproc(const char* proc);
struct quoted_string final: public spot::printable_value<std::string>
{
using spot::printable_value<std::string>::operator=;
@ -80,7 +87,25 @@ struct filed_formula final: public spot::printable
private:
const quoted_formula& f_;
unsigned serial_;
std::string string_to_tmp(const std::string str, unsigned n) const;
};
struct filed_automaton final: public spot::printable
{
filed_automaton()
{
}
void print(std::ostream& os, const char* pos) const override;
void new_round(spot::const_twa_graph_ptr aut, unsigned serial)
{
aut_ = aut;
serial_ = serial;
}
private:
spot::const_twa_graph_ptr aut_;
unsigned serial_;
};
struct printable_result_filename final:
@ -118,6 +143,23 @@ public:
};
class autproc_runner: protected spot::formater
{
protected:
// Round-specific variables
filed_automaton filename_automaton;
// Run-specific variables
printable_result_filename output;
public:
using spot::formater::has;
autproc_runner(// whether we accept the absence of output
// specifier
bool no_output_allowed = false);
void round_automaton(spot::const_twa_graph_ptr aut, unsigned serial);
};
// Disable handling of timeout on systems that miss kill() or alarm().
// For instance MinGW.
#if HAVE_KILL && HAVE_ALARM