Commit 18aca836 authored by François Bobot's avatar François Bobot

Merge branch 'bobot/tagset' into 'master'

Imperative TagSet with iterators

See merge request !82
parents 21500d33 4f7af118
...@@ -302,6 +302,12 @@ module mach.peano.MinMax ...@@ -302,6 +302,12 @@ module mach.peano.MinMax
syntax val min "min %1 %2" prec 4 3 3 syntax val min "min %1 %2" prec 4 3 3
end end
module mach.peano.Int63
syntax val defensive_to_int63 "%1"
syntax val to_int63 "%1"
syntax val of_int63 "%1"
end
module mach.onetime.OneTime module mach.onetime.OneTime
syntax type t "int" syntax type t "int"
syntax val to_int "Z.of_int %1" prec 4 3 syntax val to_int "Z.of_int %1" prec 4 3
......
This diff is collapsed.
...@@ -92,12 +92,15 @@ module Print = struct ...@@ -92,12 +92,15 @@ module Print = struct
List.iter (fun s -> Hstr.add h s ()) ocaml_keywords; List.iter (fun s -> Hstr.add h s ()) ocaml_keywords;
Hstr.mem h Hstr.mem h
let char_to_alnumusquote c =
match c with '\'' -> "\'" | _ -> char_to_alnumus c
(* iprinter: local names (* iprinter: local names
aprinter: type variables aprinter: type variables
tprinter: toplevel definitions *) tprinter: toplevel definitions *)
let iprinter, aprinter, tprinter = let iprinter, aprinter, tprinter =
let isanitize = sanitizer char_to_alnumus char_to_alnumus in let isanitize = sanitizer char_to_alnumus char_to_alnumusquote in
let lsanitize = sanitizer char_to_lalnumus char_to_alnumus in let lsanitize = sanitizer char_to_lalnumus char_to_alnumusquote in
create_ident_printer ocaml_keywords ~sanitizer:isanitize, create_ident_printer ocaml_keywords ~sanitizer:isanitize,
create_ident_printer ocaml_keywords ~sanitizer:lsanitize, create_ident_printer ocaml_keywords ~sanitizer:lsanitize,
create_ident_printer ocaml_keywords ~sanitizer:lsanitize create_ident_printer ocaml_keywords ~sanitizer:lsanitize
...@@ -719,8 +722,7 @@ module Print = struct ...@@ -719,8 +722,7 @@ module Print = struct
let extract_functor_args info dl = let extract_functor_args info dl =
let rec extract args = function let rec extract args = function
(* FIXME remove empty args? *) | Dmodule (_, []) :: dl -> extract args dl
(* | Dmodule (_, []) :: dl -> extract args dl *)
| Dmodule (x, dlx) :: dl when is_signature info dlx -> | Dmodule (x, dlx) :: dl when is_signature info dlx ->
extract ((x, dlx) :: args) dl extract ((x, dlx) :: args) dl
| dl -> List.rev args, dl in | dl -> List.rev args, dl in
......
...@@ -102,10 +102,19 @@ module MinMax ...@@ -102,10 +102,19 @@ module MinMax
end end
module Int63 module Int63
use int.Int
use mach.int.Int63 use mach.int.Int63
use Peano use Peano
val defensive_to_int63 (x:t) : int63
requires { Int63.in_bounds x.v }
ensures { result = x.v }
val partial to_int63 (x:t) : int63 val partial to_int63 (x:t) : int63
ensures { result = x.v } ensures { result = x.v }
val of_int63 (x:int63) (low high: t) : t
requires { low.v <= x <= high.v }
ensures { result.v = x }
end end
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment