aboutsummaryrefslogtreecommitdiff
path: root/ic-reals-6.3/base/gteq0.c
blob: 80afce98d6df8c5313fc5d8b582788bd845d94b0 (plain)
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
/*
 * Copyright (C) 2000, Imperial College
 *
 * This file is part of the Imperial College Exact Real Arithmetic Library.
 * See the copyright notice included in the distribution for conditions
 * of use.
 */

#include <stdio.h>
#include "real.h"
#include "real-impl.h"

/*
 * This file contains everything to do with the predicate x >= 0.
 */

#define forceGtEqZero_To_PredX_From_DigsX_SPOS_Entry \
			force_To_PredX_From_DigsX_2n_minus_1_True_Entry

void setPredX(PredX *, BoolVal);
void absorbDigsXIntoPredX(PredX *);
void absorbSignXIntoPredX(PredX *);
void force_To_PredX_From_The_Abyss();
static BoolVal gtEq_Vec_0(Vec *);
static BoolVal gtEq_MatX_0(MatX *);

void setGtZeroPredXMethod(PredX *);

/*
 * There are many cases when computing predicates over the reals. First of
 * all, we handle vectors, matrices and streams differently. To understand
 * the vector and matrices, assume a function (sgn n) which yields the
 * sign (-1,0,1) of a large integer. Vectors are simple, For matrices,
 * we need to determine if (info m) is in the interval [0,infty). This can
 * be done by inspecting only the signs of the entries in the matrix. The
 * proof that the following algorithm works is straightforward bearing in
 * mind the definition of (info m). Note that this applies only when
 * the argument of the matrix is unsigned.
 * 
 * mat_gtEq_0 ((a,b),(c,d)) =
 *   if ((sgn a) * (sgn b) >= 0)
 * 	  && ((sgn c) * (sgn d) >= 0) && ((sgn b) * (sgn d) > 0) then
 *     True else
 *     if ((sgn a) * (sgn b) < 0)
 * 	  && ((sgn c) * (sgn d) < 0) && ((sgn b) * (sgn d) > 0) then
 *        False else
 *        Unknown
 * 
 * The conditionals can be sorted to eliminate redundant comparisons to yield
 * the following decision procedure.
 *  
 * mat_gtEq_0 ((a,b),(c,d)) =
 *   if (sgn b) * (sgn d) > 0 then
 *     if (sgn a) * (sgn b) >= 0 then
 *       if (sgn c) * (sgn d) >= 0 then
 *         True
 *       else
 *         Unkown
 *     else
 *       if (sgn c) * (sgn d) < 0 then
 *         False
 *       else
 *         Unknown
 *   else
 *     Unknown
 * 
 * No doubt a similar scheme works for tensors but this has not been coded.
 * Right now we deal with the digit streams emitted from the tensor. The
 * algorithm for handling digit streams is described elsewhere.
 */

Bool
gtEq_R_0(Real x)
{
	PredX *predX;
	PredX *allocPredX();
	void setGtEqZeroPredXMethod(PredX *);

	predX = allocPredX(x);
	setGtEqZeroPredXMethod(predX);
	return (Bool) predX;
}

void
setGtEqZeroPredXMethod(PredX *predX)
{
	void forceGtEqZero_To_PredX_From_SignX_Entry();
	void forceGtEqZero_To_PredX_From_DigsX_SPOS_Entry();
	void forceGtEqZero_To_PredX_From_MatX_Entry();
	void forceGtEqZero_To_PredX_From_MatX_Signed_Entry();
	void forceGtEqZero_To_PredX_From_TenXY();
	void forceGtEqZero_To_PredX_From_Alt_Entry();
	void forceGtEqZero_To_PredX_From_Cls_Entry();

	switch (predX->x->gen.tag.type) {
	case VECTOR :
		setPredX(predX, gtEq_Vec_0((Vec *) predX->x));
		predX->force = force_To_PredX_From_The_Abyss;
		break;
	case MATX :
		if (predX->x->matX.x->gen.tag.isSigned)
			predX->force = forceGtEqZero_To_PredX_From_MatX_Signed_Entry;
		else {
			setPredX(predX, gtEq_MatX_0((MatX *) predX->x));
			predX->force = forceGtEqZero_To_PredX_From_MatX_Entry;
		}
		break;
	case TENXY :
		predX->force = forceGtEqZero_To_PredX_From_TenXY;
		break;
	case SIGNX :
		predX->force = forceGtEqZero_To_PredX_From_SignX_Entry;
		break;
	case DIGSX :
		predX->force = forceGtEqZero_To_PredX_From_DigsX_SPOS_Entry;
		break;
	case CLOSURE :
		predX->force = forceGtEqZero_To_PredX_From_Cls_Entry;
		break;
	case ALT :
		predX->force = forceGtEqZero_To_PredX_From_Alt_Entry;
		break;
	default :
		Error(FATAL, E_INT, "compareGtEqZero", "argument is not a stream");
	}
}

