expansions: draft

This commit is contained in:
Antoine Martin 2022-11-30 15:28:49 +01:00
parent bbb0c69911
commit ad3896e7a3
6 changed files with 495 additions and 0 deletions

View file

@ -69,6 +69,7 @@ check_PROGRAMS = \
core/cube \
core/emptchk \
core/equals \
core/expand \
core/graph \
core/kind \
core/length \
@ -111,6 +112,7 @@ core_bricks_SOURCES = core/bricks.cc
core_checkpsl_SOURCES = core/checkpsl.cc
core_checkta_SOURCES = core/checkta.cc
core_emptchk_SOURCES = core/emptchk.cc
core_expand_SOURCES = core/expand.cc
core_graph_SOURCES = core/graph.cc
core_ikwiad_SOURCES = core/ikwiad.cc
core_intvcomp_SOURCES = core/intvcomp.cc

25
tests/core/expand.cc Normal file
View file

@ -0,0 +1,25 @@
#include "config.h"
#include <spot/tl/expansions.hh>
#include <spot/tl/parse.hh>
#include <spot/twa/formula2bdd.hh>
#include <iostream>
int main(int argc, char** argv)
{
if (argc != 2)
return 1;
spot::formula f = spot::parse_infix_sere(argv[1]).f;
auto d = spot::make_bdd_dict();
auto m = spot::expansion(f, d, nullptr);
for (const auto& [bdd_l, form] : m)
std::cout << '[' << bdd_to_formula(bdd_l, d) << ']' << ": " << form << std::endl;
std::cout << "formula: " << expansion_to_formula(m, d) << std::endl;
d->unregister_all_my_variables(nullptr);
return 0;
}