Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrites knowledge and primus monads #1361

Merged
merged 7 commits into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions lib/bap_core_theory/bap_core_theory_manager.ml
Original file line number Diff line number Diff line change
Expand Up @@ -80,52 +80,43 @@ let declare
}

let (++) x y =
x >>= fun x ->
y >>| fun y ->
let+ x = x and+ y = y in
Value.merge x y
[@@inline]


let join1 p q x =
x >>= fun x ->
let* x = x in
p !!x ++ q !!x
[@@inline]

let join1s p q s x =
x >>= fun x ->
let* x = x in
p s !!x ++ q s !!x
[@@inline]

let join2 p q x y =
x >>= fun x ->
y >>= fun y ->
let* x = x and+ y = y in
p !!x !!y ++ q !!x !!y
[@@inline]

let join2s p q s x y =
x >>= fun x ->
y >>= fun y ->
let* x = x and+ y = y in
p s !!x !!y ++ q s !!x !!y
[@@inline]

let join3 p q x y z =
x >>= fun x ->
y >>= fun y ->
z >>= fun z ->
let* x = x and* y = y and* z = z in
p !!x !!y !!z ++ q !!x !!y !!z
[@@inline]

let join3s p q s x y z =
x >>= fun x ->
y >>= fun y ->
z >>= fun z ->
let* x = x and* y = y and* z = z in
p s !!x !!y !!z ++ q s !!x !!y !!z
[@@inline]

let join4 p q r x y z =
r >>= fun r ->
x >>= fun x ->
y >>= fun y ->
z >>= fun z ->
let* r = r and* x = x and* y = y and* z = z in
p !!r !!x !!y !!z ++ q !!r !!x !!y !!z
[@@inline]

Expand Down
Loading