prophesy package

Subpackages

Utility methods

prophesy.util module

class prophesy.util.Configuration(config_file)[source]

Bases: object

Configuration for prophesy.

check_existence(section, key)[source]

Check if the given key exists in the configuration and raise a ConfigurationError if not. :param section: Section. :param key: Key.

get(section, key)[source]

Get config value for given key. :param section: Section. :param key: Key. :return: Config value.

get_all()[source]

Get all entries of the configuration. :return: Dict with all entries.

get_boolean(section, key)[source]

Get config value as boolean. :param section: Section. :param key: Key. :return: Config value as boolean.

get_float(section, key)[source]

Get config value as float. :param section: Section. :param key: Key. :return: Config value as float.

get_int(section, key)[source]

Get config value as integer. :param section: Section. :param key: Key. :return: Config value as integer.

set(section, key, value)[source]

Set config entry. :param section: Section. :param key: Key. :param value: New value.

update_configuration_file()[source]

Write configuration file again.

prophesy.util.check_filepath_for_reading(filepath, filedescription_string='file')[source]

Check if the given path can be read. Raises an IOError otherwise. :param filepath: Path. :param filedescription_string: Type of path (file/dir).

prophesy.util.ensure_dir_exists(path)[source]

Check whether the directory exists and create it if not. Raises an IOError if not successful. :param path: Directory path.

prophesy.util.open_file(path)[source]

Open file with system-default application. Works for Mac OS (open) and Linux with xdg-open. :param path: Path.

prophesy.util.run_tool(args, quiet=False, outputfile=None)[source]

Executes a process. :param args: CLI arguments to execute. :param quiet: If false the output is logged. :param outputfile: Path for saving output. :return: Stdout of process or exitcode.

prophesy.util.which(program)[source]

Check if executable exists and return its path. See http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python/377028#377028 :param program: String with name of the program. :return: Path to program or None if not found.

prophesy.util.write_string_to_file(path, string, append=False)[source]

Write string to file. :param path: File where we want to put the string. :param string: New content. :param append: If True, append to file, else overwrite.

prophesy.util.write_string_to_tmpfile(string)[source]

Write string to temporary file. :param string: New content. :return: The path to the temporary file.

prophesy.config module

class prophesy.config.ModulesConfig[source]

Bases: prophesy.util.Configuration

DEPENDENCIES = 'installed_deps'
has_pycarl_parser()[source]
has_stormpy()[source]
is_module_available(module)[source]
class prophesy.config.ProphesyConfig(path_to_cfg)[source]

Bases: prophesy.util.Configuration

CONSTRAINTS = 'constraints'
DIRECTORIES = 'directories'
EXTERNAL_TOOLS = 'external_tools'
SAMPLING = 'sampling'
SMT = 'smt'
check_tools()[source]
getAvailableParametricMCs()[source]
Returns:A set with strings describing the available parametric pmcs.
getAvailableProbMCs()[source]
getAvailableSMTSolvers()[source]
getAvailableSamplers()[source]
getSection(sec)[source]
get_intermediate_dir()[source]
get_isat()[source]
get_param()[source]
get_plots_dir()[source]
get_prism()[source]
get_sampling_epsilon()[source]
get_sampling_min_distance()[source]
get_smt_memout()[source]
get_smt_timeout()[source]
get_storm()[source]
get_storm_pars()[source]
get_tool(toolname)[source]
get_yices()[source]
get_z3()[source]
has_gurobipy()[source]
has_stormpy()[source]
prophesy.config.load_configuration(path=None)[source]