【发布时间】:2021-07-04 06:10:55
【问题描述】:
这个引理可以验证,但会引发警告Not triggers found:
lemma multisetPreservesGreater (a:seq<int>, b:seq<int>, c:int, f:int, x:int)
requires |a|==|b| && 0 <= c <= f + 1 <= |b|
requires (forall j :: c <= j <= f ==> a[j] >= x)
requires multiset(a[c..f+1]) == multiset(b[c..f+1])
ensures (forall j :: c <= j <= f ==> b[j] >= x)
{
assert (forall j :: j in multiset(a[c..f+1]) ==> j in multiset(b[c..f+1]));
}
我不知道如何实例化这个触发器(不能将它实例化为函数,或者我可以吗?)。有什么帮助吗?
编辑:也许我可以实例化一个方法 f,它接受一个数组并将其插入到一个多重集中,因此我可以触发 f(a),但这没有提到 i。我会试试的。
【问题讨论】:
-
如果您的程序验证,您可以放心地忽略此警告。见this answer。
-
完全,在这种情况下我担心的是我想知道如何手动选择此示例的触发器。
标签: triggers z3 theorem-proving dafny multiset