使用Frama-C'计算函数摘要;s值分析

使用Frama-C'计算函数摘要;s值分析,c,static-code-analysis,frama-c,abstract-interpretation,C,Static Code Analysis,Frama C,Abstract Interpretation,假设我们有以下代码示例: int a(int x){ if (x < 0){ return -50; } if (x >= 0 && x <= 3600){ return x - 100; } return x + 100; } int main(){ int q = Frama_C_interval(50, 5000); return a(q); } 请注意,我对

假设我们有以下代码示例:

int a(int x){
    if (x < 0){
        return -50;
    }
    if (x >= 0 && x <= 3600){
        return x - 100;
    }

    return x + 100;
}

int main(){
    int q = Frama_C_interval(50, 5000); 

    return a(q);
}
请注意,我对基于上下文的摘要感兴趣,因此函数a()中的其他情况不太感兴趣


实现这一点的最佳方法是什么?

这可以使用编程API和/或精心设计的
main
函数实现。在这两种情况下,都必须编写OCaml代码来提取输出的可能值。您是否已经查看了模块
Db.Value
中的可用内容?感谢您的帮助!我将看一看API,但是在我的用例中制作一个主函数会更简单。
[50,3600] -> [-50, 3500]
[3601,5000] -> [3701, 5100]