from nagini_contracts.contracts import *
from nagini_contracts.obligations import MustTerminate
from typing import List
def newlist() -> List[int]:
Requires(MustTerminate(2))
res = [] # type: List[int]
return res
def caller() -> None:
Requires(MustTerminate(2))
a = newlist()
we get a good error message Obligation leak check failed. Callee newlist might not take all unsatisfied obligations from the caller. (test.py@13.8). When changing the precondition of newlist to MustTerminate(1), we get a bad message that says nothing about obligations instead: The precondition of [] might not hold. (test.py@8.10)
In the following code
we get a good error message
Obligation leak check failed. Callee newlist might not take all unsatisfied obligations from the caller. (test.py@13.8)
. When changing the precondition of newlist toMustTerminate(1)
, we get a bad message that says nothing about obligations instead:The precondition of [] might not hold. (test.py@8.10)