Minor refactoring

This commit is contained in:
Tim Chevalier 2011-07-08 21:50:09 -07:00
parent 7060f4c89c
commit be6febb46d
2 changed files with 11 additions and 3 deletions

View file

@ -108,8 +108,12 @@ fn require_and_preserve(uint i, &pre_and_post p) {
fn set_in_postcond(uint i, &pre_and_post p) -> bool {
// sets the ith bit in p's post
auto was_set = tritv_get(p.postcondition, i);
tritv_set(i, p.postcondition, ttrue);
ret set_in_postcond_(i, p.postcondition);
}
fn set_in_postcond_(uint i, &postcond p) -> bool {
auto was_set = tritv_get(p, i);
tritv_set(i, p, ttrue);
ret was_set != ttrue;
}

View file

@ -81,7 +81,11 @@ fn bit_num(&fn_ctxt fcx, &constr_ c) -> uint {
}
fn promises(&fn_ctxt fcx, &poststate p, &constr_ c) -> bool {
ret tritv_get(p, bit_num(fcx, c)) == ttrue;
ret promises_(bit_num(fcx, c), p);
}
fn promises_(uint n, &poststate p) -> bool {
ret tritv_get(p, n) == ttrue;
}
// v "happens after" u