This file is indexed.

/usr/lib/ocaml/apron/abstract1.idl is in libapron-ocaml-dev 0.9.10-7.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
/* -*- mode: c -*- */

/* This file is part of the APRON Library, released under LGPL license.
   Please read the COPYING file packaged in the distribution  */


quote(C, "\n\
#include <limits.h>\n\
#include \"ap_expr0.h\"\n\
#include \"ap_abstract0.h\"\n\
#include \"ap_environment.h\"\n\
#include \"ap_expr1.h\"\n\
#include \"ap_abstract1.h\"\n\
#include \"caml/callback.h\"\n\
#include \"apron_caml.h\"\n\
")

import "scalar.idl";
import "interval.idl";
import "coeff.idl";
import "dim.idl";
import "linexpr0.idl";
import "lincons0.idl";
import "generator0.idl";
import "manager.idl";
import "abstract0.idl";
import "environment.idl";
import "linexpr1.idl";
import "lincons1.idl";
import "generator1.idl";
import "texpr1.idl";
import "tcons1.idl";

struct ap_abstract1_t {
  [mlname(mutable_abstract0)] ap_abstract0_ptr abstract0;
  [mlname(mutable_env)] ap_environment_ptr env;
};
quote(MLMLI,"(** APRON Abstract values of level 1 *)")
quote(MLMLI,"(** The type parameter ['a] allows to distinguish abstract values with different underlying abstract domains. *)\n")

quote(MLMLI,"type box1 = { mutable interval_array : Interval.t array; mutable box1_env : Environment.t }")

quote(MLMLI,"(* ********************************************************************** *)")
quote(MLMLI,"(** {2 General management} *)")
quote(MLMLI,"(* ********************************************************************** *)")

quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Memory} *)")
quote(MLMLI,"(* ============================================================ *)")

quote(MLI,"\n\
(** Copy a value *)
val copy : 'a Manager.t -> 'a t -> 'a t\n\
\n\
(** Return the abstract size of a value *)
val size : 'a Manager.t -> 'a t -> int\n\
")
quote(ML,"\n\
let copy man x = { abstract0 = Abstract0.copy man x.abstract0; env = x.env }\n\
let size man x = Abstract0.size man x.abstract0\n\
")

quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Control of internal representation} *)")
quote(MLMLI,"(* ============================================================ *)")

quote(MLI,"\n\
(** Minimize the size of the representation of the value. This may result in a later recomputation of internal information.*)
val minimize : 'a Manager.t -> 'a t -> unit\n\
\n\
(** Put the abstract value in canonical form. (not yet clear definition) *)
val canonicalize : 'a Manager.t -> 'a t -> unit\n\
\n\
val hash : 'a Manager.t -> 'a t -> int\n\
\n\
(** [approximate man abs alg] perform some transformation on the abstract value, guided by the argument [alg]. The transformation may lose information.  The argument [alg] overrides the field algorithm of the structure of type [Manager.funopt] associated to ap_abstract0_approximate (commodity feature).*)
val approximate : 'a Manager.t -> 'a t -> int -> unit\n\
\n\
")
quote(ML,"\n\
let minimize man x = Abstract0.minimize man x.abstract0\n\
let canonicalize man x = Abstract0.canonicalize man x.abstract0\n\
let hash man x = 5*(Environment.hash x.env) + Abstract0.hash man x.abstract0\n\
let approximate man x n = Abstract0.approximate man x.abstract0 n\n\
")

quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Printing} *)")
quote(MLMLI,"(* ============================================================ *)")

quote(MLI,"\n(** Dump on the [stdout] C stream the internal representation of an abstract value, for debugging purposes *)")
void ap_abstract1_fdump(ap_manager_ptr man, [ref]struct ap_abstract1_t* a)
  quote(call,"ap_abstract1_fdump(stdout,man, a); fflush(stdout);")
  quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"\n(** Print as a set of constraints *)")
quote(MLI,"val print: Format.formatter -> 'a t -> unit")

quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Serialization} *)")
quote(MLMLI,"(* ============================================================ *)")

quote(MLMLI,"(* ********************************************************************** *)")
quote(MLMLI,"(** {2 Constructor, accessors, tests and property extraction} *)")
quote(MLMLI,"(* ********************************************************************** *)")

quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Basic constructors} *)\n")
quote(MLMLI,"(* ============================================================ *)")

quote(MLI,"(** All these functions request explicitly an environment in their arguments. *)\n")

