-
Notifications
You must be signed in to change notification settings - Fork 236
/
Copy pathFStar.Range.fsti
59 lines (44 loc) · 2.19 KB
/
FStar.Range.fsti
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
(*
Copyright 2008-2018 Microsoft Research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
module FStar.Range
open FStar.Sealed
(** [__range] is a type for the internal representations of source
ranges. Internally, it includes a "definition" range and a "use" range, each
of which has a filename, a start position (line+col), and an end position.
We do not fully expose this type, but explode below allows to inspect it,
and __mk_range to construct it.
[range] is a sealed version of [__range], meaning it does not provide
any facts about its values. We use this type since we have *total* functions
inspecting terms and returning their range metadada (like the range_of constant).
Given that range is sealed, it is sound to make range_of total.
*)
assume new type __range
type range = sealed __range
(** A dummy range constant *)
val __range_0 : __range
let range_0 : range = seal __range_0
(** Building a range constant *)
val __mk_range (file: string) (from_line from_col to_line to_col: int) : Tot __range
val mk_range (file: string) (from_line from_col to_line to_col: int) : Tot range
(* This is essentially
unfold
let mk_range (file: string) (from_line from_col to_line to_col: int) : Tot range =
seal (__mk_range file from_line from_col to_line to_col)
but the extra indirection breaks the custom errors messages in QuickCode.
Just retaining this as a primop for now (Guido 30/Aug/2024) *)
val join_range (r1 r2 : range) : Tot range
(** [labeled] is used internally to the SMT encoding to associate a
source-code location with an assertion. *)
irreducible
let labeled (r : range) (msg: string) (b: Type) : Type = b
val explode (r : __range) : Tot (string * int * int * int * int)