spot  1.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Typedefs | Functions
Input/Output of LTL formulae

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. More...
 
class  spot::ltl::random_boolean
 Generate random Boolean formulae. More...
 
class  spot::ltl::random_sere
 Generate random SERE. More...
 
class  spot::ltl::random_psl
 Generate random PSL formulae. More...
 

Typedefs

typedef std::pair< std::string,
std::string > 
spot::eltl::spair
 
typedef std::pair
< spot::location, spair > 
spot::eltl::parse_error
 A parse diagnostic <location, <file, message>>. More...
 
typedef std::list< parse_error > spot::eltl::parse_error_list
 A list of parser diagnostics, as filled by parse. More...
 
typedef std::pair< location,
std::string > 
spot::ltl::parse_error
 A parse diagnostic with its location. More...
 
typedef std::list< parse_error > spot::ltl::parse_error_list
 A list of parser diagnostics, as filled by parse. More...
 

Functions

SPOT_API 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. More...
 
SPOT_API 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. More...
 
SPOT_API bool spot::eltl::format_parse_errors (std::ostream &os, parse_error_list &error_list)
 Format diagnostics produced by spot::eltl::parse. More...
 
SPOT_API const formula * spot::ltl::parse (const std::string &ltl_string, parse_error_list &error_list, environment &env=default_environment::instance(), bool debug=false, bool lenient=false)
 Build a formula from an LTL string. More...
 
SPOT_API const formula * spot::ltl::parse_boolean (const std::string &ltl_string, parse_error_list &error_list, environment &env=default_environment::instance(), bool debug=false, bool lenient=false)
 Build a Boolean formula from a string. More...
 
SPOT_API const formula * spot::ltl::parse_lbt (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 in LBT's format. More...
 
SPOT_API const formula * spot::ltl::parse_sere (const std::string &sere_string, parse_error_list &error_list, environment &env=default_environment::instance(), bool debug=false, bool lenient=false)
 Build a formula from a string representing a SERE. More...
 
SPOT_API 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. More...
 
SPOT_API void spot::ltl::fix_utf8_locations (const std::string &input_string, parse_error_list &error_list)
 Fix location of diagnostics assuming the input is utf8. More...
 
SPOT_API std::ostream & spot::ltl::dotty (std::ostream &os, const formula *f)
 Write a formula tree using dot's syntax. More...
 
SPOT_API std::ostream & spot::ltl::dump (std::ostream &os, const formula *f)
 Dump a formula tree. More...
 
SPOT_API std::ostream & spot::ltl::to_lbt_string (const formula *f, std::ostream &os)
 Output an LTL formula as a string in LBT's format. More...
 
SPOT_API std::string spot::ltl::to_lbt_string (const formula *f)
 Output an LTL formula as a string in LBT's format. More...
 
SPOT_API 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). More...
 
SPOT_API 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). More...
 
SPOT_API 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). More...
 
SPOT_API 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). More...
 
SPOT_API std::ostream & spot::ltl::to_spin_string (const formula *f, std::ostream &os, bool full_parent=false)
 Output a formula as a string parsable by Spin. More...
 
SPOT_API std::string spot::ltl::to_spin_string (const formula *f, bool full_parent=false)
 Convert a formula into a string parsable by Spin. More...
 
SPOT_API std::ostream & spot::ltl::to_wring_string (const formula *f, std::ostream &os)
 Output a formula as a string parsable by Wring. More...
 
SPOT_API std::string spot::ltl::to_wring_string (const formula *f)
 Convert a formula into a string parsable by Wring. More...
 
SPOT_API std::ostream & spot::ltl::to_latex_string (const formula *f, std::ostream &os, bool full_parent=false, bool ratexp=false)
 Output a formula as an LaTeX string which is parsable unless the formula contains automaton operators (used in ELTL formulae). More...
 
SPOT_API std::string spot::ltl::to_latex_string (const formula *f, bool full_parent=false, bool ratexp=false)
 Output a formula as a LaTeX string which is parsable unless the formula contains automaton operators (used in ELTL formulae). More...
 

Detailed Description

Typedef Documentation

typedef std::pair<location, std::string> spot::ltl::parse_error

