Beispiel #1
0
def write_implementation_defined3(t1: Place) -> Place:
    IOExists1(Place)(lambda t2: (
        Requires(
            token(t1, 2) and write_string_io(t1, "Hello!", t2) and
            write_string_io(t1, "Hallo!", t2) and write_string_io(
                t1, "Sveikas!", t2)),
        Ensures(token(t2) and t2 == Result()),
    ))

    t2 = write_string(t1, "Sveikas!")
    return t2
Beispiel #2
0
def hello(t1: Place) -> Place:
    IOExists1(Place)(
        lambda t2: (
        Requires(
            token(t1, 2) and
            write_string_io(t1, "Hello World!", t2)
        ),
        Ensures(
            token(t2) and
            t2 == Result()
        )
        )
    )

    t2 = write_string(t1, "Hello World!")

    return t2
Beispiel #3
0
def hello2(t1: Place) -> Place:
    IOExists1(Place)(
        lambda t2: (
        Requires(
            token(t1, 2) and
            write_string_io(t1, "Hello World!", t2)
        ),
        Ensures(
            token(t2) and
            t2 == Result()
        )
        )
    )

    #:: ExpectedOutput(call.precondition:insufficient.permission)
    t2 = write_string(t1, "Hello World")

    return t2