mirror of
https://github.com/Z3Prover/z3
synced 2025-04-10 19:27:06 +00:00
fixes issue #143 and memory leak on theory plugin setup
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
47da717947
commit
e81dc5a0a0
|
@ -2238,7 +2238,7 @@ namespace Microsoft.Z3
|
|||
/// <summary>
|
||||
/// Check for set membership.
|
||||
/// </summary>
|
||||
public Expr MkSetMembership(Expr elem, Expr set)
|
||||
public BoolExpr MkSetMembership(Expr elem, Expr set)
|
||||
{
|
||||
Contract.Requires(elem != null);
|
||||
Contract.Requires(set != null);
|
||||
|
@ -2246,13 +2246,13 @@ namespace Microsoft.Z3
|
|||
|
||||
CheckContextMatch(elem);
|
||||
CheckContextMatch(set);
|
||||
return Expr.Create(this, Native.Z3_mk_set_member(nCtx, elem.NativeObject, set.NativeObject));
|
||||
return (BoolExpr) Expr.Create(this, Native.Z3_mk_set_member(nCtx, elem.NativeObject, set.NativeObject));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check for subsetness of sets.
|
||||
/// </summary>
|
||||
public Expr MkSetSubset(Expr arg1, Expr arg2)
|
||||
public BoolExpr MkSetSubset(Expr arg1, Expr arg2)
|
||||
{
|
||||
Contract.Requires(arg1 != null);
|
||||
Contract.Requires(arg2 != null);
|
||||
|
@ -2260,7 +2260,7 @@ namespace Microsoft.Z3
|
|||
|
||||
CheckContextMatch(arg1);
|
||||
CheckContextMatch(arg2);
|
||||
return Expr.Create(this, Native.Z3_mk_set_subset(nCtx, arg1.NativeObject, arg2.NativeObject));
|
||||
return (BoolExpr) Expr.Create(this, Native.Z3_mk_set_subset(nCtx, arg1.NativeObject, arg2.NativeObject));
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -1818,11 +1818,11 @@ public class Context extends IDisposable
|
|||
/**
|
||||
* Check for set membership.
|
||||
**/
|
||||
public Expr mkSetMembership(Expr elem, Expr set)
|
||||
public BoolExpr mkSetMembership(Expr elem, Expr set)
|
||||
{
|
||||
checkContextMatch(elem);
|
||||
checkContextMatch(set);
|
||||
return Expr.create(
|
||||
return (BoolExpr) Expr.create(
|
||||
this,
|
||||
Native.mkSetMember(nCtx(), elem.getNativeObject(),
|
||||
set.getNativeObject()));
|
||||
|
@ -1831,11 +1831,11 @@ public class Context extends IDisposable
|
|||
/**
|
||||
* Check for subsetness of sets.
|
||||
**/
|
||||
public Expr mkSetSubset(Expr arg1, Expr arg2)
|
||||
public BoolExpr mkSetSubset(Expr arg1, Expr arg2)
|
||||
{
|
||||
checkContextMatch(arg1);
|
||||
checkContextMatch(arg2);
|
||||
return Expr.create(
|
||||
return (BoolExpr) Expr.create(
|
||||
this,
|
||||
Native.mkSetSubset(nCtx(), arg1.getNativeObject(),
|
||||
arg2.getNativeObject()));
|
||||
|
|
|
@ -50,7 +50,7 @@ public class FuncDecl extends AST
|
|||
FuncDecl casted = (FuncDecl) o;
|
||||
if (casted == null)
|
||||
return false;
|
||||
return this == casted;
|
||||
return this.getNativeObject() == casted.getNativeObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2698,8 +2698,10 @@ namespace smt {
|
|||
#endif
|
||||
|
||||
void context::register_plugin(theory * th) {
|
||||
if (m_theories.get_plugin(th->get_family_id()) != 0)
|
||||
if (m_theories.get_plugin(th->get_family_id()) != 0) {
|
||||
dealloc(th);
|
||||
return; // context already has a theory for the given family id.
|
||||
}
|
||||
SASSERT(std::find(m_theory_set.begin(), m_theory_set.end(), th) == m_theory_set.end());
|
||||
SASSERT(!already_internalized_theory(th));
|
||||
th->init(this);
|
||||
|
|
Loading…
Reference in a new issue