Files
why3/bench/java/rectype.mlw

22 lines
416 B
Plaintext
Raw Permalink Normal View History

2022-05-13 10:53:00 +02:00
module RecursiveRecord
use mach.java.util.NoSuchElementException
use mach.java.util.Optional
type t = {
a : bool;
next : optional t
}
let get_next (self : t) : t
ensures { self.next = Optional.build result }
raises { NoSuchElementException.E -> not is_present self.next }
=
Optional.get self.next
let default_cstr [@java:constructor]() = { a = false; next = empty () }
end