File: TICADauto.c

package info (click to toggle)
qepcad 1.74%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,848 kB
  • sloc: ansic: 27,242; cpp: 2,995; makefile: 1,287; perl: 91
file content (69 lines) | stat: -rw-r--r-- 1,771 bytes parent folder | download | duplicates (2)
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
/*======================================================================
                      D <- TICAD(Q,F,f,P,A)

Truth Invariant CAD Construction Phase.
     
\Input
  \parm{Q} is the list of quantifiers
           in the input formula.
  \parm{F} $=F(x_1,\ldots,x_r)$
           is the normalized input quantifier-free formula.
  \parm{f} is the number of free variables in the input formula.
  \parm{P} is the list~$(P_1,\ldots,P_r)$, 
           where $P_i$ is the list of
           $i$--level projection factors.
  \parm{A} is the list~$(A_1,\ldots,A_r)$,
           where $A_i$ is the list of all
           the distinct $i$--level normalized input polynomials.
 
Output
  \parm{D} is a truth--invariant partial CAD of $f$--space
           in which every leaf cell has a determined truth value.
======================================================================*/
#include "qepcad.h"

Word QepcadCls::TICADauto(Word Q, Word F, Word f, Word P, Word A)
{
       Word As,D,Ps,c,k,s,sh,t;

Step1: /* Initialize. */
       D = INITPCAD();

Step2: /* Choose. */
       GVPC = D;
       P = GVPF;
       CHOOSE(D,&t,&c); 
       if (t == 0 && PCUSEDES == 'n') goto Return;
       k = LELTI(c,LEVEL);
       GVLV = k;                        
       if (k == 0) goto Step4;

Step3: /* Convert. */
       s = LELTI(c,SAMPLE); 
       sh = CONVERT(s,k);
       SLELTI(c,SAMPLE,sh);

Step4: /* Construct stack. */
       Ps = LELTI(P,k + 1); As = LELTI(A,k + 1);
    
       CONSTRUCT(c,k,f,Ps,As);

Step5: /* Evaluate. */
       EVALUATE(c,k,F,A);

Step6: /* Apply equational constraints. */
	if (PCPROPEC == TRUE)
	   APEQC(c,k,P);

Step7: /* Propagate. */
       PROPAGATE(D,c,k,f,Q);
       goto Step2;

Return: /* Prepare for return. */
       return(D);
}