为权衡对矩阵运算静态分析的精度和效率,针对程序中表示矩阵的变量,提出一种基于抽象解释的抽象与分析算法,即区间向量抽象域。将矩阵变量抽象为一个区间向量对,即行区间向量和列区间向量,矩阵各元素的值范围是由这两个区间向量对应元素的交集表示;设计在该抽象域上的操作以及迁移函数。通过对区间向量抽象域的计算,较好地权衡矩阵元素值范围分析的精确度和分析效率。实验结果表明,该抽象域能够较精确地分析程序中矩阵各元素的值范围,与现有的分析数组的抽象域相比,在分析精度和效率之间取得了合理权衡。
An abstraction and analysis method based on abstract interpretation,namely interval vector abstract domain,was proposed for variables of matrix in programs to weight up the accuracy and the efficiency of value range analysis of matrix operations.A matrix was abstracted to a pair of interval vector,namely row vector and column vector.The intersection of two correspondent elements of the both interval vectors represented each element of matrix.Some operations on the abstract domain and transfer function were designed.A good trade-off was made between the precision and efficiency of the value range analysis of matrix by using the interval vector abstract domain.The result of experiment shows that the value range analysis of each element of matrix by using the abstract domain can get more accurate and also a rational balance between precision and efficiency is achieved compared with the existing abstract domain.