quote(MLI,"\n(** Create a bottom (empty) value defined on the given environment *)")
struct ap_abstract1_t ap_abstract1_bottom(ap_manager_ptr man, ap_environment_ptr env)
    quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"\n(** Create a top (universe) value defined on the given environment *)")
struct ap_abstract1_t ap_abstract1_top(ap_manager_ptr man, ap_environment_ptr env)
    quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"\n(** Abstract an hypercube.\n\n[of_box man env tvar tinterval] abstracts an hypercube defined by the arrays [tvar] and [tinterval]. The result is defined on the environment [env], which should contain all the variables in [tvar] (and defines their type) *)")
struct ap_abstract1_t ap_abstract1_of_box(ap_manager_ptr man,
				    ap_environment_ptr env,
				    [size_is(size)]ap_var_t* tvar,
				    [size_is(size2)]ap_interval_ptr* tinterval,
				    unsigned int size, unsigned int size2)
  quote(call,"\n\
if (size!=size2)\n\
  caml_failwith(\"Abstract1.of_box: the two arrays are of different sizes\");\n\
_res = ap_abstract1_of_box(man,env,tvar,tinterval,size);\n\
")
    quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Accessors} *)\n")
quote(MLMLI,"(* ============================================================ *)")

quote(MLI,"\n\
val manager : 'a t -> 'a Manager.t\n\
val env : 'a t -> Environment.t\n\
val abstract0 : 'a t -> 'a Abstract0.t\n\
  (** Return resp. the underlying manager, environment and abstract value of level 0 *)\n\
")

quote(ML,"\n\
let manager x = Abstract0.manager x.abstract0\n\
let env x = x.env\n\
let abstract0 x = x.abstract0\n\
")

quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Tests} *)\n")
quote(MLMLI,"(* ============================================================ *)")

quote(MLI,"\n\
(** Emptiness test *)
val is_bottom : 'a Manager.t -> 'a t -> bool\n\
\n\
(** Universality test *)
val is_top : 'a Manager.t -> 'a t -> bool\n\
")
quote(ML,"\n\
let is_bottom man x = Abstract0.is_bottom man x.abstract0\n\
let is_top man x = Abstract0.is_top man x.abstract0\n\
")

quote(MLI,"\n(** Inclusion test. The 2 abstract values should be compatible. *)")
boolean ap_abstract1_is_leq(ap_manager_ptr man, [ref]struct ap_abstract1_t* a1, [ref]struct ap_abstract1_t* a2)
    quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"\n(** Equality test. The 2 abstract values should be compatible. *)")
boolean ap_abstract1_is_eq(ap_manager_ptr man, [ref]struct ap_abstract1_t* a1, [ref]struct ap_abstract1_t* a2)
    quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"\n(** Does the abstract value satisfy the linear constraint ? *)")
boolean ap_abstract1_sat_lincons(ap_manager_ptr man, [ref]struct ap_abstract1_t* a, [ref]struct ap_lincons1_t* v)
    quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"\n(** Does the abstract value satisfy the tree expression constraint ? *)")
boolean ap_abstract1_sat_tcons(ap_manager_ptr man, [ref]struct ap_abstract1_t* a, [ref]struct ap_tcons1_t* v)
    quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"\n(** Does the abstract value satisfy the constraint [dim in interval] ? *)")
boolean ap_abstract1_sat_interval(ap_manager_ptr man, [ref]struct ap_abstract1_t* a,
				  ap_var_t v1,
				  [ref]struct ap_interval_t* v2)
    quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"\n(** Is the variable unconstrained in the abstract value ? If yes, this means that the existential quantification of the dimension does not change the value. *)")
boolean ap_abstract1_is_variable_unconstrained(ap_manager_ptr man, [ref]struct ap_abstract1_t* a, ap_var_t v)
    quote(dealloc,"I0_CHECK_EXC(man)");


quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Extraction of properties} *)\n")
quote(MLMLI,"(* ============================================================ *)")

quote(MLI,"\n(** Return the interval of variation of the variable in the abstract value. *)")
[ref]struct ap_interval_t* ap_abstract1_bound_variable(ap_manager_ptr man, [ref]struct ap_abstract1_t* a, ap_var_t v)
    quote(dealloc,"ap_interval_free(_res); I0_CHECK_EXC(man)");