void
forceGtEqZero_To_PredX_From_Alt_Entry()
{
	PredX *predX;
	Alt *alt;
	void force_To_Alt_Entry();
	void forceGtEqZero_To_PredX_From_Alt_Cont();

	predX = (PredX *) POP;
	alt = (Alt *) predX->x;
	
	PUSH_2(forceGtEqZero_To_PredX_From_Alt_Cont, predX);

	/*
	 * If alt->redirect is not valid (equals NULL) then the value of
	 * the conditional has not been determined so we need to force it.
	 */
	if (alt->redirect == NULL)
		PUSH_2(force_To_Alt_Entry, alt);
}

void
forceGtEqZero_To_PredX_From_Alt_Cont()
{
	PredX *predX;
	Alt *alt;

	predX = (PredX *) POP;
	alt = (Alt *) predX->x;

#ifdef DAVINCI
	beginGraphUpdate();
	deleteOnlyEdge(predX, alt);
	newEdgeToOnlyChild(predX, alt->redirect);
	endGraphUpdate();
#endif
	predX->x = alt->redirect;
	setGtEqZeroPredXMethod(predX);

	PUSH_2(predX->force, predX);
}

void
forceGtEqZero_To_PredX_From_Cls_Entry()
{
	PredX *predX;
	Cls *cls;
	void forceGtEqZero_To_PredX_From_Cls_Cont();

	predX = (PredX *) POP;
	cls = (Cls *) predX->x;
	
	PUSH_2(forceGtEqZero_To_PredX_From_Cls_Cont, predX);

	/*
	 * If cls->redirect is not valid (equals NULL) then the value of
	 * the closure has not been determined so we need to force it.
	 */
	if (cls->redirect == NULL)
		PUSH_2(cls->force, cls);
}

void
forceGtEqZero_To_PredX_From_Cls_Cont()
{
	PredX *predX;
	Cls *cls;

	predX = (PredX *) POP;
	cls = (Cls *) predX->x;

#ifdef DAVINCI
	beginGraphUpdate();
	deleteOnlyEdge(predX, cls);
	newEdgeToOnlyChild(predX, cls->redirect);
	endGraphUpdate();
#endif
	predX->x = cls->redirect;
	setGtEqZeroPredXMethod(predX);

	PUSH_2(predX->force, predX);
}

/*
 * If we get here then we need to get more information into the matrix.
 */
void
forceGtEqZero_To_PredX_From_MatX_Entry()
{
	PredX *predX;
	MatX *matX;
	void forceGtEqZero_To_PredX_From_MatX_Cont();

	predX = (PredX *) POP;
	matX = (MatX *) predX->x;

	if (matX->tag.type == VECTOR) {
		setPredX(predX, gtEq_Vec_0((Vec *) matX));
		predX->force = force_To_PredX_From_The_Abyss;
		return;
	}

	PUSH_2(forceGtEqZero_To_PredX_From_MatX_Cont, predX);
	PUSH_3(predX->x->matX.force, predX->x, defaultForceCount);
}

void
forceGtEqZero_To_PredX_From_MatX_Cont()
{
	PredX *predX;
	MatX *matX;

	predX = (PredX *) POP;
	matX = (MatX *) predX->x;

	if (matX->tag.type == VECTOR) {
		setPredX(predX, gtEq_Vec_0((Vec *) matX));
		predX->force = force_To_PredX_From_The_Abyss;
		return;
	}
	setPredX(predX, gtEq_MatX_0((MatX *) (predX->x)));
}

/*
 * If we get here then we need to get more information into the matrix.
 */
void
forceGtEqZero_To_PredX_From_MatX_Signed_Entry()
{
	PredX *predX;
	MatX *matX;
	void forceGtEqZero_To_PredX_From_MatX_Signed_Cont();

	predX = (PredX *) POP;
	matX = (MatX *) predX->x;

	if (matX->tag.type == VECTOR) {
		setPredX(predX, gtEq_Vec_0((Vec *) matX));
		predX->force = force_To_PredX_From_The_Abyss;
		return;
	}

	PUSH_2(forceGtEqZero_To_PredX_From_MatX_Signed_Cont, predX);

	if (matX->x->gen.tag.isSigned)
		PUSH_2(matX->force, matX);
}

