From 8e0ff7564e815489b3fbc3af442c098926ed3a51 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 28 Jun 2017 23:46:28 -0700 Subject: [PATCH] Add some comments for Hamed --- src/AST/element.c | 5 +++++ src/Backend/satencoder.c | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/AST/element.c b/src/AST/element.c index f5cd301..8379983 100644 --- a/src/AST/element.c +++ b/src/AST/element.c @@ -50,6 +50,11 @@ Set* getElementSet(Element* This){ return NULL; } +FIXME()!!!! + +/** This function belongs in the backend...Elements should not touch + binary constraints nor should they touch their encoders... */ + Constraint * getElementValueBinaryIndexConstraint(Element* This, uint64_t value) { ASTNodeType type = GETELEMENTTYPE(This); ASSERT(type == ELEMSET || type == ELEMFUNCRETURN); diff --git a/src/Backend/satencoder.c b/src/Backend/satencoder.c index 94d19c8..24859be 100644 --- a/src/Backend/satencoder.c +++ b/src/Backend/satencoder.c @@ -22,6 +22,13 @@ void deleteSATEncoder(SATEncoder *This) { } void initializeConstraintVars(CSolver* csolver, SATEncoder* This){ + /** We really should not walk the free list to generate constraint + variables...walk the constraint tree instead. Or even better + yet, just do this as you need to during the encodeAllSATEncoder + walk. */ + + FIXME!!!!(); // Make sure Hamed sees comment above + uint size = getSizeVectorElement(csolver->allElements); for(uint i=0; iallElements, i); @@ -174,7 +181,10 @@ Constraint* encodeEnumTableElemFunctionSATEncoder(SATEncoder* encoder, ElementFu Element* el= getArrayElement(elements, i); Constraint* carray[inputNum]; for(uint j=0; jinputs[j]); + FIXME!!!!(); + //This next line should not assume a particular encoding type for the element... just a generic element encoding function that should choose the appropriate encoding... + + carray[inputNum] = getElementValueBinaryIndexConstraint(el, entry->inputs[j]); } Constraint* row= allocConstraint(IMPLIES, allocArrayConstraint(AND, inputNum, carray), getElementValueBinaryIndexConstraint((Element*)This, entry->output)); -- 2.34.1