quote(MLI,"\n(** Return the interval of variation of the linear expression in the abstract value. \n\nImplement a form of linear programming, where the argument linear expression is the one to optimize under the constraints induced by the abstract value. *)")
[ref]struct ap_interval_t* ap_abstract1_bound_linexpr(ap_manager_ptr man, [ref]struct ap_abstract1_t* a, [ref]struct ap_linexpr1_t* v)
    quote(dealloc,"ap_interval_free(_res); I0_CHECK_EXC(man)");

quote(MLI,"\n(** Return the interval of variation of the tree expression in the abstract value. *)")
[ref]struct ap_interval_t* ap_abstract1_bound_texpr(ap_manager_ptr man, [ref]struct ap_abstract1_t* a, [ref]struct ap_texpr1_t* v)
    quote(dealloc,"ap_interval_free(_res); I0_CHECK_EXC(man)");

quote(MLI,"\n\
(** Convert the abstract value to an hypercube *)
val to_box : 'a Manager.t -> 'a t -> box1\n\
\n\
(** Convert the abstract value to a conjunction of linear constraints. *)
val to_lincons_array : 'a Manager.t -> 'a t -> Lincons1.earray\n\
(** Convert the abstract value to a conjunction of tree expressions constraints. *)
val to_tcons_array : 'a Manager.t -> 'a t -> Tcons1.earray\n\
\n\
(** Convert the abstract value to a set of generators that defines it. *)
val to_generator_array : 'a Manager.t -> 'a t -> Generator1.earray\n\
\n\
")

quote(ML,"\n\
let to_lincons_array man x = {\n\
  Lincons1.lincons0_array = Abstract0.to_lincons_array man x.abstract0;\n\
  Lincons1.array_env = x.env\n\
}\n\
let to_tcons_array man x = {\n\
  Tcons1.tcons0_array = Abstract0.to_tcons_array man x.abstract0;\n\
  Tcons1.array_env = x.env\n\
}\n\
let to_generator_array man x = {\n\
  Generator1.generator0_array = Abstract0.to_generator_array man x.abstract0;\n\
  Generator1.array_env = x.env\n\
}\n\
let to_box man x = {\n\
  interval_array = Abstract0.to_box man x.abstract0;\n\
  box1_env = x.env\n\
}\n\
")

quote(MLMLI,"(* ********************************************************************** *)")
quote(MLMLI,"(** {2 Operations} *)")
quote(MLMLI,"(* ********************************************************************** *)")

quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Meet and Join} *)\n")
quote(MLMLI,"(* ============================================================ *)")

quote(MLI,"(** Meet of 2 abstract values. *)")
struct ap_abstract1_t ap_abstract1_meet(ap_manager_ptr man, [ref]struct ap_abstract1_t* a1, [ref]struct ap_abstract1_t* a2)
     quote(call,"_res = ap_abstract1_meet(man,false,a1,a2);")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"(** Meet of a non empty array of abstract values. *)")
struct ap_abstract1_t ap_abstract1_meet_array(ap_manager_ptr man,
					[size_is(size)]struct ap_abstract1_t* array, unsigned int size)
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"(** Meet of an abstract value with an array of linear constraints. *)")
struct ap_abstract1_t ap_abstract1_meet_lincons_array(ap_manager_ptr man, [ref]struct ap_abstract1_t* a,
						 [ref]struct ap_lincons1_array_t* v)
     quote(call,"_res = ap_abstract1_meet_lincons_array(man,false,a,v);")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"(** Meet of an abstract value with an array of tree expressions constraints. *)")
struct ap_abstract1_t ap_abstract1_meet_tcons_array(ap_manager_ptr man, [ref]struct ap_abstract1_t* a,
						 [ref]struct ap_tcons1_array_t* v)
     quote(call,"_res = ap_abstract1_meet_tcons_array(man,false,a,v);")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"(** Join of 2 abstract values. *)")
struct ap_abstract1_t ap_abstract1_join(ap_manager_ptr man, [ref]struct ap_abstract1_t* a1, [ref]struct ap_abstract1_t* a2)
     quote(call,"_res = ap_abstract1_join(man,false,a1,a2);")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"(** Join of a non empty array of abstract values. *)")
