Commit 43d54351 by Baruch Sterin

pyabc: deal better with null counter examples and remove special case handling

parent 4aa434ad
...@@ -244,8 +244,6 @@ Abc_Cex_t* _cex_get_vec(int i) ...@@ -244,8 +244,6 @@ Abc_Cex_t* _cex_get_vec(int i)
return NULL; return NULL;
} }
if ( pCex == (Abc_Cex_t *)1 )
return pCex;
return Abc_CexDup( pCex, -1 ); return Abc_CexDup( pCex, -1 );
} }
...@@ -669,6 +667,11 @@ void _set_death_signal(); ...@@ -669,6 +667,11 @@ void _set_death_signal();
class _Cex(object): class _Cex(object):
def __new__(cls, pCex):
if not pCex:
return None
return object.__new__(cls)
def __init__(self, pCex): def __init__(self, pCex):
self.pCex = pCex self.pCex = pCex
...@@ -689,27 +692,12 @@ class _Cex(object): ...@@ -689,27 +692,12 @@ class _Cex(object):
def cex_get_vector(): def cex_get_vector():
res = [] return [ _Cex(_cex_get_vec(i)) for i in xrange(_cex_get_vec_len()) ]
for i in xrange(_cex_get_vec_len()):
cex = _cex_get_vec(i)
if cex is None:
res.append(None)
else:
res.append(_Cex(cex))
return res
def cex_get(): def cex_get():
cex = _cex_get() return _Cex( _cex_get() )
if cex is None:
return None
return _Cex(cex)
def cex_put(cex): def cex_put(cex):
assert cex is not None assert cex is not None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment