python: add bindings for bdd_to_formula()

Follow-up to an email from Ayrat Khalimov.

* python/spot/impl.i: Include twa/formula2bdd.hh.
* python/spot/__init__.py: Make the dictionnary
optional.
* spot/twa/formula2bdd.cc: Throw an exception instead of asserting.
* tests/python/bdditer.py: New file.
* tests/Makefile.am: Add it.
* NEWS: Update.
This commit is contained in:
Alexandre Duret-Lutz 2017-03-08 15:18:49 +01:00
parent df44616dfd
commit 4e9303e380
6 changed files with 78 additions and 3 deletions

View file

@ -891,6 +891,9 @@ def parse_word(word, dic=_bdd_dict):
from spot.impl import parse_word as pw
return pw(word, dic)
def bdd_to_formula(b, dic=_bdd_dict):
from spot.impl import bdd_to_formula as bf
return bf(b, dic)
def language_containment_checker(dic=_bdd_dict):
from spot.impl import language_containment_checker as c

View file

@ -108,6 +108,7 @@
#include <spot/tl/relabel.hh>
#include <spot/twa/bddprint.hh>
#include <spot/twa/formula2bdd.hh>
#include <spot/twa/fwd.hh>
#include <spot/twa/acc.hh>
#include <spot/twa/twa.hh>
@ -429,6 +430,7 @@ namespace std {
/* these must come before apcollect.hh */
%include <spot/twa/bdddict.hh>
%include <spot/twa/bddprint.hh>
%include <spot/twa/formula2bdd.hh>
%include <spot/twa/fwd.hh>
%implicitconv spot::acc_cond::mark_t;
%implicitconv spot::acc_cond::acc_code;