adjust to Swig 4.1.0
* python/spot/__init__.py: Add flatnested versions of some static methods. * spot/twa/acc.hh: Hide && version of & and |, causing trouble to swig. * tests/python/_synthesis.ipynb, tests/python/synthesis.ipynb: Upgrade expected type names. * tests/python/ipnbdoctest.py: Adjust for difference between 4.0 and 4.1.
This commit is contained in:
parent
6dc740184c
commit
b36cee06a1
5 changed files with 27 additions and 15 deletions
|
|
@ -104,19 +104,22 @@ def setup(**kwargs):
|
||||||
os.environ['SPOT_DOTDEFAULT'] = d
|
os.environ['SPOT_DOTDEFAULT'] = d
|
||||||
|
|
||||||
|
|
||||||
# In version 3.0.2, Swig puts strongly typed enum in the main
|
# Swig versions prior to 4.1.0 export formula.X as formula_X as well,
|
||||||
# namespace without prefixing them. Latter versions fix this. So we
|
# for all operators. Swig 4.1.0 stops doing this, breaking some
|
||||||
# can remove for following hack once 3.0.2 is no longer used in our
|
# existing code.
|
||||||
# build farm.
|
if 'formula_ff' not in globals():
|
||||||
if 'op_ff' not in globals():
|
|
||||||
for i in ('ff', 'tt', 'eword', 'ap', 'Not', 'X', 'F', 'G',
|
for i in ('ff', 'tt', 'eword', 'ap', 'Not', 'X', 'F', 'G',
|
||||||
'Closure', 'NegClosure', 'NegClosureMarked',
|
'Closure', 'NegClosure', 'NegClosureMarked',
|
||||||
'Xor', 'Implies', 'Equiv', 'U', 'R', 'W', 'M',
|
'Xor', 'Implies', 'Equiv', 'U', 'R', 'W', 'M',
|
||||||
'EConcat', 'EConcatMarked', 'UConcat', 'Or',
|
'EConcat', 'EConcatMarked', 'UConcat', 'Or',
|
||||||
'OrRat', 'And', 'AndRat', 'AndNLM', 'Concat',
|
'OrRat', 'And', 'AndRat', 'AndNLM', 'Concat',
|
||||||
'Fusion', 'Star', 'FStar'):
|
'Fusion', 'Star', 'FStar', 'nested_unop_range',
|
||||||
globals()['op_' + i] = globals()[i]
|
'sugar_goto', 'sugar_equal', 'sugar_delay', 'unop',
|
||||||
del globals()[i]
|
'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.
|
# Global BDD dict so that we do not have to create one in user code.
|
||||||
|
|
|
||||||
|
|
@ -1011,6 +1011,7 @@ namespace spot
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef SWIG
|
||||||
/// \brief Conjunct the current condition with \a r.
|
/// \brief Conjunct the current condition with \a r.
|
||||||
acc_code operator&(acc_code&& r) const
|
acc_code operator&(acc_code&& r) const
|
||||||
{
|
{
|
||||||
|
|
@ -1018,6 +1019,7 @@ namespace spot
|
||||||
res &= r;
|
res &= r;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
#endif // SWIG
|
||||||
|
|
||||||
/// \brief Disjunct the current condition in place with \a r.
|
/// \brief Disjunct the current condition in place with \a r.
|
||||||
acc_code& operator|=(const acc_code& r)
|
acc_code& operator|=(const acc_code& r)
|
||||||
|
|
@ -1106,6 +1108,7 @@ namespace spot
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef SWIG
|
||||||
/// \brief Disjunct the current condition with \a r.
|
/// \brief Disjunct the current condition with \a r.
|
||||||
acc_code operator|(acc_code&& r) const
|
acc_code operator|(acc_code&& r) const
|
||||||
{
|
{
|
||||||
|
|
@ -1113,6 +1116,7 @@ namespace spot
|
||||||
res |= r;
|
res |= r;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
#endif // SWIG
|
||||||
|
|
||||||
/// \brief Disjunct the current condition with \a r.
|
/// \brief Disjunct the current condition with \a r.
|
||||||
acc_code operator|(const acc_code& r) const
|
acc_code operator|(const acc_code& r) const
|
||||||
|
|
|
||||||
|
|
@ -6346,7 +6346,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.aig; proxy of <Swig Object of type 'spot::aig_ptr *' at 0x7fbccc33adb0> >"
|
"<spot.aig; proxy of <Swig Object of type 'std::shared_ptr< spot::aig > *' at 0x7fbccc33adb0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 28,
|
"execution_count": 28,
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,11 @@ def canonicalize(s, type, ignores):
|
||||||
# %%file writes `Writing`, or `Overwriting` if the file exists.
|
# %%file writes `Writing`, or `Overwriting` if the file exists.
|
||||||
s = re.sub(r'^Overwriting ', 'Writing ', s)
|
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<aig>, 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
|
# SVG generated by graphviz may put note at different positions
|
||||||
# depending on the graphviz build. Let's just strip anything that
|
# depending on the graphviz build. Let's just strip anything that
|
||||||
# look like a position.
|
# look like a position.
|
||||||
|
|
|
||||||
|
|
@ -2601,7 +2601,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.aig; proxy of <Swig Object of type 'spot::aig_ptr *' at 0x7f0e584deae0> >"
|
"<spot.aig; proxy of <Swig Object of type 'std::shared_ptr< spot::aig > *' at 0x7f0e584deae0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -3256,7 +3256,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.aig; proxy of <Swig Object of type 'spot::aig_ptr *' at 0x7f0e5855c9f0> >"
|
"<spot.aig; proxy of <Swig Object of type 'std::shared_ptr< spot::aig > *' at 0x7f0e5855c9f0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -3385,7 +3385,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.aig; proxy of <Swig Object of type 'spot::aig_ptr *' at 0x7f0e5855c900> >"
|
"<spot.aig; proxy of <Swig Object of type 'std::shared_ptr< spot::aig > *' at 0x7f0e5855c900> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -3801,7 +3801,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.aig; proxy of <Swig Object of type 'spot::aig_ptr *' at 0x7f0e584def00> >"
|
"<spot.aig; proxy of <Swig Object of type 'std::shared_ptr< spot::aig > *' at 0x7f0e584def00> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -3979,7 +3979,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.aig; proxy of <Swig Object of type 'spot::aig_ptr *' at 0x7f0e5855c930> >"
|
"<spot.aig; proxy of <Swig Object of type 'std::shared_ptr< spot::aig > *' at 0x7f0e5855c930> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -4159,7 +4159,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.aig; proxy of <Swig Object of type 'spot::aig_ptr *' at 0x7f0e584def90> >"
|
"<spot.aig; proxy of <Swig Object of type 'std::shared_ptr< spot::aig > *' at 0x7f0e584def90> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue