In this work, which is done in the context of a (moded) logic programming language, we devise a data-flow analysis dedicated to computing what we call argument profiles. Such a profile essentially describes, for each argument of a predicate, its functionality, i.e. the operations in which the argument can be involved during an evaluation of the predicate, as well as how the argument contributes to the consumption and/or construction of data values. While the computed argument profiles can be useful for applications in the context of program understanding (as each profile essentially provides a way to better understand the role of the argument), they more importantly provide a way to discern between arguments in a manner that is more fine-grained than what can be done with other abstract characterizations such as types and modes. This is important for applications where one needs to identify correspondences between the arguments of two or more different predicates that need to be compared, such as during clone detection. Moreover, since a total order can be defined on the abstract domain of profiles, our analysis can be used for rearranging predicate arguments and order them according to their functionality, constituting as such an essential ingredient for predicate normalization techniques.
翻译:本文在(模化)逻辑编程语言背景下,设计了一种专门用于计算所谓参数概要的数据流分析。该概要本质上描述了谓词每个参数的功能性,即在谓词求值过程中可能涉及该参数的操作,以及该参数如何参与数据值的消费和/或构造。虽然计算出的参数概要可用于程序理解等应用(因为每个概要本质上提供了一种更清晰理解参数角色的方式),但更重要的是,它们能够以比类型和模式等其他抽象特征更细粒度的方式来区分参数。这对于需要识别两个或多个不同谓词间参数对应关系的应用(如克隆检测)至关重要。此外,由于可以在参数概要的抽象域上定义全序关系,我们的分析可用于重排谓词参数并根据其功能性对其进行排序,从而成为谓词规范化技术的关键组成部分。