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;
}
|