feat(kernel/justification): add is_eqp predicate

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-05-02 12:15:29 -07:00
parent e4f69bd780
commit 802edd77d1
2 changed files with 4 additions and 0 deletions

View file

@ -72,6 +72,8 @@ public:
friend justification mk_assumption_justification(unsigned idx, optional<expr> const & s, pp_jst_fn const & fn);
friend justification mk_assumption_justification(unsigned idx);
friend justification mk_justification(optional<expr> const & s, pp_jst_fn const & fn);
friend bool is_eqp(justification const & j1, justification const & j2) { return j1.raw() == j2.raw(); }
};
/**

View file

@ -958,6 +958,7 @@ static int mk_justification(lua_State * L) {
return push_justification(L, j);
}
}
static int justification_is_eqp(lua_State * L) { return push_boolean(L, is_eqp(to_justification(L, 1), to_justification(L, 2))); }
static const struct luaL_Reg justification_m[] = {
{"__gc", justification_gc}, // never throws
@ -972,6 +973,7 @@ static const struct luaL_Reg justification_m[] = {
{"assumption_idx", safe_function<justification_assumption_idx>},
{"child1", safe_function<justification_child1>},
{"child2", safe_function<justification_child2>},
{"is_eqp", safe_function<justification_is_eqp>},
{0, 0}
};