}
delete iterator;
}
-
-void orderAnalysis(CSolver *This) {
- uint size = This->allOrders.getSize();
- for (uint i = 0; i < size; i++) {
- Order *order = This->allOrders.get(i);
-
- OrderGraph *graph;
- if(order->graph == NULL){
- graph= buildOrderGraph(order);
- if (order->type == PARTIAL) {
- //Required to do SCC analysis for partial order graphs. It
- //makes sure we don't incorrectly optimize graphs with negative
- //polarity edges
- completePartialOrderGraph(graph);
- }
- }else
- graph = order->graph;
-
- bool mustReachGlobal=GETVARTUNABLE(This->tuner, order->type, MUSTREACHGLOBAL, &onoff);
-
- if (mustReachGlobal)
- reachMustAnalysis(This, graph, false);
-
- bool mustReachLocal=GETVARTUNABLE(This->tuner, order->type, MUSTREACHLOCAL, &onoff);
-
- if (mustReachLocal) {
- //This pair of analysis is also optional
- if (order->type == PARTIAL) {
- localMustAnalysisPartial(This, graph);
- } else {
- localMustAnalysisTotal(This, graph);
- }
- }
-
- bool mustReachPrune=GETVARTUNABLE(This->tuner, order->type, MUSTREACHPRUNE, &onoff);
-
- if (mustReachPrune)
- removeMustBeTrueNodes(This, graph);
-
- }
-}
void reachMustAnalysis(CSolver *solver, OrderGraph *graph, bool computeTransitiveClosure);
void localMustAnalysisTotal(CSolver *solver, OrderGraph *graph);
void localMustAnalysisPartial(CSolver *solver, OrderGraph *graph);
-void orderAnalysis(CSolver *This);
-void decomposeOrder(CSolver *This, Order *order, OrderGraph *graph);
#endif/* ORDERGRAPHBUILDER_H */
+++ /dev/null
-#include "asttransform.h"
-#include "order.h"
-#include "tunable.h"
-#include "csolver.h"
-#include "ordergraph.h"
-#include "orderencoder.h"
-#include "orderdecompose.h"
-#include "integerencoding.h"
-
-void ASTTransform(CSolver *This){
- uint size = This->allOrders.getSize();
- for (uint i = 0; i < size; i++) {
- Order *order = This->allOrders.get(i);
- bool doDecompose=GETVARTUNABLE(This->tuner, order->type, DECOMPOSEORDER, &onoff);
- if (!doDecompose)
- continue;
-
- OrderGraph *graph;
- if(order->graph == NULL){
- graph= buildOrderGraph(order);
- if (order->type == PARTIAL) {
- //Required to do SCC analysis for partial order graphs. It
- //makes sure we don't incorrectly optimize graphs with negative
- //polarity edges
- completePartialOrderGraph(graph);
- }
- }else{
- graph = order->graph;
- }
- //This is needed for splitorder
- computeStronglyConnectedComponentGraph(graph);
- decomposeOrder(This, order, graph);
-
- bool doIntegerEncoding = GETVARTUNABLE(This->tuner, order->order.type, ORDERINTEGERENCODING, &onoff );
- if(!doIntegerEncoding)
- continue;
- uint size = order->constraints.getSize();
- for(uint i=0; i<size; i++){
- orderIntegerEncodingSATEncoder(This->satEncoder, order->constraints.get(i));
- }
- }
-
-
-}
-
+++ /dev/null
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
-/*
- * File: asttransform.h
- * Author: hamed
- *
- * Created on August 24, 2017, 5:48 PM
- */
-
-#ifndef ASTTRANSFORM_H
-#define ASTTRANSFORM_H
-#include "classlist.h"
-
-void ASTTransform(CSolver *This);
-
-#endif /* ASTTRANSFORM_H */
-
#include "classlist.h"
#include "structs.h"
+void orderAnalysis(CSolver *This);
void decomposeOrder(CSolver *This, Order *order, OrderGraph *graph);
#endif /* ORDERDECOMPOSE_H */
#include "satencoder.h"
#include "sattranslator.h"
#include "tunable.h"
-#include "orderencoder.h"
#include "polarityassignment.h"
-#include "asttransform.h"
+#include "orderdecompose.h"
CSolver::CSolver() : unsat(false) {
tuner = allocTuner();
int CSolver::startEncoding() {
computePolarities(this);
- ASTTransform(this);
- naiveEncodingDecision(this);
orderAnalysis(this);
+ naiveEncodingDecision(this);
encodeAllSATEncoder(this, satEncoder);
int result = solveCNF(satEncoder->cnf);
model_print("sat_solver's result:%d\tsolutionSize=%d\n", result, satEncoder->cnf->solver->solutionsize);