Exemplo n.º 1
0
def test4(a: List[int], b: List[int]) -> None:
    Requires(Acc(list_pred(a)))
    Requires(Acc(list_pred(b)))
    for i in a:
        Invariant(Acc(list_pred(b)))
        for j in b:
            pass
Exemplo n.º 2
0
def test_terminate_promise_4(a: List[int], b: List[int]) -> None:
    Requires(MustTerminate(2))
    Requires(Acc(list_pred(a)))
    Requires(Acc(list_pred(b)))
    for i in a:
        Invariant(MustTerminate(len(a) - len(Previous(i))))
        Invariant(Acc(list_pred(b)))
        #:: ExpectedOutput(leak_check.failed:loop_context.has_unsatisfied_obligations)
        for j in b:
            pass
Exemplo n.º 3
0
def test3() -> None:
    a = [1, 2, 3]
    b = [1, 2, 3]
    for i in a:
        Invariant(Acc(list_pred(b)))
        for j in b:
            pass
Exemplo n.º 4
0
def test2() -> None:
    a = [1, 2, 3]
    for i in a:
        pass
    Assert(Acc(list_pred(a)))
Exemplo n.º 5
0
def test1(a: List[int]) -> None:
    Requires(Acc(list_pred(a)))
    Ensures(Acc(list_pred(a)))
    for i in a:
        pass
Exemplo n.º 6
0
def test_terminate_promise_1(a: List[int]) -> None:
    Requires(MustTerminate(2))
    Requires(Acc(list_pred(a)))
    #:: ExpectedOutput(leak_check.failed:loop_context.has_unsatisfied_obligations)
    for i in a:
        pass
Exemplo n.º 7
0
def test_measures_4(a: List[int]) -> None:
    Requires(Acc(list_pred(a)))
    Requires(len(a) > 1)
    for i in a:
        #:: ExpectedOutput(invariant.not.preserved:obligation_measure.non_positive)
        Invariant(MustTerminate(len(a) - len(Previous(i)) - 1))
Exemplo n.º 8
0
def test_measures_3(a: List[int]) -> None:
    Requires(Acc(list_pred(a)))
    for i in a:
        Invariant(MustTerminate(len(a) - len(Previous(i))))
Exemplo n.º 9
0
def test_measures_1(a: List[int]) -> None:
    Requires(Acc(list_pred(a)))
    for i in a:
        #:: ExpectedOutput(invariant.not.established:obligation_measure.non_positive)
        Invariant(MustTerminate(-1))
Exemplo n.º 10
0
def test_exhale_1(a: List[int]) -> None:
    Requires(Acc(list_pred(a)))
    for i in a:
        Invariant(MustTerminate(len(a) - len(Previous(i))))
        Invariant(MustTerminate(1 + len(a) - len(Previous(i))))
Exemplo n.º 11
0
def test_generation_1(a: List[int]) -> None:
    Requires(Acc(list_pred(a)))
    for i in a:
        Invariant(MustTerminate(len(a) - len(Previous(i))))
    non_terminating()