1(* Copyright (C) 1997-2001 by Ken Friis Larsen and Jakob Lichtenberg. *)
2signature bvec =
3sig
4    type bvec
5    type const = int
6
7    val bvectrue: fdd.precision -> bvec
8    val bvecfalse: fdd.precision -> bvec
9    val con: fdd.precision -> const -> bvec
10    val var: fdd.precision -> bdd.varnum -> int -> bvec
11    val varfdd: fdd.fddvar -> bvec
12
13    val coerce: fdd.precision -> bvec -> bvec
14
15    val isConst: bvec -> bool
16    val getConst: bvec -> const
17    val lookupConst: bvec -> const option
18
19    val add: bvec * bvec -> bvec
20    val sub: bvec * bvec -> bvec
21
22    val mul     : bvec * bvec -> bvec
23    val mulfixed: bvec * const -> bvec
24
25    val div     : bvec * bvec -> bvec * bvec
26    val divfixed: bvec * const -> bvec * bvec
27
28    val divi     : bvec * bvec -> bvec
29    val divifixed: bvec * const -> bvec
30
31    val modu     : bvec * bvec -> bvec
32    val modufixed: bvec * const -> bvec
33
34    val shl     : bvec -> bvec -> bdd.bdd -> bvec
35    val shlfixed: bvec -> int -> bdd.bdd -> bvec
36
37    val shr     : bvec -> bvec -> bdd.bdd -> bvec
38    val shrfixed: bvec -> int -> bdd.bdd -> bvec
39
40    val lth: bvec * bvec -> bdd.bdd
41    val lte: bvec * bvec -> bdd.bdd
42    val gth: bvec * bvec -> bdd.bdd
43    val gte: bvec * bvec -> bdd.bdd
44    val equ: bvec * bvec -> bdd.bdd
45    val neq: bvec * bvec -> bdd.bdd
46end
47
48(* Structure bvec implements BuDDy's bvec functions.
49
50  Documentation is not available currently.  see the Buddy
51  documentation.
52
53
54  The following table shows how ML types and values in this modules
55  relates to C types and function declarations in bvec.h:
56
57  MuDDy       BuDDy                   Comment
58  -----------------------------------------------------------------
59  Types:
60  bvec        BVEC
61  const       int
62
63  Values:
64  ?           bvec_copy
65  bvectrue    bvec_true
66  bvecfalse   bvec_false
67  con         bvec_con
68  var         bvec_var
69  varfdd      bvec_varfdd
70  ?           bvec_varvec
71  coerce      bvec_coerce
72  isConst     bvec_isconst
73  getConst    bvec_val
74  lookupConst ?                       Uses isConst and getConst
75  ?           bvec_free
76  ?           bvec_addref
77  ?           bvec_delref
78  ?           bvec_map1
79  ?           bvec_map2
80  ?           bvec_map3
81  add         bvec_add
82  sub         bvec_sub
83  mul         bvec_mul
84  div         bvec_div
85  divi        bvec_div                (See also modu)
86  modu        bvec_div                (See also divi)
87  shl         bvec_shl
88  shr         bvec_shr
89  lth         bvec_lth
90  lte         bvec_lte
91  gth         bvec_gth
92  gte         bvec_gte
93  equ         bvec_equ
94  neq         bvec_neq
95
96*)
97