我应该如何在 Maude 中实施点分析?

发布于 2024-08-27 22:02:13 字数 1646 浏览 1 评论 0原文

我将实现一个指向分析算法。我想主要基于Whaley和Lam的算法来实现这个分析。 Whaley 和 Lam 使用基于 BDDDatalog 来表示和计算点分析关系。

下面列出了典型的点分析中使用的一些关系。请注意,D(w, z) :− A(w, x),B(x, y), C(y, z) 表示 D(w, z)A(w, x)B(x, y)C(y, z) 均为 true,则 > 为 true。 BDD就是用来表示这些关系的数据结构。

关系

input vP0 (variable : V, heap : H)
input store (base : V, field : F, source : V)
input load (base : V, field : F, dest : V)
input assign (dest : V, source : V)
output vP (variable : V, heap : H)
output hP (base : H, field : F, target : H)

规则

vP(v, h) :− vP0(v, h)
vP(v1, h) :− assign(v1, v2), vP(v2, h)
hP(h1, f,h2) :− store(v1, f, v2), vP(v1, h1), vP(v2, h2)
vP(v2, h2) :− load(v1, f, v2), vP(v1, h1), hP(h1, f, h2)

我需要了解 Maude 是实施点分析的良好环境。我注意到 Maude 使用了一个名为 BuDDy 的 BDD 库。但是,看起来 Maude 将 BDD 用于不同的目的,即统一。因此,我想我也许可以使用 Maude 而不是 Datalog 引擎来计算我的分析点的关系。我假设莫德同时传播独立信息。这种并发性可能会使我的分析点比规则的顺序处理更快。但是,我不知道在莫德中代表我的关系的最佳方式。我应该自己在Maude中实现BDD,还是Maude内部基于BDD统一也有同样的效果?

I'm going to implement a points-to analysis algorithm. I'd like to implement this analysis mainly based on the algorithm by Whaley and Lam. Whaley and Lam use a BDD based implementation of Datalog to represent and compute the points-to analysis relations.

The following lists some of the relations that are used in a typical points-to analysis. Note that D(w, z) :− A(w, x),B(x, y), C(y, z) means D(w, z) is true if A(w, x), B(x, y), and C(y, z) are all true. BDD is the data structure used to represent these relations.

Relations

input vP0 (variable : V, heap : H)
input store (base : V, field : F, source : V)
input load (base : V, field : F, dest : V)
input assign (dest : V, source : V)
output vP (variable : V, heap : H)
output hP (base : H, field : F, target : H)

Rules

vP(v, h) :− vP0(v, h)
vP(v1, h) :− assign(v1, v2), vP(v2, h)
hP(h1, f,h2) :− store(v1, f, v2), vP(v1, h1), vP(v2, h2)
vP(v2, h2) :− load(v1, f, v2), vP(v1, h1), hP(h1, f, h2)

I need to understand if Maude is a good environment for implementing points-to analysis. I noticed that Maude uses a BDD library called BuDDy. But, it looks like that Maude uses BDDs for a different purpose, i.e. unification. So, I thought I might be able to use Maude instead of a Datalog engine to compute the relations of my points-to analysis. I assume Maude propagates independent information concurrently. And this concurrency could potentially make my points-to analysis faster than sequential processing of rules. But, I don't know the best way to represent my relations in Maude. Should I implement BDD in Maude myself, or Maude's internal unification based on BDD has the same effect?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文