package electrod

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file Name.ml

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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
(*******************************************************************************
 * electrod - a model finder for relational first-order linear temporal logic
 * 
 * Copyright (C) 2016-2020 ONERA
 * Authors: Julien Brunel (ONERA), David Chemouil (ONERA)
 * 
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 * 
 * SPDX-License-Identifier: MPL-2.0
 * License-Filename: LICENSE.md
 ******************************************************************************)

open Containers

(* type t = string
 * 
 * 
 * let name s = s
 * 
 * let dummy =
 *   let c = ref 0 in
 *   fun () ->
 *     "dummy!" ^ (string_of_int @@ CCRef.get_then_incr c)
 * 
 * let of_raw_ident id = Raw_ident.basename id
 * 
 * let univ = "univ"
 * 
 * let iden = "iden"
 * 
 * let equal = String.equal
 * 
 * let compare = String.compare
 * 
 * let style = `Cyan
 * 
 * let pp out name =
 *   Fmtc.(styled style string) out name
 * 
 * 
 * module P = Intf.Print.Mixin(struct type nonrec t = t let pp = pp end)
 * include P 
 * 
 * module Map = CCMap.Make(struct type t = string let compare = CCOrd.string end) *)

module H = Hashcons

type t = string H.hash_consed

module S = H.Make (struct
  type t = string

  let hash = String.hash

  let equal = String.equal
end)

(* ********************* *)
(* table for hashconsing *)
(* ********************* *)
let table = S.create 271

(* ********************* *)

let name s = S.hashcons table s

let dummy =
  let c = ref 0 in
  fun () -> name @@ "dummy!" ^ string_of_int @@ CCRef.get_then_incr c


let hash sym = sym.H.hkey

let compare s1 s2 = s1.H.tag - s2.H.tag

let equal x1 x2 = Stdlib.(x1 == x2)

let of_raw_ident id = name @@ Raw_ident.basename id

let univ = name "univ"

let iden = name "iden"

let style = `Cyan

let pp out name = Fmtc.(styled style string) out name.H.node

module P = Intf.Print.Mixin (struct
  type nonrec t = t

  let pp = pp
end)

include P

module Map = CCMap.Make (struct
  type nonrec t = t

  let compare = compare
end)
OCaml

Innovation. Community. Security.