diff --git a/python/spot/__init__.py b/python/spot/__init__.py index 01210c824..edbf4a4e6 100644 --- a/python/spot/__init__.py +++ b/python/spot/__init__.py @@ -104,19 +104,22 @@ def setup(**kwargs): os.environ['SPOT_DOTDEFAULT'] = d -# In version 3.0.2, Swig puts strongly typed enum in the main -# namespace without prefixing them. Latter versions fix this. So we -# can remove for following hack once 3.0.2 is no longer used in our -# build farm. -if 'op_ff' not in globals(): +# Swig versions prior to 4.1.0 export formula.X as formula_X as well, +# for all operators. Swig 4.1.0 stops doing this, breaking some +# existing code. +if 'formula_ff' not in globals(): for i in ('ff', 'tt', 'eword', 'ap', 'Not', 'X', 'F', 'G', 'Closure', 'NegClosure', 'NegClosureMarked', 'Xor', 'Implies', 'Equiv', 'U', 'R', 'W', 'M', 'EConcat', 'EConcatMarked', 'UConcat', 'Or', 'OrRat', 'And', 'AndRat', 'AndNLM', 'Concat', - 'Fusion', 'Star', 'FStar'): - globals()['op_' + i] = globals()[i] - del globals()[i] + 'Fusion', 'Star', 'FStar', 'nested_unop_range', + 'sugar_goto', 'sugar_equal', 'sugar_delay', 'unop', + 'binop', 'bunop', 'multop', 'first_match', 'unbounded'): + globals()['formula_' + i] = formula.__dict__[i].__func__ +if 'trival_maybe' not in globals(): + for i in ('maybe',): + globals()['trival_' + i] = trival.__dict__[i].__func__ # Global BDD dict so that we do not have to create one in user code. diff --git a/spot/twa/acc.hh b/spot/twa/acc.hh index 905f5c40a..1c460cfc4 100644 --- a/spot/twa/acc.hh +++ b/spot/twa/acc.hh @@ -1011,6 +1011,7 @@ namespace spot return res; } +#ifndef SWIG /// \brief Conjunct the current condition with \a r. acc_code operator&(acc_code&& r) const { @@ -1018,6 +1019,7 @@ namespace spot res &= r; return res; } +#endif // SWIG /// \brief Disjunct the current condition in place with \a r. acc_code& operator|=(const acc_code& r) @@ -1106,6 +1108,7 @@ namespace spot return *this; } +#ifndef SWIG /// \brief Disjunct the current condition with \a r. acc_code operator|(acc_code&& r) const { @@ -1113,6 +1116,7 @@ namespace spot res |= r; return res; } +#endif // SWIG /// \brief Disjunct the current condition with \a r. acc_code operator|(const acc_code& r) const diff --git a/tests/python/_synthesis.ipynb b/tests/python/_synthesis.ipynb index 4c203a86e..2d92236b7 100644 --- a/tests/python/_synthesis.ipynb +++ b/tests/python/_synthesis.ipynb @@ -6346,7 +6346,7 @@ "\n" ], "text/plain": [ - " >" + " *' at 0x7fbccc33adb0> >" ] }, "execution_count": 28, diff --git a/tests/python/ipnbdoctest.py b/tests/python/ipnbdoctest.py index f6ce3562e..47b73f901 100755 --- a/tests/python/ipnbdoctest.py +++ b/tests/python/ipnbdoctest.py @@ -101,6 +101,11 @@ def canonicalize(s, type, ignores): # %%file writes `Writing`, or `Overwriting` if the file exists. s = re.sub(r'^Overwriting ', 'Writing ', s) + # Swig 4.1.0 fixed an ordering issue with how types are printed. + # aig_ptr is expected to be printed as shared_ptr, but prior + # Swig version did not do that. + s = re.sub(r'spot::aig_ptr ', 'std::shared_ptr< spot::aig > ', s) + # SVG generated by graphviz may put note at different positions # depending on the graphviz build. Let's just strip anything that # look like a position. diff --git a/tests/python/synthesis.ipynb b/tests/python/synthesis.ipynb index 54da20ef7..ba1b562cc 100644 --- a/tests/python/synthesis.ipynb +++ b/tests/python/synthesis.ipynb @@ -2601,7 +2601,7 @@ "\n" ], "text/plain": [ - " >" + " *' at 0x7f0e584deae0> >" ] }, "metadata": {}, @@ -3256,7 +3256,7 @@ "\n" ], "text/plain": [ - " >" + " *' at 0x7f0e5855c9f0> >" ] }, "metadata": {}, @@ -3385,7 +3385,7 @@ "\n" ], "text/plain": [ - " >" + " *' at 0x7f0e5855c900> >" ] }, "metadata": {}, @@ -3801,7 +3801,7 @@ "\n" ], "text/plain": [ - " >" + " *' at 0x7f0e584def00> >" ] }, "metadata": {}, @@ -3979,7 +3979,7 @@ "\n" ], "text/plain": [ - " >" + " *' at 0x7f0e5855c930> >" ] }, "metadata": {}, @@ -4159,7 +4159,7 @@ "\n" ], "text/plain": [ - " >" + " *' at 0x7f0e584def90> >" ] }, "metadata": {},