Minor refactoring
This commit is contained in:
parent
7060f4c89c
commit
be6febb46d
2 changed files with 11 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue