Merge branch 'master' of ssh://demsky.eecs.uci.edu/home/git/constraint_compiler
authorHamed <hamed.gorjiara@gmail.com>
Fri, 16 Jun 2017 19:04:05 +0000 (12:04 -0700)
committerHamed <hamed.gorjiara@gmail.com>
Fri, 16 Jun 2017 19:04:05 +0000 (12:04 -0700)
src/Encoders/elementencoder.c [deleted file]
src/Encoders/elementencoder.h [deleted file]
src/Encoders/elementencoding.c [new file with mode: 0644]
src/Encoders/elementencoding.h [new file with mode: 0644]
src/Encoders/functionencoder.c [deleted file]
src/Encoders/functionencoder.h [deleted file]
src/Encoders/functionencoding.c [new file with mode: 0644]
src/Encoders/functionencoding.h [new file with mode: 0644]
src/Makefile
src/classlist.h

diff --git a/src/Encoders/elementencoder.c b/src/Encoders/elementencoder.c
deleted file mode 100644 (file)
index 407a478..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "elementencoder.h"
-
-ElementEncoder * allocElementEncoder(ElementEncoderType type, Element *element) {
-       ElementEncoder * this=(ElementEncoder *)ourmalloc(sizeof(ElementEncoder));
-       this->element=element;
-       this->type=type;
-       return this;
-}
-
-void deleteElementEncoder(ElementEncoder *this) {
-       ourfree(this);
-}
diff --git a/src/Encoders/elementencoder.h b/src/Encoders/elementencoder.h
deleted file mode 100644 (file)
index d4f214f..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef ELEMENTENCODER_H
-#define ELEMENTENCODER_H
-#include "classlist.h"
-
-enum ElementEncoderType {
-       ONEHOT, UNARY, BINARYINDEX, ONEHOTBINARY, BINARYVAL
-};
-
-typedef enum ElementEncoderType ElementEncoderType;
-
-struct ElementEncoder {
-       ElementEncoderType type;
-       Element * element;
-};
-
-ElementEncoder * allocElementEncoder(ElementEncoderType type, Element *element);
-void deleteElementEncoder(ElementEncoder *this);
-#endif
diff --git a/src/Encoders/elementencoding.c b/src/Encoders/elementencoding.c
new file mode 100644 (file)
index 0000000..b97fee0
--- /dev/null
@@ -0,0 +1,12 @@
+#include "elementencoding.h"
+
+ElementEncoding * allocElementEncoding(ElementEncodingType type, Element *element) {
+       ElementEncoding * this=(ElementEncoding *)ourmalloc(sizeof(ElementEncoding));
+       this->element=element;
+       this->type=type;
+       return this;
+}
+
+void deleteElementEncoding(ElementEncoding *this) {
+       ourfree(this);
+}
diff --git a/src/Encoders/elementencoding.h b/src/Encoders/elementencoding.h
new file mode 100644 (file)
index 0000000..b94632c
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef ELEMENTENCODING_H
+#define ELEMENTENCODING_H
+#include "classlist.h"
+
+enum ElementEncodingType {
+       ONEHOT, UNARY, BINARYINDEX, ONEHOTBINARY, BINARYVAL
+};
+
+typedef enum ElementEncodingType ElementEncodingType;
+
+struct ElementEncoding {
+       ElementEncodingType type;
+       Element * element;
+};
+
+ElementEncoding * allocElementEncoding(ElementEncodingType type, Element *element);
+void deleteElementEncoding(ElementEncoding *this);
+#endif
diff --git a/src/Encoders/functionencoder.c b/src/Encoders/functionencoder.c
deleted file mode 100644 (file)
index fa51fba..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "functionencoder.h"
-
-FunctionEncoder * allocFunctionEncoder(FunctionEncoderType type, Element *function) {
-       FunctionEncoder * this=(FunctionEncoder *)ourmalloc(sizeof(FunctionEncoder));
-       this->op.function=function;
-       this->type=type;
-       return this;
-}
-
-FunctionEncoder * allocPredicateEncoder(FunctionEncoderType type, Boolean *predicate) {
-       FunctionEncoder * this=(FunctionEncoder *)ourmalloc(sizeof(FunctionEncoder));
-       this->op.predicate=predicate;
-       this->type=type;
-       return this;
-}
-
-void deleteFunctionEncoder(FunctionEncoder *this) {
-       ourfree(this);
-}
diff --git a/src/Encoders/functionencoder.h b/src/Encoders/functionencoder.h
deleted file mode 100644 (file)
index 18a8f4b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef FUNCTIONENCODER_H
-#define FUNCTIONENCODER_H
-#include "classlist.h"
-
-enum FunctionEncoderType {
-       ENUMERATEIMPLICATIONS, CIRCUIT
-};
-
-typedef enum FunctionEncoderType FunctionEncoderType;
-
-union ElementPredicate {
-       Element * function;
-       Boolean * predicate;
-};
-
-typedef union ElementPredicate ElementPredicate;
-
-struct FunctionEncoder {
-       FunctionEncoderType type;
-       bool isFunction;//true for function, false for predicate
-       ElementPredicate op;
-};
-
-FunctionEncoder * allocFunctionEncoder(FunctionEncoderType type, Element *function);
-FunctionEncoder * allocPredicateEncoder(FunctionEncoderType type, Boolean *predicate);
-void deleteFunctionEncoder(FunctionEncoder *this);
-#endif
diff --git a/src/Encoders/functionencoding.c b/src/Encoders/functionencoding.c
new file mode 100644 (file)
index 0000000..887972b
--- /dev/null
@@ -0,0 +1,19 @@
+#include "functionencoding.h"
+
+FunctionEncoding * allocFunctionEncoding(FunctionEncodingType type, Element *function) {
+       FunctionEncoding * this=(FunctionEncoding *)ourmalloc(sizeof(FunctionEncoding));
+       this->op.function=function;
+       this->type=type;
+       return this;
+}
+
+FunctionEncoding * allocPredicateEncoding(FunctionEncodingType type, Boolean *predicate) {
+       FunctionEncoding * this=(FunctionEncoding *)ourmalloc(sizeof(FunctionEncoding));
+       this->op.predicate=predicate;
+       this->type=type;
+       return this;
+}
+
+void deleteFunctionEncoding(FunctionEncoding *this) {
+       ourfree(this);
+}
diff --git a/src/Encoders/functionencoding.h b/src/Encoders/functionencoding.h
new file mode 100644 (file)
index 0000000..4cd5c86
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef FUNCTIONENCODING_H
+#define FUNCTIONENCODING_H
+#include "classlist.h"
+
+enum FunctionEncodingType {
+       ENUMERATEIMPLICATIONS, CIRCUIT
+};
+
+typedef enum FunctionEncodingType FunctionEncodingType;
+
+union ElementPredicate {
+       Element * function;
+       Boolean * predicate;
+};
+
+typedef union ElementPredicate ElementPredicate;
+
+struct FunctionEncoding {
+       FunctionEncodingType type;
+       bool isFunction;//true for function, false for predicate
+       ElementPredicate op;
+};
+
+FunctionEncoding * allocFunctionEncoding(FunctionEncodingType type, Element *function);
+FunctionEncoding * allocPredicateEncoding(FunctionEncodingType type, Boolean *predicate);
+void deleteFunctionEncoding(FunctionEncoding *this);
+#endif
index 431d55b037d997c7f245883d0dc27a052f33429e..341a5dfa08f411c5e3fff7c5bbf777cfa70dbccb 100644 (file)
@@ -23,7 +23,7 @@ endif
 
 MARKDOWN := ../docs/Markdown/Markdown.pl
 