void
forceGtEqZero_To_PredX_From_MatX_Signed_Cont()
{
	PredX *predX;
	MatX *matX;
	void forceGtEqZero_To_PredX_From_MatX_Entry();

	predX = (PredX *) POP;
	matX = (MatX *) predX->x;

	if (matX->tag.type == VECTOR) {
		setPredX(predX, gtEq_Vec_0((Vec *) matX));
		predX->force = force_To_PredX_From_The_Abyss;
		return;
	}
	predX->force = forceGtEqZero_To_PredX_From_MatX_Entry;
	setPredX(predX, gtEq_MatX_0(matX));
}

void
forceGtEqZero_To_PredX_From_TenXY()
{
	PredX *predX;
	TenXY *tenXY;
	void forceGtEqZero_To_PredX_From_SignX_Entry();
	void forceGtEqZero_To_PredX_From_DigsX_SPOS_Entry();

	predX = (PredX *) POP;
	tenXY = (TenXY *) predX->x;

	/*
	 * The tensor may have reduced to a vector
	 */
	if (tenXY->tag.type == VECTOR) {
		setPredX(predX, gtEq_Vec_0((Vec *) tenXY));
		predX->force = force_To_PredX_From_The_Abyss;
		return;
	}

	/*
	 * The tensor may have reduced to a matrix (signed or otherwise)
	 */
	if (tenXY->tag.type == MATX) {
		if (predX->x->matX.x->gen.tag.isSigned) {
			predX->force = forceGtEqZero_To_PredX_From_MatX_Signed_Entry;
			PUSH_2(predX->force, predX);
		}
		else {
			setPredX(predX, gtEq_MatX_0((MatX *) predX->x));
			predX->force = forceGtEqZero_To_PredX_From_MatX_Entry;
		}
		return;
	}

	if (tenXY->tag.isSigned) {
		createSignedStreamForTenXY(tenXY);
#ifdef DAVINCI
		beginGraphUpdate();
		deleteOnlyEdge(predX, predX->x);
		newEdgeToOnlyChild(predX, tenXY->strm);
		endGraphUpdate();
#endif
		predX->x = tenXY->strm;
		predX->force = forceGtEqZero_To_PredX_From_SignX_Entry;
		PUSH_2(predX->force, predX);
	}
	else {
		createUnsignedStreamForTenXY(tenXY);
#ifdef DAVINCI
		beginGraphUpdate();
		deleteOnlyEdge(predX, predX->x);
		newEdgeToOnlyChild(predX, tenXY->strm);
		endGraphUpdate();
#endif
		predX->x = tenXY->strm;
		predX->force = forceGtEqZero_To_PredX_From_DigsX_SPOS_Entry;
		PUSH_2(predX->force, predX);
	}
}

void
forceGtEqZero_To_PredX_From_SignX_Entry()
{
	PredX *predX;
	SignX *signX;
	void forceGtEqZero_To_PredX_From_SignX_Cont();

	predX = (PredX *) POP;
	signX = (SignX *) predX->x;

	PUSH_2(forceGtEqZero_To_PredX_From_SignX_Cont, predX);

	if (signX->tag.value == SIGN_UNKN)
		PUSH_2(signX->force, signX);
}

/*
 * At this point we know the sign is valid so we ``absorb'' it. In this
 * case that means that we have to inspect the sign and reset the methods
 * before advancing to the first characteristic pair.
 */
void
forceGtEqZero_To_PredX_From_SignX_Cont()
{
	PredX *predX;
	SignX *signX;
	void forceGtEqZero_To_PredX_From_DigsX_SPOS_Entry();
	void forceGtEqZero_To_PredX_From_DigsX_SNEG_Entry();
	void forceGtEqZero_To_PredX_From_DigsX_SZERO_Entry();
	void forceGtEqZero_To_PredX_From_DigsX_SINF_Entry();

	predX = (PredX *) POP;
	signX = (SignX *) predX->x;

	switch (signX->tag.value) {
	case SPOS :
		predX->force = forceGtEqZero_To_PredX_From_DigsX_SPOS_Entry;
		break;
	case SNEG :
		predX->force = forceGtEqZero_To_PredX_From_DigsX_SNEG_Entry;
		break;
	case SZERO :
		predX->force = forceGtEqZero_To_PredX_From_DigsX_SZERO_Entry;
		break;
	case SINF :
		predX->force = forceGtEqZero_To_PredX_From_DigsX_SINF_Entry;
		break;
	default :
		Error(FATAL, E_INT, "forceGtEqZero_To_PredX_From_SignX_Cont",
				"invalid sign");
	}

	absorbSignXIntoPredX(predX);

	PUSH_2(predX->force, predX);
}

