[sledge] Refactor: Rename Formula.conditional to Formula.cond

Reviewed By: ngorogiannis

Differential Revision: D22170514

fbshipit-source-id: d9d7dc0c0
master
Josh Berdine 4 years ago committed by Facebook GitHub Bot
parent 94e8b07997
commit 896e9602f8

@ -412,9 +412,9 @@ let realloc_spec reg ptr siz =
Sh.or_
(Sh.and_ (Formula.eq loc Term.zero) (Sh.rename sub foot))
(Sh.and_
(Formula.conditional ~cnd:(Formula.le len siz)
~thn:(eq_concat (siz, a1) [|(len, a0); (Term.sub siz len, a2)|])
~els:(eq_concat (len, a0) [|(siz, a1); (Term.sub len siz, a2)|]))
(Formula.cond ~cnd:(Formula.le len siz)
~pos:(eq_concat (siz, a1) [|(len, a0); (Term.sub siz len, a2)|])
~neg:(eq_concat (len, a0) [|(siz, a1); (Term.sub len siz, a2)|]))
(Sh.seg rseg))
in
{foot; sub; ms; post}
@ -441,9 +441,9 @@ let rallocx_spec reg ptr siz =
Sh.or_
(Sh.and_ (Formula.eq loc Term.zero) (Sh.rename sub pheap))
(Sh.and_
(Formula.conditional ~cnd:(Formula.le len siz)
~thn:(eq_concat (siz, a1) [|(len, a0); (Term.sub siz len, a2)|])
~els:(eq_concat (len, a0) [|(siz, a1); (Term.sub len siz, a2)|]))
(Formula.cond ~cnd:(Formula.le len siz)
~pos:(eq_concat (siz, a1) [|(len, a0); (Term.sub siz len, a2)|])
~neg:(eq_concat (len, a0) [|(siz, a1); (Term.sub len siz, a2)|]))
(Sh.seg rseg))
in
{foot; sub; ms; post}
@ -472,9 +472,9 @@ let xallocx_spec reg ptr siz ext =
let post =
Sh.and_
(Formula.and_
(Formula.conditional ~cnd:(Formula.le len siz)
~thn:(eq_concat (siz, a1) [|(len, a0); (Term.sub siz len, a2)|])
~els:(eq_concat (len, a0) [|(siz, a1); (Term.sub len siz, a2)|]))
(Formula.cond ~cnd:(Formula.le len siz)
~pos:(eq_concat (siz, a1) [|(len, a0); (Term.sub siz len, a2)|])
~neg:(eq_concat (len, a0) [|(siz, a1); (Term.sub len siz, a2)|]))
(Formula.and_ (Formula.le siz reg)
(Formula.le reg (Term.add siz ext))))
(Sh.seg seg')

@ -98,6 +98,7 @@ module Formula = struct
let project e = Some e
let tt = true_
let ff = false_
let cond ~cnd ~pos ~neg = conditional ~cnd ~thn:pos ~els:neg
let of_exp e =
let b = Term.of_exp e in

@ -144,7 +144,7 @@ and Formula : sig
val not_ : t -> t
val and_ : t -> t -> t
val or_ : t -> t -> t
val conditional : cnd:t -> thn:t -> els:t -> t
val cond : cnd:t -> pos:t -> neg:t -> t
(** Convert *)

Loading…
Cancel
Save