struct ap_abstract1_t ap_abstract1_join_array(ap_manager_ptr man, [size_is(size)]struct ap_abstract1_t* array, unsigned int size)
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"(** Add the array of generators to the abstract value (time elapse operator).\n\n The generators should either lines or rays, not vertices. *)")
struct ap_abstract1_t ap_abstract1_add_ray_array(ap_manager_ptr man, [ref]struct ap_abstract1_t* a,
					   [ref]struct ap_generator1_array_t* v)
     quote(call,"_res = ap_abstract1_add_ray_array(man,false,a,v);")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"\n(** {5 Side-effect versions of the previous functions} *)\n")

void ap_abstract1_meet_with(ap_manager_ptr man, [ref]struct ap_abstract1_t* a1, [ref]struct ap_abstract1_t* a2)
	 quote(call,"{\n\
  ap_abstract1_t res = ap_abstract1_meet(man,true,a1,a2);\n\
  value v = Field(_v_a1,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

void ap_abstract1_meet_lincons_array_with(ap_manager_ptr man, [ref]struct ap_abstract1_t* a,
				       [ref]struct ap_lincons1_array_t* v)
	 quote(call,"{\n\
  ap_abstract1_t res = ap_abstract1_meet_lincons_array(man,true,a,v);\n\
  value v = Field(_v_a,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

void ap_abstract1_meet_tcons_array_with(ap_manager_ptr man, [ref]struct ap_abstract1_t* a,
				       [ref]struct ap_tcons1_array_t* v)
	 quote(call,"{\n\
  ap_abstract1_t res = ap_abstract1_meet_tcons_array(man,true,a,v);\n\
  value v = Field(_v_a,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

void ap_abstract1_join_with(ap_manager_ptr man, [ref]struct ap_abstract1_t* a1, [ref]struct ap_abstract1_t* a2)
	 quote(call,"{\n\
  ap_abstract1_t res = ap_abstract1_join(man,true,a1,a2);\n\
  value v = Field(_v_a1,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

void ap_abstract1_add_ray_array_with(ap_manager_ptr man, [ref]struct ap_abstract1_t* a,
				  [ref]struct ap_generator1_array_t* v)
	 quote(call,"{\n\
  ap_abstract1_t res = ap_abstract1_add_ray_array(man,true,a,v);\n\
  value v = Field(_v_a,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Assignement and Substitutions} *)\n")
quote(MLMLI,"(* ============================================================ *)")

quote(MLI,"(** Parallel assignement of an array of dimensions by an array of same size of linear expressions *)")
struct ap_abstract1_t ap_abstract1_assign_linexpr_array(ap_manager_ptr man,
						  [ref]struct ap_abstract1_t* a,
						  [size_is(v3)]ap_var_t* v1,
						    [size_is(v4)]struct ap_linexpr1_t* v2,
						  int v3,int v4,
						  struct ap_abstract1_t* dest)
     quote(call,"\n\
if (v3!=v4) caml_failwith(\"Abstract1.assign_linexpr_array: arrays of different size\");\n\
_res = ap_abstract1_assign_linexpr_array(man,false,a,v1,v2,v3,dest);\n\
")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"(** Parallel substitution of an array of dimensions by an array of same size of linear expressions *)")
struct ap_abstract1_t ap_abstract1_substitute_linexpr_array(ap_manager_ptr man,
						      [ref]struct ap_abstract1_t* a,
						      [size_is(v3)]ap_var_t* v1,
						      [size_is(v4)]struct ap_linexpr1_t* v2,
						      int v3, int v4,
						      struct ap_abstract1_t* dest)
     quote(call,"\n\
if (v3!=v4) caml_failwith(\"Abstract1.substitute_linexpr_array: arrays of different size\");\n\
_res = ap_abstract1_substitute_linexpr_array(man,false,a,v1,v2,v3,dest);\n\
")
      quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"(** Parallel assignement of an array of dimensions by an array of same size of tree expressions *)")
struct ap_abstract1_t ap_abstract1_assign_texpr_array(ap_manager_ptr man,
						  [ref]struct ap_abstract1_t* a,
						  [size_is(v3)]ap_var_t* v1,
						    [size_is(v4)]struct ap_texpr1_t* v2,
						  int v3,int v4,
						  struct ap_abstract1_t* dest)
     quote(call,"\n\
if (v3!=v4) caml_failwith(\"Abstract1.assign_texpr_array: arrays of different size\");\n\
_res = ap_abstract1_assign_texpr_array(man,false,a,v1,v2,v3,dest);\n\
")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"(** Parallel substitution of an array of dimensions by an array of same size of tree expressions *)")
struct ap_abstract1_t ap_abstract1_substitute_texpr_array(ap_manager_ptr man,
						      [ref]struct ap_abstract1_t* a,
						      [size_is(v3)]ap_var_t* v1,
						      [size_is(v4)]struct ap_texpr1_t* v2,
						      int v3, int v4,
						      struct ap_abstract1_t* dest)
     quote(call,"\n\
if (v3!=v4) caml_failwith(\"Abstract1.substitute_texpr_array: arrays of different size\");\n\
_res = ap_abstract1_substitute_texpr_array(man,false,a,v1,v2,v3,dest);\n\
")
      quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"\n(** {5 Side-effect versions of the previous functions} *)\n")