-all: directories $(LIB_SO)
+all: directories ${OBJ_DIR}/$(LIB_SO)
 
 directories: ${OBJ_DIR}
 
@@ -41,7 +41,7 @@ PHONY += docs
 docs: $(C_SOURCES) $(HEADERS)
        doxygen
 
-$(LIB_SO): $(OBJECTS)
+${OBJ_DIR}/$(LIB_SO): $(OBJECTS)
        $(CC) -g $(SHARED) -o ${OBJ_DIR}/$(LIB_SO) $+ $(LDFLAGS)
 
 ${OBJ_DIR}/%.o: %.c
index 8b412eab0f93c2c11d55d029a75f3d3e103d2f7e..361dcb6d0756f733109cc595327c9f83aee0efee 100644 (file)
@@ -48,11 +48,11 @@ typedef struct Table Table;
 struct Order;
 typedef struct Order Order;
 
-struct ElementEncoder;
-typedef struct ElementEncoder ElementEncoder;
+struct ElementEncoding;
+typedef struct ElementEncoding ElementEncoding;
 
-struct FunctionEncoder;
-typedef struct FunctionEncoder FunctionEncoder;
+struct FunctionEncoding;
+typedef struct FunctionEncoding FunctionEncoding;
 
 typedef unsigned int uint;
 typedef uint64_t VarType;