PROGRAM:=main
-OBJS:=sokoban.o # Here comes coord.o and object.o
+OBJS:=sokoban.o coord.o
CFLAGS:=-O3 -Wextra -Wall -Werror -fno-strict-aliasing -std=gnu11\
-I./sylvan/src
--- /dev/null
+#include <argp.h>
+#include <inttypes.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/time.h>
+
+#ifdef HAVE_PROFILER
+#include <gperftools/profiler.h>
+#endif
+
+#include <sylvan.h>
+#include <llmsset.h>
+#include <lace.h>
+
+#include "coord.h"
+#include "sokoban.h"
+
+
+BDD encode_screen(sokoban_screen *screen)
+{
+ int num_tiles;
+ num_tiles = HASH_COUNT(screen);
+ printf("Number of tiles: %d\n", num_tiles);
+ return sylvan_true;
+}
+
+BDD encode_rel(sokoban_screen *screen)
+{
+ int num_tiles;
+ num_tiles = HASH_COUNT(screen);
+ printf("Number of tiles: %d\n", num_tiles);
+ return sylvan_true;
+}
+
+void test()
+{
+
+ printf("Test!\n");
+ BDD a = sylvan_true;
+ BDD b = sylvan_not(a);
+ if (b == sylvan_false){
+ printf("BDD works!\n");
+ } else {
+ printf("BDD does not work!\n");
+ }
+ LACE_ME;
+ BDD c = sylvan_ithvar(1);
+ if (sylvan_high(c) == sylvan_true && sylvan_low(c) == sylvan_false) printf("VAR works 1\n");
+ if (sylvan_var(c) == 1) printf("Var works 2\n");
+}
--- /dev/null
+#ifndef COORD_H
+#define COORD_H
+
+#include "sokoban.h"
+
+BDD encode_screen(sokoban_screen *screen);
+
+BDD encode_rel(sokoban_screen *screen);
+
+#endif
#include <sylvan.h>
#include "sokoban.h"
+#include "coord.h"
#define ERRPRINT(fmt, as...) fprintf(stderr, fmt, ## as);
#define DPRINT(fmt, as...) if(DEBUG) ERRPRINT(fmt, ## as);
sokoban_screen *screen = parse_screen(inputstream);
if (screen == NULL) printf("Something went wrong...\n");
sokoban_print(screen);
- sokoban_free(screen);
time_end_read = clock();
time_start_encode = clock();
-
+
lace_init(0, 1000000);
lace_startup(0, NULL, NULL);
LACE_ME;
sylvan_init_package(1LL<<21, 1LL<<27, 1LL<<20, 1LL<<26);
sylvan_init_bdd(6);
-
- //ENCODE???
+
+ encode_screen(screen);
+
+ sokoban_free(screen);
+
switch(strat){
case COORD:
DPRINT("Encoding coordinate based\n");