void
forceGtEqZero_To_PredX_From_DigsX_SNEG_Entry()
{
	PredX *predX;
	DigsX *digsX;
	void forceGtEqZero_To_PredX_From_DigsX_SNEG_Cont();

	predX = (PredX *) POP;
	digsX = (DigsX *) predX->x;
	
	PUSH_2(forceGtEqZero_To_PredX_From_DigsX_SNEG_Cont, predX);
	if (digsX->count == 0)
		PUSH_3(digsX->force, digsX, defaultForceCount);
}

void
forceGtEqZero_To_PredX_From_DigsX_SNEG_Cont()
{
	PredX *predX;
	DigsX *digsX;
	int k;
	void force_To_PredX_From_DigsX_2n_minus_1_False_Entry();
	void force_To_PredX_From_DigsX_minus_2n_minus_1_False_Entry();

	predX = (PredX *) POP;
	digsX = (DigsX *) predX->x;

#ifdef PACK_DIGITS
	if (digsX->count <= DIGITS_PER_WORD) {
		k = (1 << digsX->count) - 1;
		if (digsX->word.small == k) {
			absorbDigsXIntoPredX(predX);
			predX->force = force_To_PredX_From_DigsX_2n_minus_1_False_Entry;
		}
		else {
 			if (digsX->word.small == -k) {
				absorbDigsXIntoPredX(predX);
				predX->force =
						force_To_PredX_From_DigsX_minus_2n_minus_1_False_Entry;
			}
			else
				setPredX(predX, LAZY_FALSE);
		}
	}
	else {
#endif
		/*
		 * This is comparing a big word with +-(2^n - 1). It would be faster
		 * to compare each word with 0xffffffff but this may have to
		 * wait.	####
		 */
		if (mpz_sgn(digsX->word.big) >= 0) {
			if (mpz_popcount(digsX->word.big) == digsX->count) {
				absorbDigsXIntoPredX(predX);
				predX->force = force_To_PredX_From_DigsX_2n_minus_1_False_Entry;
			}
			else
				setPredX(predX, LAZY_FALSE);
		}
		else {
			/*
			 * We negate things here but I don't think it is necessary
			 * since GMP uses sign and magnitude representation 
			 * for big integers. Leave it for now.
			 */
			mpz_neg(digsX->word.big, digsX->word.big);
			if (mpz_popcount(digsX->word.big) == digsX->count) {
				absorbDigsXIntoPredX(predX);
				predX->force =
						force_To_PredX_From_DigsX_minus_2n_minus_1_False_Entry;
			}
			else
				setPredX(predX, LAZY_FALSE);
			mpz_neg(digsX->word.big, digsX->word.big);
		}
#ifdef PACK_DIGITS
	}
#endif
}

void
forceGtEqZero_To_PredX_From_DigsX_SZERO_Entry()
{
	PredX *predX;
	DigsX *digsX;
	void forceGtEqZero_To_PredX_From_DigsX_SZERO_Cont();

	predX = (PredX *) POP;
	digsX = (DigsX *) predX->x;

	PUSH_2(forceGtEqZero_To_PredX_From_DigsX_SZERO_Cont, predX);
	if (digsX->count == 0)
		PUSH_3(digsX->force, digsX, defaultForceCount);
}

void
forceGtEqZero_To_PredX_From_DigsX_SZERO_Cont()
{
	PredX *predX;
	DigsX *digsX;
	void force_To_PredX_From_DigsX_2n_minus_1_False_Entry();

	predX = (PredX *) POP;
	digsX = (DigsX *) predX->x;

#ifdef PACK_DIGITS
	if (digsX->count <= DIGITS_PER_WORD) {
		if (digsX->word.small > 0)
			setPredX(predX, LAZY_TRUE);
		else {
			if (digsX->word.small == 0)
				absorbDigsXIntoPredX(predX);
			else
				if (digsX->word.small == -1) {
					absorbDigsXIntoPredX(predX);
					predX->force =
							force_To_PredX_From_DigsX_2n_minus_1_False_Entry;
				}
				else
					setPredX(predX, LAZY_FALSE);
		}
	}
	else {
#endif
		switch (mpz_sgn(digsX->word.big)) {
		case -1 :
			if (mpz_cmp_si(digsX->word.big, -1) < 0)
				setPredX(predX, LAZY_FALSE);
			else { /* word == -1 */
				absorbDigsXIntoPredX(predX);
				predX->force =
						force_To_PredX_From_DigsX_2n_minus_1_False_Entry;
			}
			break;
		case 0 :
			absorbDigsXIntoPredX(predX);
			break;
		case 1 :
			setPredX(predX, LAZY_TRUE);
			break;
		default :
			Error(FATAL, E_INT, "forceGtEqZero_To_PredX_From_DigsX_SZERO_Cont",
					"bad value returned from mpz_sgn");
		}
#ifdef PACK_DIGITS
	}
#endif
}

