5 #ifndef LYDIASYFT_CLI_BASE_HPP
6 #define LYDIASYFT_CLI_BASE_HPP
10 #include <CLI/CLI.hpp>
11 #include "lydia/types.hpp"
12 #include "lydia/parser/ltlf/driver.hpp"
15 #include "game/InputOutputPartition.h"
16 #include "game/Transducer.h"
17 #include "Stopwatch.h"
18 #include "Synthesizer.h"
19 #include "synthesizer/LTLfMaxSetSynthesizer.h"
27 const bool print_strategy_;
28 const bool print_times_;
34 Printer(
bool print_strategy,
bool print_times, std::ostream &out) :
35 print_strategy_(print_strategy), print_times_(print_times), out_(out) {}
38 dump_transducer_if_enabled(
const Transducer &transducer,
const std::string &output_file =
"strategy.dot")
const;
40 void dump_add_if_enabled(
const std::shared_ptr<VarMgr> &var_mgr,
const CUDD::ADD &add,
41 const std::string &output_file)
const;
46 const std::string &def_strategy_output_file =
"def_strategy.dot",
47 const std::string &nondef_strategy_output_file =
"nondef_strategy.dot")
const;
49 void print_times_if_enabled(
const std::string &message, std::chrono::milliseconds time)
const;
51 void print_realizable()
const { out_ << Syft::REALIZABLE_STR << std::endl; }
53 void print_unrealizable()
const { out_ << Syft::UNREALIZABLE_STR << std::endl; }
58 void add_assumption_file_option(CLI::App *, std::string &);
60 void add_gr1_file_option(CLI::App *, std::string &);
62 void add_env_safety_file_option(CLI::App *, std::optional<std::string> &);
64 void add_agent_safety_file_option(CLI::App *, std::optional<std::string> &);
66 void add_spec_file_option(CLI::App *, std::string &);
68 void add_syfco_option(CLI::App *, std::optional<std::string> &);
70 void add_slugs_option(CLI::App *, std::string &);
77 const std::string formula_file_;
78 const std::string path_to_syfco_;
81 const std::shared_ptr<Syft::VarMgr> var_mgr_;
85 std::shared_ptr<whitemech::lydia::parsers::ltlf::LTLfDriver> driver_;
97 BaseRunner(
const std::shared_ptr<whitemech::lydia::parsers::ltlf::LTLfDriver> &driver,
98 const std::string &formula_file,
const std::string &path_to_syfco,
bool print_strategy,
101 formula_file_(formula_file), path_to_syfco_(path_to_syfco),
102 printer_(print_strategy, print_times, std::cout),
103 args_(parse_tlsf(driver, formula_file, path_to_syfco)),
104 var_mgr_(build_var_mgr(args_.partition)) {}
Base class for running a synthesis algorithm.
Definition: base.hpp:75
A synthesizer for a game whose arena is a symbolic-state DFA.
Definition: DfaGameSynthesizer.h:15
A maxset-synthesizer for a reachability game given as a symbolic-state DFA.
Definition: LTLfMaxSetSynthesizer.h:19
Stopwatch for timing executions.
Definition: Stopwatch.h:11
A DFA with symbolic states and transitions.
Definition: SymbolicStateDfa.h:18
A symbolic tranducer representing a winning strategy for a game.
Definition: Transducer.h:20
Definition: Synthesizer.h:24
Definition: Synthesizer.h:30
Definition: Synthesizer.h:16