最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

semantics - Computing weakest preconditions with conditional value dependencies - Stack Overflow

programmeradmin2浏览0评论

I'm trying to compute weakest preconditions working backwards from the postcondition c > 10. Specifically, I want to determine what conditions func_1() should satisfy (i.e., what value of b it should return) to ensure certain properties of c hold after func_2. The challenge I'm facing is that whether c depends on b at all is determined by alpha inside func_2. When alpha is False, c is just set to a and b has no effect. Is it possible to compute meaningful preconditions in such a case? If so, how should I approach it? If not, why is it impossible? I suspect this might be a fundamental limitation, but I'd appreciate insights from those more experienced with program analysis.

b = func_1()
c = func_2(b)

def func_2(b):
    a = d.val()  # gets some value from object d
    if alpha:
        c = a + b
    else:
        c = a
    return c
发布评论

评论列表(0)

  1. 暂无评论