spot
0.9.1
|
Classes | |
class | spot::ltl::ltl_file |
Read LTL formulae from a file, one by one. More... | |
class | spot::ltl::random_formula |
Base class for random formula generators. More... | |
class | spot::ltl::random_ltl |
Generate random LTL formulae.This class recursively constructs LTL formulae of a given size. The formulae will use the use atomic propositions from the set of propositions passed to the constructor, in addition to the constant and all LTL operators supported by Spot. More... | |
class | spot::ltl::random_boolean |
Generate random Boolean formulae.This class recursively constructs Boolean formulae of a given size. The formulae will use the use atomic propositions from the set of propositions passed to the constructor, in addition to the constant and all Boolean operators supported by Spot. More... | |
class | spot::ltl::random_sere |
Generate random SERE.This class recursively constructs SERE of a given size. The formulae will use the use atomic propositions from the set of propositions passed to the constructor, in addition to the constant and all SERE operators supported by Spot. More... | |
class | spot::ltl::random_psl |
Generate random PSL formulae.This class recursively constructs PSL formulae of a given size. The formulae will use the use atomic propositions from the set of propositions passed to the constructor, in addition to the constant and all PSL operators supported by Spot. More... | |
Typedefs | |
typedef std::pair< std::string, std::string > | spot::eltl::spair |
typedef std::pair < eltlyy::location, spair > | spot::eltl::parse_error |
A parse diagnostic <location, <file, message>>. | |
typedef std::list< parse_error > | spot::eltl::parse_error_list |
A list of parser diagnostics, as filled by parse. | |
typedef std::pair < ltlyy::location, std::string > | spot::ltl::parse_error |
A parse diagnostic with its location. | |
typedef std::list< parse_error > | spot::ltl::parse_error_list |
A list of parser diagnostics, as filled by parse. | |
Functions | |
const formula * | spot::eltl::parse_file (const std::string &filename, parse_error_list &error_list, environment &env=default_environment::instance(), bool debug=false) |
Build a formula from a text file. | |
const formula * | spot::eltl::parse_string (const std::string &eltl_string, parse_error_list &error_list, environment &env=default_environment::instance(), bool debug=false) |
Build a formula from an ELTL string. | |
bool | spot::eltl::format_parse_errors (std::ostream &os, parse_error_list &error_list) |
Format diagnostics produced by spot::eltl::parse. | |
const formula * | spot::ltl::parse (const std::string <l_string, parse_error_list &error_list, environment &env=default_environment::instance(), bool debug=false) |
Build a formula from an LTL string. | |
const formula * | spot::ltl::parse_sere (const std::string &sere_string, parse_error_list &error_list, environment &env=default_environment::instance(), bool debug=false) |
Build a formula from a string representing a SERE. | |
bool | spot::ltl::format_parse_errors (std::ostream &os, const std::string &input_string, const parse_error_list &error_list) |
Format diagnostics produced by spot::ltl::parse or spot::ltl::ratexp. | |
void | spot::ltl::fix_utf8_locations (const std::string <l_string, parse_error_list &error_list) |
Fix location of diagnostics assuming the input is utf8. | |
std::ostream & | spot::ltl::dotty (std::ostream &os, const formula *f) |
Write a formula tree using dot's syntax. | |
std::ostream & | spot::ltl::dump (std::ostream &os, const formula *f) |
Dump a formula tree. | |
std::ostream & | spot::ltl::to_string (const formula *f, std::ostream &os, bool full_parent=false, bool ratexp=false) |
Output a formula as a string which is parsable unless the formula contains automaton operators (used in ELTL formulae). | |
std::string | spot::ltl::to_string (const formula *f, bool full_parent=false, bool ratexp=false) |
Output a formula as a string which is parsable unless the formula contains automaton operators (used in ELTL formulae). | |
std::ostream & | spot::ltl::to_utf8_string (const formula *f, std::ostream &os, bool full_parent=false, bool ratexp=false) |
Output a formula as an utf8 string which is parsable unless the formula contains automaton operators (used in ELTL formulae). | |
std::string | spot::ltl::to_utf8_string (const formula *f, bool full_parent=false, bool ratexp=false) |
Output a formula as an utf8 string which is parsable unless the formula contains automaton operators (used in ELTL formulae). | |
std::ostream & | spot::ltl::to_spin_string (const formula *f, std::ostream &os, bool full_parent=false) |
Output a formula as a (parsable by Spin) string. | |
std::string | spot::ltl::to_spin_string (const formula *f, bool full_parent=false) |
Convert a formula into a (parsable by Spin) string. |
typedef std::pair<ltlyy::location, std::string> spot::ltl::parse_error |
A parse diagnostic with its location.
typedef std::pair<eltlyy::location, spair> spot::eltl::parse_error |
A parse diagnostic <location, <file, message>>.
typedef std::list<parse_error> spot::ltl::parse_error_list |
A list of parser diagnostics, as filled by parse.
typedef std::list<parse_error> spot::eltl::parse_error_list |
A list of parser diagnostics, as filled by parse.
typedef std::pair<std::string, std::string> spot::eltl::spair |
std::ostream& spot::ltl::dotty | ( | std::ostream & | os, |
const formula * | f | ||
) |
Write a formula tree using dot's syntax.
os | The stream where it should be output. |
f | The formula to translate. |
dot
is part of the GraphViz package http://www.research.att.com/sw/tools/graphviz/
std::ostream& spot::ltl::dump | ( | std::ostream & | os, |
const formula * | f | ||
) |
Dump a formula tree.
os | The stream where it should be output. |
f | The formula to dump. |
This is useful to display a formula when debugging.
void spot::ltl::fix_utf8_locations | ( | const std::string & | ltl_string, |
parse_error_list & | error_list | ||
) |
Fix location of diagnostics assuming the input is utf8.
The spot::ltl::parse() and spot::ltl::parse_sere() function return a parse_error_list that contain locations specified at the byte level. Although these parser recognize some utf8 characters they only work byte by byte and will report positions by counting byte.
This function fixes the positions returned by the parser to look correct when the string is interpreted as a utf8-encoded string.
It is invalid to call this function on a string that is not valid utf8.
You should NOT call this function before calling spot::ltl::format_parse_errors() because it is already called inside if needed. You may need this function only if you want to write your own error reporting code.
input_string | The string that were parsed. |
error_list | The error list filled by spot::ltl::parse or spot::ltl::parse_sere while parsing input_string. |
bool spot::eltl::format_parse_errors | ( | std::ostream & | os, |
parse_error_list & | error_list | ||
) |
Format diagnostics produced by spot::eltl::parse.
os | Where diagnostics should be output. |
error_list | The error list filled by spot::eltl::parse while parsing eltl_string. |
true
iff any diagnostic was output. bool spot::ltl::format_parse_errors | ( | std::ostream & | os, |
const std::string & | input_string, | ||
const parse_error_list & | error_list | ||
) |
Format diagnostics produced by spot::ltl::parse or spot::ltl::ratexp.
If the string is utf8 encoded, spot::ltl::fix_utf8_locations() will be used to report correct utf8 locations (assuming the output is utf8 aware). Nonetheless, the supplied error_list will not be modified.
os | Where diagnostics should be output. |
input_string | The string that were parsed. |
error_list | The error list filled by spot::ltl::parse or spot::ltl::parse_sere while parsing input_string. |
true
iff any diagnostic was output. const formula* spot::ltl::parse | ( | const std::string & | ltl_string, |
parse_error_list & | error_list, | ||
environment & | env = default_environment::instance() , |
||
bool | debug = false |
||
) |
Build a formula from an LTL string.
ltl_string | The string to parse. |
error_list | A list that will be filled with parse errors that occured during parsing. |
env | The environment into which parsing should take place. |
debug | When true, causes the parser to trace its execution. |
Note that the parser usually tries to recover from errors. It can return an non zero value even if it encountered error during the parsing of ltl_string. If you want to make sure ltl_string was parsed succesfully, check error_list for emptiness.
const formula* spot::eltl::parse_file | ( | const std::string & | filename, |
parse_error_list & | error_list, | ||
environment & | env = default_environment::instance() , |
||
bool | debug = false |
||
) |
Build a formula from a text file.
filename | The name of the file to parse. |
error_list | A list that will be filled with parse errors that occured during parsing. |
env | The environment into which parsing should take place. |
debug | When true, causes the parser to trace its execution. |
const formula* spot::ltl::parse_sere | ( | const std::string & | sere_string, |
parse_error_list & | error_list, | ||
environment & | env = default_environment::instance() , |
||
bool | debug = false |
||
) |
Build a formula from a string representing a SERE.
sere_string | The string to parse. |
error_list | A list that will be filled with parse errors that occured during parsing. |
env | The environment into which parsing should take place. |
debug | When true, causes the parser to trace its execution. |
Note that the parser usually tries to recover from errors. It can return an non zero value even if it encountered error during the parsing of ltl_string. If you want to make sure ltl_string was parsed succesfully, check error_list for emptiness.
const formula* spot::eltl::parse_string | ( | const std::string & | eltl_string, |
parse_error_list & | error_list, | ||
environment & | env = default_environment::instance() , |
||
bool | debug = false |
||
) |
Build a formula from an ELTL string.
eltl_string | The string to parse. |
error_list | A list that will be filled with parse errors that occured during parsing. |
env | The environment into which parsing should take place. |
debug | When true, causes the parser to trace its execution. |
std::ostream& spot::ltl::to_spin_string | ( | const formula * | f, |
std::ostream & | os, | ||
bool | full_parent = false |
||
) |
Output a formula as a (parsable by Spin) string.
f | The formula to translate. |
os | The stream where it should be output. |
full_parent | Whether or not the string should by fully parenthesized. |
std::string spot::ltl::to_spin_string | ( | const formula * | f, |
bool | full_parent = false |
||
) |
Convert a formula into a (parsable by Spin) string.
f | The formula to translate. |
full_parent | Whether or not the string should by fully parenthesized. |
std::ostream& spot::ltl::to_string | ( | const formula * | f, |
std::ostream & | os, | ||
bool | full_parent = false , |
||
bool | ratexp = false |
||
) |
Output a formula as a string which is parsable unless the formula contains automaton operators (used in ELTL formulae).
f | The formula to translate. |
os | The stream where it should be output. |
full_parent | Whether or not the string should by fully parenthesized. |
ratexp | Whether we are printing a SERE. |
std::string spot::ltl::to_string | ( | const formula * | f, |
bool | full_parent = false , |
||
bool | ratexp = false |
||
) |
Output a formula as a string which is parsable unless the formula contains automaton operators (used in ELTL formulae).
f | The formula to translate. |
full_parent | Whether or not the string should by fully parenthesized. |
ratexp | Whether we are printing a SERE. |
std::ostream& spot::ltl::to_utf8_string | ( | const formula * | f, |
std::ostream & | os, | ||
bool | full_parent = false , |
||
bool | ratexp = false |
||
) |
Output a formula as an utf8 string which is parsable unless the formula contains automaton operators (used in ELTL formulae).
f | The formula to translate. |
os | The stream where it should be output. |
full_parent | Whether or not the string should by fully parenthesized. |
ratexp | Whether we are printing a SERE. |
Referenced by spot::explicit_conf< graph, state_explicit_formula >::enable_utf8(), and spot::explicit_conf< graph, state_explicit_formula >::to_utf8_string().
std::string spot::ltl::to_utf8_string | ( | const formula * | f, |
bool | full_parent = false , |
||
bool | ratexp = false |
||
) |
Output a formula as an utf8 string which is parsable unless the formula contains automaton operators (used in ELTL formulae).
f | The formula to translate. |
full_parent | Whether or not the string should by fully parenthesized. |
ratexp | Whether we are printing a SERE. |