void ap_abstract1_assign_linexpr_array_with(ap_manager_ptr man,
					 [ref]struct ap_abstract1_t* a,
					 [size_is(v3)]ap_var_t* v1,
					 [size_is(v4)]struct ap_linexpr1_t* v2,
					 int v3,int v4,
					 struct ap_abstract1_t* dest)
  quote(call,"\n\
if (v3!=v4) caml_failwith(\"Abstract1.assign_linexpr_array_with: arrays of different size\");\n\
{\n\
  ap_abstract1_t res = ap_abstract1_assign_linexpr_array(man,true,a,v1,v2,v3,dest);\n\
  value v = Field(_v_a,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

void ap_abstract1_substitute_linexpr_array_with(ap_manager_ptr man,
					     [ref]struct ap_abstract1_t* a,
					     [size_is(v3)]ap_var_t* v1,
					     [size_is(v4)]struct ap_linexpr1_t* v2,
					     int v3, int v4,
					     struct ap_abstract1_t* dest)
  quote(call,"\n\
if (v3!=v4) caml_failwith(\"Abstract1.substitute_linexpr_array_with: arrays of different size\");\n\
{\n\
  ap_abstract1_t res = ap_abstract1_substitute_linexpr_array(man,true,a,v1,v2,v3,dest);\n\
  value v = Field(_v_a,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

void ap_abstract1_assign_texpr_array_with(ap_manager_ptr man,
					  [ref]struct ap_abstract1_t* a,
					  [size_is(v3)]ap_var_t* v1,
					  [size_is(v4)]struct ap_texpr1_t* v2,
					  int v3, int v4,
					  struct ap_abstract1_t* dest)
  quote(call,"\n\
if (v3!=v4) caml_failwith(\"Abstract1.assign_texpr_array_with: arrays of different size\");\n\
{\n\
  ap_abstract1_t res = ap_abstract1_assign_texpr_array(man,true,a,v1,v2,v3,dest);\n\
  value v = Field(_v_a,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

void ap_abstract1_substitute_texpr_array_with(ap_manager_ptr man,
					     [ref]struct ap_abstract1_t* a,
					     [size_is(v3)]ap_var_t* v1,
					     [size_is(v4)]struct ap_texpr1_t* v2,
					     int v3, int v4,
					     struct ap_abstract1_t* dest)
  quote(call,"\n\
if (v3!=v4) caml_failwith(\"Abstract1.substitute_texpr_array_with: arrays of different size\");\n\
{\n\
  ap_abstract1_t res = ap_abstract1_substitute_texpr_array(man,true,a,v1,v2,v3,dest);\n\
  value v = Field(_v_a,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Projections} *)\n")
quote(MLMLI,"(* ============================================================ *)")

quote(MLI,"(** These functions implements forgeting (existential quantification) of (array of) variables. Both functional and side-effect versions are provided. The Boolean, if true, adds a projection onto 0-plane. *)\n\n")

struct ap_abstract1_t ap_abstract1_forget_array(ap_manager_ptr man, [ref]struct ap_abstract1_t* a,
					  [size_is(v2)]ap_var_t* v1, unsigned int v2, boolean v3)
     quote(call,"_res = ap_abstract1_forget_array(man,false,a,v1,v2,v3);")
     quote(dealloc,"I0_CHECK_EXC(man)");
void ap_abstract1_forget_array_with(ap_manager_ptr man, [ref]struct ap_abstract1_t* a, [size_is(v2)]ap_var_t* v1, int v2, boolean v3)
     quote(call,"{\n\
  ap_abstract1_t res = ap_abstract1_forget_array(man,true,a,v1,v2,v3);
  value v = Field(_v_a,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Change and permutation of dimensions} *)\n")
quote(MLMLI,"(* ============================================================ *)")

quote(MLI,"(** Change the environement of the abstract values.\n\nVariables that are removed are first existentially quantified, and variables that are introduced are unconstrained. The Boolean, if true, adds a projection onto 0-plane for these ones. *)")
struct ap_abstract1_t ap_abstract1_change_environment(ap_manager_ptr man,
						 [ref]struct ap_abstract1_t* a,
						 ap_environment_ptr v1,
						 boolean v2)
     quote(call,"_res = ap_abstract1_change_environment(man,false,a,v1,v2);")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"(** Remove from the environment of the abstract value and from the abstract value itself variables that are unconstrained in it. *)")
struct ap_abstract1_t ap_abstract1_minimize_environment(ap_manager_ptr man, [ref]struct ap_abstract1_t* a)
     quote(call,"_res = ap_abstract1_minimize_environment(man,false,a);")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"(** Parallel renaming of the environment of the abstract value.\n\nThe new variables should not interfere with the variables that are not renamed. *)")
struct ap_abstract1_t ap_abstract1_rename_array(ap_manager_ptr man, [ref]struct ap_abstract1_t* a,
					  [size_is(v3)]ap_var_t* v1, [size_is(v4)]ap_var_t* v2,
					  unsigned int v3, unsigned int v4)
     quote(call,"\n\
if (v3!=v4) caml_failwith(\"Abstract1.rename_array: arrays of different size\");\n\
_res = ap_abstract1_rename_array(man,false,a,v1,v2,v3);\n\
")
      quote(dealloc,"I0_CHECK_EXC(man)");

void ap_abstract1_change_environment_with(ap_manager_ptr man,
				       [ref]struct ap_abstract1_t* a,
				       ap_environment_ptr v1,
				       boolean v2)
     quote(call,"\
{\n\
  ap_environment_t* oldenv = ap_environment_copy(a->env);\n		\
  ap_abstract1_t res = ap_abstract1_change_environment(man,true,a,v1,v2);\n\
  value v = Field(_v_a,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
  if (res.env==oldenv){\n\
    ap_environment_free(oldenv);\n\
  }\n\
  else {\n\
    assert(res.env==v1);\n\
    Store_field(_v_a,1,_v_v1);\n\
  }\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

void ap_abstract1_minimize_environment_with(ap_manager_ptr man,
					 [ref]struct ap_abstract1_t* a)
     quote(call,"{\n\
  ap_environment_t* oldenv = ap_environment_copy(a->env);\n		\
  ap_abstract1_t res = ap_abstract1_minimize_environment(man,true,a);\n\
  value v = Field(_v_a,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
  if (res.env==oldenv){\n\
    ap_environment_free(oldenv);\n\
  }\n\
  else {\n\
    v = camlidl_apron_environment_ptr_c2ml(&res.env); \n\
    Store_field(_v_a,1,v); \n\
  }\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

void ap_abstract1_rename_array_with(ap_manager_ptr man, [ref]struct ap_abstract1_t* a,
				 [size_is(v3)]ap_var_t* v1, [size_is(v4)]ap_var_t* v2,
				 unsigned int v3, unsigned int v4)
     quote(call,"\n\
if (v3!=v4) caml_failwith(\"Abstract1.rename_array_with: arrays of different size\");\n\
{\n\
  ap_environment_t* oldenv = ap_environment_copy(a->env);\n		\
  ap_abstract1_t res = ap_abstract1_rename_array(man,true,a,v1,v2,v3);\n\
  value v = Field(_v_a,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
  if (res.env==oldenv){\n\
    ap_environment_free(oldenv);\n\
  }\n\
  else {\n\
    v = camlidl_apron_environment_ptr_c2ml(&res.env); \n\
    Store_field(_v_a,1,v); \n\
  }\n\
}")
      quote(dealloc,"I0_CHECK_EXC(man)");


quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Expansion and folding of dimensions} *)\n")
quote(MLMLI,"(* ============================================================ *)")


quote(MLI,"\n\
(**\n\
  These functions allows to expand one dimension into several ones having the\n\
  same properties with respect to the other dimensions, and to fold several\n\
  dimensions into one. Formally,\n\
\n\
  - expand P(x,y,z) z w = P(x,y,z) inter P(x,y,w) if z is expanded in z and w\n\
  - fold Q(x,y,z,w) z w = exists w:Q(x,y,z,w) union (exist z:Q(x,y,z,w))(z<-w)\n\
    if z and w are folded onto z\n\
*)\n\n\
")

quote(MLI,"(** \
    Expansion: [expand a var tvar] expands the variable [var] into itself and\n	\
    the additional variables in [tvar], which are given the same type as [var].\n\n\
    It results in (n+1) unrelated variables having\n			\
    same relations with other variables. The additional variables are added to the environment of \n\
    the argument for making the environment of the result, so they should\n\
    not belong to the initial environement.\n\
*)")
struct ap_abstract1_t ap_abstract1_expand(ap_manager_ptr man, [ref]struct ap_abstract1_t* a,
				    ap_var_t v1,
				    [size_is(v3)]ap_var_t* v2,
				    int v3)
     quote(call,"_res = ap_abstract1_expand(man,false,a,v1,v2,v3);")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI," \
  (** Folding: [fold a tvar] fold the variables in the array [tvar] of size n>=1\n\
    and put the result in the first variable of the array. The other\n\
    variables of the array are then removed, both from the environment and the abstract value.\n\
  *)")
