-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathWorkingFile.wxm
More file actions
94 lines (70 loc) · 1.95 KB
/
WorkingFile.wxm
File metadata and controls
94 lines (70 loc) · 1.95 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/
/* [ Created with wxMaxima version 13.04.2 ] */
/* [wxMaxima: input start ] */
kill(all);
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
load(stringproc);
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
CNFCombM:ConvertToCNF(CombMatrix);
CNFSolM:ConvertToCNF(SolutionMatrix);
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
Found:False;
Answer:"";
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
CNFCombM:"111 0";
CNFSolM:"122 0";
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
system("C:/Users/James/Documents/GitHub/Maxima/Solver/Temp");
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
stream:opena("C:/Users/James/Documents/GitHub/Maxima/Solver/TempNxNCNF.txt");
freshline(stream);
printf(stream,CNFSolM);
freshline(stream);
printf(stream,CNFCombM);
close(stream);
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
system("C:/Users/James/Documents/GitHub/Maxima/Solver/SatSolver");
stream:openr("C:/Users/James/Documents/GitHub/Maxima/Solver/Output.txt");
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
while (Found=False) do(
Answer:readline(stream),
if Answer="s SATISFIABLE" or Answer="s UNSATISFIABLE" then (
Found:True
)
);
close(stream);
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
Answer;
/* [wxMaxima: input end ] */
/* [wxMaxima: input start ] */
/*
dir
copy base to temp
Write CNF to tempfile
run java
get answer
cd C:/Users/James/Documents/GitHub/Maxima/Solver
del Output.txt
java -jar org.sat4j.core.jar 4x4TempCNF.txt >Output.txt
del 4x4TempCNF.txt
copy 4x4BaseCNF.txt 4x4TempCNF.txt
*/
system(cd C:/Users/James/Documents/GitHub/Maxima/Solver);
if N=4 then (
4
);
if N=9 then (
9
);
/* [wxMaxima: input end ] */
/* Maxima can't load/batch files which end with a comment! */
"Created with wxMaxima"$