A parse diagnostic with its location.

typedef std::pair<spot::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.

Function Documentation

SPOT_API std::ostream& spot::ltl::dotty ( std::ostream &  os,
const formula *  f 
)

Write a formula tree using dot's syntax.

Parameters
osThe stream where it should be output.
fThe formula to translate.

dot is part of the GraphViz package http://www.research.att.com/sw/tools/graphviz/

SPOT_API std::ostream& spot::ltl::dump ( std::ostream &  os,
const formula *  f 
)

Dump a formula tree.

Parameters
osThe stream where it should be output.
fThe formula to dump.

This is useful to display a formula when debugging.

SPOT_API void spot::ltl::fix_utf8_locations ( const std::string &  input_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.

Parameters
input_stringThe string that were parsed.
error_listThe error list filled by spot::ltl::parse or spot::ltl::parse_sere while parsing input_string.
SPOT_API bool spot::eltl::format_parse_errors ( std::ostream &  os,
parse_error_list &  error_list 
)

Format diagnostics produced by spot::eltl::parse.

Parameters
osWhere diagnostics should be output.
error_listThe error list filled by spot::eltl::parse while parsing eltl_string.
Returns
true iff any diagnostic was output.
SPOT_API 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.

Parameters
osWhere diagnostics should be output.
input_stringThe string that were parsed.
error_listThe error list filled by spot::ltl::parse or spot::ltl::parse_sere while parsing input_string.
Returns
true iff any diagnostic was output.
SPOT_API const formula* spot::ltl::parse ( const std::string &  ltl_string,
parse_error_list &  error_list,
environment &  env = default_environment::instance(),
bool  debug = false,
bool  lenient = false 
)

Build a formula from an LTL string.

Parameters
ltl_stringThe string to parse.
error_listA list that will be filled with parse errors that occured during parsing.
envThe environment into which parsing should take place.
debugWhen true, causes the parser to trace its execution.
lenientWhen true, parenthesized blocks that cannot be parsed as subformulas will be considered as atomic propositions.
Returns
A pointer to the formula built from ltl_string, or 0 if the input was unparsable.

Note that the parser usually tries to recover from errors. It can return a 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.

Warning
This function is not reentrant.
SPOT_API const formula* spot::ltl::parse_boolean ( const std::string &  ltl_string,
parse_error_list &  error_list,
environment &  env = default_environment::instance(),
bool  debug = false,
bool  lenient = false 
)

Build a Boolean formula from a string.

Parameters
ltl_stringThe string to parse.
error_listA list that will be filled with parse errors that occured during parsing.
envThe environment into which parsing should take place.
debugWhen true, causes the parser to trace its execution.
lenientWhen true, parenthesized blocks that cannot be parsed as subformulas will be considered as atomic propositions.
Returns
A pointer to the formula built from ltl_string, or 0 if the input was unparsable.

Note that the parser usually tries to recover from errors. It can return a 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.

Warning
This function is not reentrant.
SPOT_API 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.

Parameters
filenameThe name of the file to parse.
error_listA list that will be filled with parse errors that occured during parsing.
envThe environment into which parsing should take place.
debugWhen true, causes the parser to trace its execution.
Returns
A pointer to the tgba built from filename, or 0 if the file could not be opened.
Warning
This function is not reentrant.
SPOT_API const formula* spot::ltl::parse_lbt ( 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 in LBT's format.

Parameters
ltl_stringThe string to parse.
error_listA list that will be filled with parse errors that occured during parsing.
envThe environment into which parsing should take place.
debugWhen true, causes the parser to trace its execution.
Returns
A pointer to the formula built from ltl_string, or 0 if the input was unparsable.

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.

The LBT syntax, also used by the lbtt and scheck tools, is extended to support W, and M operators (as done in lbtt), and double-quoted atomic propositions that do not start with 'p'.

Warning
This function is not reentrant.
SPOT_API const formula* spot::ltl::parse_sere ( const std::string &  sere_string,
parse_error_list &  error_list,
environment &  env = default_environment::instance(),
bool  debug = false,
bool  lenient = false 
)

Build a formula from a string representing a SERE.

Parameters
sere_stringThe string to parse.
error_listA list that will be filled with parse errors that occured during parsing.
envThe environment into which parsing should take place.
debugWhen true, causes the parser to trace its execution.
lenientWhen true, parenthesized blocks that cannot be parsed as subformulas will be considered as atomic propositions.
Returns
A pointer to the formula built from sere_string, or 0 if the input was unparsable.

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.

Warning
This function is not reentrant.
SPOT_API 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.

Parameters
eltl_stringThe string to parse.
error_listA list that will be filled with parse errors that occured during parsing.
envThe environment into which parsing should take place.
debugWhen true, causes the parser to trace its execution.
Returns
A pointer to the formula built from eltl_string, or 0 if the input was unparsable.
Warning
This function is not reentrant.
SPOT_API std::ostream& spot::ltl::to_latex_string ( const formula *  f,
std::ostream &  os,
bool  full_parent = false,
bool  ratexp = false 
)

Output a formula as an LaTeX string which is parsable unless the formula contains automaton operators (used in ELTL formulae).

Parameters
fThe formula to translate.
osThe stream where it should be output.
full_parentWhether or not the string should by fully parenthesized.
ratexpWhether we are printing a SERE.
SPOT_API std::string spot::ltl::to_latex_string ( const formula *  f,
bool  full_parent = false,
bool  ratexp = false 
)

Output a formula as a LaTeX string which is parsable unless the formula contains automaton operators (used in ELTL formulae).

Parameters
fThe formula to translate.
full_parentWhether or not the string should by fully parenthesized.
ratexpWhether we are printing a SERE.
SPOT_API std::ostream& spot::ltl::to_lbt_string ( const formula *  f,
std::ostream &  os 
)

Output an LTL formula as a string in LBT's format.

The formula must be an LTL formula (ELTL and PSL operators are not supported). The M and W operator will be output as-is, because this is accepted by LBTT, however if you plan to use the output with other tools, you should probably rewrite these two operators using unabbreviate_wm().

Parameters
fThe formula to translate.
osThe stream where it should be output.
SPOT_API std::string spot::ltl::to_lbt_string ( const formula *  f)

Output an LTL formula as a string in LBT's format.

The formula must be an LTL formula (ELTL and PSL operators are not supported). The M and W operator will be output as-is, because this is accepted by LBTT, however if you plan to use the output with other tools, you should probably rewrite these two operators using unabbreviate_wm().

Parameters
fThe formula to translate.
SPOT_API std::ostream& spot::ltl::to_spin_string ( const formula *  f,
std::ostream &  os,
bool  full_parent = false 
)

Output a formula as a string parsable by Spin.

Parameters
fThe formula to translate.
osThe stream where it should be output.
full_parentWhether or not the string should by fully parenthesized.
SPOT_API std::string spot::ltl::to_spin_string ( const formula *  f,
bool  full_parent = false 
)

Convert a formula into a string parsable by Spin.

Parameters
fThe formula to translate.
full_parentWhether or not the string should by fully parenthesized.
SPOT_API 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).

Parameters
fThe formula to translate.
osThe stream where it should be output.
full_parentWhether or not the string should by fully parenthesized.
ratexpWhether we are printing a SERE.
SPOT_API 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).

Parameters
fThe formula to translate.
full_parentWhether or not the string should by fully parenthesized.
ratexpWhether we are printing a SERE.
SPOT_API 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).

Parameters
fThe formula to translate.
osThe stream where it should be output.
full_parentWhether or not the string should by fully parenthesized.
ratexpWhether we are printing a SERE.
SPOT_API 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).

Parameters
fThe formula to translate.
full_parentWhether or not the string should by fully parenthesized.
ratexpWhether we are printing a SERE.
SPOT_API std::ostream& spot::ltl::to_wring_string ( const formula *  f,
std::ostream &  os 
)

Output a formula as a string parsable by Wring.

Parameters
fThe formula to translate.
osThe stream where it should be output.
SPOT_API std::string spot::ltl::to_wring_string ( const formula *  f)

Convert a formula into a string parsable by Wring.

Parameters
fThe formula to translate.

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Sat Dec 6 2014 12:28:44 for spot by doxygen 1.8.4