struct ap_abstract1_t ap_abstract1_fold(ap_manager_ptr man, [ref]struct ap_abstract1_t* a,
				  [size_is(v2)]ap_var_t* v1,
				  int v2)
  quote(call,"_res = ap_abstract1_fold(man,false,a,v1,v2);")
     quote(dealloc,"I0_CHECK_EXC(man)");

void ap_abstract1_expand_with(ap_manager_ptr man, [ref]struct ap_abstract1_t* a,
			   ap_var_t v1,
			   [size_is(v3)]ap_var_t* v2,
			   int v3)
     quote(call,"{\n\
  ap_environment_t* oldenv = ap_environment_copy(a->env);\n		\
  ap_abstract1_t res = ap_abstract1_expand(man,true,a,v1,v2,v3);
  value v = Field(_v_a,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
  if (res.env==oldenv){\n\
    ap_environment_free(oldenv);\n\
  }\n\
  else {\n\
    v = camlidl_apron_environment_ptr_c2ml(&res.env); \n\
    Store_field(_v_a,1,v); \n\
  }\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

void ap_abstract1_fold_with(ap_manager_ptr man, [ref]struct ap_abstract1_t* a,
			 [size_is(v2)]ap_var_t* v1,
			 int v2)
     quote(call,"{\n\
  ap_environment_t* oldenv = ap_environment_copy(a->env);\n		\
  ap_abstract1_t res = ap_abstract1_fold(man,true,a,v1,v2);
  value v = Field(_v_a,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
  if (res.env==oldenv){\n\
    ap_environment_free(oldenv);\n\
  }\n\
  else {\n\
    v = camlidl_apron_environment_ptr_c2ml(&res.env); \n\
    Store_field(_v_a,1,v); \n\
  }\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Widening} *)\n")
quote(MLMLI,"(* ============================================================ *)")

quote(MLI,"(** Widening *)")
struct ap_abstract1_t ap_abstract1_widening(ap_manager_ptr man,
				      [ref]struct ap_abstract1_t* a1,
				      [ref]struct ap_abstract1_t* a2)
     quote(dealloc,"I0_CHECK_EXC(man)");

struct ap_abstract1_t ap_abstract1_widening_threshold(ap_manager_ptr man,
						[ref]struct ap_abstract1_t* a1,
						[ref]struct ap_abstract1_t* a2,
						[ref]struct ap_lincons1_array_t* v)
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLMLI,"(* ============================================================ *)")
quote(MLMLI,"(** {3 Closure operation} *)\n")
quote(MLMLI,"(* ============================================================ *)")

quote(MLI,"(** Closure: transform strict constraints into non-strict ones.*)")
struct ap_abstract1_t ap_abstract1_closure(ap_manager_ptr man,[ref]struct ap_abstract1_t* a)
     quote(call,"_res = ap_abstract1_closure(man,false,a);")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(MLI,"(** Side-effect version *)")
void ap_abstract1_closure_with(ap_manager_ptr man,[ref]struct ap_abstract1_t* a)
     quote(call,"{\n\
  ap_abstract1_t res = ap_abstract1_closure(man,true,a);
  value v = Field(_v_a,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");
quote(MLMLI,"(* ********************************************************************** *)")
quote(MLMLI,"(** {2 Additional operations} *)")
quote(MLMLI,"(* ********************************************************************** *)")

quote(MLI,"\n\
val of_lincons_array : 'a Manager.t -> Environment.t -> Lincons1.earray -> 'a t\n\
val of_tcons_array   : 'a Manager.t -> Environment.t -> Tcons1.earray   -> 'a t\n\
  (** Abstract a conjunction of constraints *)\n\
\n\
val assign_linexpr     : 'a Manager.t -> 'a t -> Var.t -> Linexpr1.t -> 'a t option -> 'a t\n\
val substitute_linexpr : 'a Manager.t -> 'a t -> Var.t -> Linexpr1.t -> 'a t option -> 'a t\n\
val assign_texpr       : 'a Manager.t -> 'a t -> Var.t -> Texpr1.t   -> 'a t option -> 'a t\n\
val substitute_texpr   : 'a Manager.t -> 'a t -> Var.t -> Texpr1.t   -> 'a t option -> 'a t\n\
  (** Assignement/Substitution of a single dimension by a single expression *)\n\
\n\
val assign_linexpr_with     : 'a Manager.t -> 'a t -> Var.t -> Linexpr1.t -> 'a t option -> unit\n\
val substitute_linexpr_with : 'a Manager.t -> 'a t -> Var.t -> Linexpr1.t -> 'a t option -> unit\n\
val assign_texpr_with       : 'a Manager.t -> 'a t -> Var.t -> Texpr1.t   -> 'a t option -> unit\n\
val substitute_texpr_with   : 'a Manager.t -> 'a t -> Var.t -> Texpr1.t   -> 'a t option -> unit\n\
  (** Side-effect version of the previous functions *)\n\
\n\
")

quote(ML,"\n\
let of_lincons_array man env array =\n\
  let res = top man env in\n\
  meet_lincons_array_with man res array;\n\
  res\n\
let of_tcons_array man env array =\n\
  let res = top man env in\n\
  meet_tcons_array_with man res array;\n\
  res\n\
let assign_linexpr man abs dim expr odest =\n\
  assign_linexpr_array man abs [|dim|] [|expr|] odest\n\
let assign_texpr man abs dim expr odest =\n\
  assign_texpr_array man abs [|dim|] [|expr|] odest\n\
let substitute_linexpr man abs dim expr odest =\n\
  substitute_linexpr_array man abs [|dim|] [|expr|] odest\n\
let substitute_texpr man abs dim expr odest =\n\
  substitute_texpr_array man abs [|dim|] [|expr|] odest\n\
let assign_linexpr_with man abs dim expr odest =\n\
  assign_linexpr_array_with man abs [|dim|] [|expr|] odest\n\
let assign_texpr_with man abs dim expr odest =\n\
  assign_texpr_array_with man abs [|dim|] [|expr|] odest\n\
let substitute_linexpr_with man abs dim expr odest =\n\
  substitute_linexpr_array_with man abs [|dim|] [|expr|] odest\n\
let substitute_texpr_with man abs dim expr odest =\n\
  substitute_texpr_array_with man abs [|dim|] [|expr|] odest\n\
")

quote(MLI,"(** Unification of 2 abstract values on their least common environment *)")
struct ap_abstract1_t ap_abstract1_unify(ap_manager_ptr man, [ref]struct ap_abstract1_t* a1, [ref]struct ap_abstract1_t* a2)
     quote(call,"_res = ap_abstract1_unify(man,false,a1,a2);")
     quote(dealloc,"I0_CHECK_EXC(man)");
quote(MLI,"(** Side-effect version *)")
void ap_abstract1_unify_with(ap_manager_ptr man, [ref]struct ap_abstract1_t* a1, [ref]struct ap_abstract1_t* a2)
	 quote(call,"\
{\n\
  ap_abstract1_t res = ap_abstract1_unify(man,true,a1,a2);\n\
  value v = Field(_v_a1,0);\n\
  *((ap_abstract0_ptr *) Data_custom_val(v)) = res.abstract0;\n\
  v = Field(_v_a1,1);\n\
  *((ap_environment_ptr *) Data_custom_val(v)) = res.env;\n\
}")
     quote(dealloc,"I0_CHECK_EXC(man)");

quote(ML,"\n\
let print fmt a =\n\
let man = manager a in\n\
if is_bottom man a then\n\
  Format.pp_print_string fmt \"bottom\"\n\
else if is_top man a then\n\
  Format.pp_print_string fmt \"top\"\n\
else begin\n\
  let tab = to_lincons_array man a in\n\
  Lincons1.array_print fmt tab;\n\
end\n\
")