void
forceGtEqZero_To_PredX_From_DigsX_SINF_Entry()
{
	PredX *predX;
	DigsX *digsX;
	void forceGtEqZero_To_PredX_From_DigsX_SINF_Cont();

	predX = (PredX *) POP;
	digsX = (DigsX *) predX->x;

	PUSH_2(forceGtEqZero_To_PredX_From_DigsX_SINF_Cont, predX);
	if (digsX->count == 0)
		PUSH_3(digsX->force, digsX, defaultForceCount);
}

void
forceGtEqZero_To_PredX_From_DigsX_SINF_Cont()
{
	PredX *predX;
	DigsX *digsX;
	void force_To_PredX_From_DigsX_2n_minus_1_True_Entry();
	void force_To_PredX_From_DigsX_minus_2n_minus_1_False_Entry();

	predX = (PredX *) POP;
	digsX = (DigsX *) predX->x;

#ifdef PACK_DIGITS
	if (digsX->count <= DIGITS_PER_WORD) {
		if (digsX->word.small > 1)
			setPredX(predX, LAZY_FALSE);
		else {
			if (digsX->word.small == 1) {
				absorbDigsXIntoPredX(predX);
				predX->force =
					force_To_PredX_From_DigsX_minus_2n_minus_1_False_Entry;
			}
			else {
				if (digsX->word.small == 0)
					absorbDigsXIntoPredX(predX);
				else {
					if (digsX->word.small == -1) {
						absorbDigsXIntoPredX(predX);
						predX->force =
							force_To_PredX_From_DigsX_2n_minus_1_True_Entry;
					}
					else
						setPredX(predX, LAZY_TRUE);
				}
			}
		}
	}
	else {
#endif
		switch (mpz_sgn(digsX->word.big)) {
		case -1 :
			if (mpz_cmp_si(digsX->word.big, -1) < 0)
				setPredX(predX, LAZY_TRUE);
			else { /* word == -1 */
				absorbDigsXIntoPredX(predX);
				predX->force =
						force_To_PredX_From_DigsX_2n_minus_1_True_Entry;
			}
			break;
		case 0 :
			absorbDigsXIntoPredX(predX);
			break;
		case 1 :
			if (mpz_cmp_si(digsX->word.big, 1) > 0)
				setPredX(predX, LAZY_FALSE);
			else { /* word == 1 */
				absorbDigsXIntoPredX(predX);
				predX->force =
						force_To_PredX_From_DigsX_minus_2n_minus_1_False_Entry;
			}
			break;
		default :
			Error(FATAL, E_INT, "forceGtEqZero_To_PredX_From_DigsX_SINF_Cont",
					"bad value returned from mpz_sgn");
		}
#ifdef PACK_DIGITS
	}
#endif
}

static BoolVal
gtEq_MatX_0(MatX *matX)
{
	if (mpz_sgn(matX->mat[0][1]) * mpz_sgn(matX->mat[1][1]) > 0) {
		if (mpz_sgn(matX->mat[0][0]) * mpz_sgn(matX->mat[0][1]) >= 0) {
			if (mpz_sgn(matX->mat[1][0]) * mpz_sgn(matX->mat[1][1]) >= 0)
				return LAZY_TRUE;
		}
		else {
			if (mpz_sgn(matX->mat[1][0]) * mpz_sgn(matX->mat[1][1]) < 0)
				return LAZY_FALSE;
		}
	}
	return LAZY_UNKNOWN;
}

static BoolVal
gtEq_Vec_0(Vec *vec)
{
	if (mpz_sgn(vec->vec[1]) != 0) {
		if (mpz_sgn(vec->vec[0]) * mpz_sgn(vec->vec[1]) >= 0)
			return LAZY_TRUE;
		else
			return LAZY_FALSE;
	}
	if (mpz_sgn(vec->vec[0]) == 0)
		Error(FATAL, E_INT, "gtEq_Vec_0", "malformed vector");

	return LAZY_UNKNOWN;
}