File: CADautoConst.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 (44 lines) | stat: -rw-r--r-- 1,288 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
/*======================================================================
                      CADautoConst(Word Fs)

CAD Atuomatic (i.e. non-interactive) Construction

NOTE:  Assumes the QepcadCAD already has all the relvent fields
       initialized - i.e. GVF, etc.

Side Effects
This is a member function of a QepcadCls object.  Calling this function
actually constructs the CAD data structure associated to the object.
What gets constructed is a CAD for the formula Fs.  If the GVUA has
been set to something other than NIL, those assumptions are used.
======================================================================*/
#include "qepcad.h"

void QepcadCls::CADautoConst()
{
       Word A,D,F,Fh,J,P,Q,f,r;

Step1: /* Normalize. */
       FIRST4(GVF,&r,&f,&Q,&Fh);
       F = NORMQFF(Fh);
       if (GVUA != NIL) GVNA = NORMQFF(GVUA);
       GVNQFF = F;
       if (TYPEQFF(F) != UNDET) { goto Return; }

Step2: /* Projection. */
       if (GVUA != NIL) F = LIST3(ANDOP,GVNA,F);
       A = EXTRACT(r,F);
       if (GVUA != NIL) {
	 GVNA = SECOND(F);
	 F = THIRD(F); }
       GVNIP = A;
       GVPF = LLCOPY(A);
       GVLV = r;
       PROJECTauto(r,A,&P,&J);

Step3: /* Truth-invariant CAD. */
       D = TICADauto(Q,F,f,P,A);

Return: /* Prepare for return. */
       return;
}