File tree Expand file tree Collapse file tree
test/typechecking/type_specs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ (include ../../utils/dune.common)
2+
3+ (include dune.inc)
Original file line number Diff line number Diff line change 1+ (rule
2+ (targets _gospel)
3+ (action (run mkdir - p _gospel))) ; create the compilation directory.
4+ (rule
5+ (deps
6+ % {bin: gospel}
7+ (: checker % {project_root}/ test/ utils/ testchecker.exe)
8+ _gospel)
9+ (action
10+ (with- outputs- to positive.mli.output
11+ (run % {checker} % {dep: positive.mli}))))
12+
13+ (rule
14+ (alias runtest)
15+ (action
16+ (diff positive.mli positive.mli.output)))
17+
18+ (rule
19+ (alias test- cmis)
20+ (action
21+ (chdir % {project_root}
22+ ; Syntax sanity check
23+ (run ocamlc - c % {dep: positive.mli}))))
24+
Original file line number Diff line number Diff line change 1+ (* *************************************************************************)
2+ (* *)
3+ (* GOSPEL -- A Specification Language for OCaml *)
4+ (* *)
5+ (* Copyright (c) 2018- The VOCaL Project *)
6+ (* *)
7+ (* This software is free software, distributed under the MIT license *)
8+ (* (as described in file LICENSE enclosed). *)
9+ (* *************************************************************************)
10+
11+ (* @ type nat = integer
12+ with x invariant x >= 0
13+ and positive_fraction = fraction
14+ with x invariant
15+ forall r. let _ = { res = r; f = x } in r > 0
16+ and negative_fraction = fraction
17+ with x invariant
18+ forall r. let _ = { res = r; f = x } in r < 0
19+ and compute = { res : integer; f : fraction }
20+ with x invariant x.res = x.res = (x.f.n1 / x.f.n2)
21+ and fraction = { n1 : integer; n2 : nat } *)
You can’t perform that action at this time.
0 commit comments