Skip to content

Commit 5af6c40

Browse files
author
fett
committed
Modified the examples to work w/ the new markbdd format features.
Worked on the user manual a tad. ~Sean
1 parent f88816a commit 5af6c40

File tree

10 files changed

+202
-203
lines changed

10 files changed

+202
-203
lines changed

doc/manual/sbsat_user_manual.tex

+5-6
Original file line numberDiff line numberDiff line change
@@ -900,11 +900,11 @@ \subsection{An input in canonical (BDD) form}\label{can-section}
900900
\vspace*{-3mm}\\
901901
\indent{\tt imp(-x3, -x4)}\\
902902
\indent{\tt xor(x1, -x5)}\\
903-
\indent{\tt xor6(x8, x3, -x2, x7, -x4, -x1)}
903+
\indent{\tt xor(x8, x3, -x2, x7, -x4, -x1)}
904904

905905
\noindent
906906
\textbf{\underbar{Remark}}: ~Since no extension of a binary function
907-
can take 1 argument, {\tt xor1(-x1)} is not admitted.
907+
can take 1 argument, {\tt xor(-x1)} is not admitted.
908908

909909
A function argument may be a variable, a function, or a reference to a
910910
function defined elsewhere in the file. To support the latter, every
@@ -924,14 +924,14 @@ \subsection{An input in canonical (BDD) form}\label{can-section}
924924
{\tt or(x2, x3)}\\
925925
{\tt and(x3, x4)}\\
926926
{\tt imp(x3, \$2)}\\
927-
{\tt xor4(\$3, \$1, x4, x1)}\\
927+
{\tt xor(\$3, \$1, x4, x1)}\\
928928
{\tt and(x2, x3)}\\
929929
}
930930

931931
\noindent
932932
The fourth line of this group is equivalent to\\
933933
\vspace*{-3mm}\\
934-
\indent{\tt xor4(imp(x3, and(x3, x4)), or(x2, x3), x4, x1)}\\
934+
\indent{\tt xor(imp(x3, and(x3, x4)), or(x2, x3), x4, x1)}\\
935935
\vspace*{-3mm}\\
936936
which is {\em also} recognized by {\tt sbsat}.
937937

@@ -946,8 +946,7 @@ \subsection{An input in canonical (BDD) form}\label{can-section}
946946
{\tt or(x2, x3)}\\
947947
{\tt and(x3, x4)}\\
948948
{\tt imp(x3, \$2)}\\
949-
{\tt ; The next line is the first *ed line of the file}\\
950-
{\tt *xor4(\$3, \$1, x4, x1)}\\
949+
{\tt *xor(\$3, \$1, x4, x1)}\\
951950
{\tt *or(x2, x3)}\\
952951
}
953952

examples/add_state.ite

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
p bdd 19 5
22
#define add_state(var1, var2, var3, var4, var5)
33
#equ(xor(var1, and(-var2, var3)), ite(var4, or(var5, -var3), -var3))
4-
*add_state(1, 3, 5, 9 ,10)
5-
*add_state(2, 4, 6, 10 ,11)
6-
*add_state(3, 5, 7, 11 ,12)
7-
*add_state(4, 6, 8, 12 ,13)
8-
*add_state(5, 7, 9, 13 ,14)
4+
add_state(1, 3, 5, 9 ,10)
5+
add_state(2, 4, 6, 10 ,11)
6+
add_state(3, 5, 7, 11 ,12)
7+
add_state(4, 6, 8, 12 ,13)
8+
add_state(5, 7, 9, 13 ,14)

examples/flowers.ite

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ p bdd 4 4
66
;The question must be negated and added to the database.
77
;If SBSAT returns 'unsat' then the answer to the question
88
;is 'YES', otherwise the answer is 'NO'.
9-
imp(Coloured, Scented) ;
10-
imp(-OpenAir, -Like) ;
11-
imp(OpenAir, Coloured) ;
12-
not(imp(-Scented, -Like)) ;
9+
imp(Coloured, Scented)
10+
imp(-OpenAir, -Like)
11+
imp(OpenAir, Coloured)
12+
not(imp(-Scented, -Like))

examples/interconnect_example.ite

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ equ(o15, ite(s1, x11, x12))
88
equ(o16, ite(s2, x14, x13))
99
equ(x11, o11)
1010
; Constraint forcing impulse(1)
11-
and4(-x11, x12, x13, x14)
11+
and(-x11, x12, x13, x14)
1212

1313
; Consistency constraints for impulse(3)
1414
equ(o21, ite(s1, x22, x21))
@@ -19,7 +19,7 @@ equ(o25, ite(s1, x21, x22))
1919
equ(o26, ite(s2, x24, x23))
2020
equ(x21, o21)
2121
; Constraint forcing impulse(2)
22-
and4(x21, -x22, x23, x24)
22+
and(x21, -x22, x23, x24)
2323

2424
; Consistency constraints for impulse(3)
2525
equ(o31, ite(s1, x32, x31))
@@ -30,7 +30,7 @@ equ(o35, ite(s1, x31, x32))
3030
equ(o36, ite(s2, x34, x33))
3131
equ(x31, o31)
3232
; Constraint forcing impulse(3)
33-
and4(x31, x32, -x33, x34)
33+
and(x31, x32, -x33, x34)
3434

3535
; Consistency constraints for impulse(4)
3636
equ(o41, ite(s1, x42, x41))
@@ -41,5 +41,5 @@ equ(o45, ite(s1, x41, x42))
4141
equ(o46, ite(s2, x44, x43))
4242
equ(x41, o41)
4343
; Constraint forcing impulse(4)
44-
and4(x41, x42, x43, -x44)
44+
and(x41, x42, x43, -x44)
4545

examples/minmax.ite

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
p bdd 20 9
22
; minmax.cnf is the cnf counterpart to this file.
3-
*minmax(4, 1, 3, 1, 6, 11, 16)
4-
*minmax(4, 1, 2, 2, 7, 12, 17)
5-
*minmax(4, 1, 1, 3, 8, 13, 18)
6-
*minmax(4, 2, 4, 4, 9, 14, 19)
7-
*minmax(4, 0, 1, 5, 10, 15, 20)
8-
*or5(-1, -2, -3, -4, -5)
9-
*or5(-6, -7, -8, -9, -10)
10-
*or5(-11, -12, -13, -14, -15)
11-
*or5(-16, -17, -18, -19, -20)
3+
minmax(1, 3, 1, 6, 11, 16)
4+
minmax(1, 2, 2, 7, 12, 17)
5+
minmax(1, 1, 3, 8, 13, 18)
6+
minmax(2, 4, 4, 9, 14, 19)
7+
minmax(0, 1, 5, 10, 15, 20)
8+
or(-1, -2, -3, -4, -5)
9+
or(-6, -7, -8, -9, -10)
10+
or(-11, -12, -13, -14, -15)
11+
or(-16, -17, -18, -19, -20)

examples/xortest.ite

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
p bdd 12 3
2-
*equ(xor3(123, 125, 156), F)
3-
*equ(xor(134, and3(155, 127, 167)), T)
4-
*equ(xor(and3(1, 2, 3), and3(45, 145, 167)), F)
2+
equ(xor(123, 125, 156), F)
3+
equ(xor(134, and(155, 127, 167)), T)
4+
equ(xor(and(1, 2, 3), and(45, 145, 167)), F)

src/formats/markbdd.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ void bddloop () {
12301230
if(p==';') continue_all = 1;
12311231
else if (p!=' ' && p!='(' && p!=')' && p!=',') {
12321232
fprintf(stderr, "Error: Extra characters following line %d...exiting\n", markbdd_line);
1233-
exit(0);
1233+
exit (1);
12341234
continue_all = 1;
12351235
}
12361236
p = fgetc(finputfile);
@@ -1240,7 +1240,7 @@ void bddloop () {
12401240
if (p == ';') continue_all = 1;
12411241
if (continue_all == 0 && p!=' ' && p!='(' && p!=')' && p!=',') {
12421242
fprintf(stderr, "Error: Extra characters following line %d...exiting\n", markbdd_line);
1243-
exit(0);
1243+
exit (1);
12441244
continue_all = 1;
12451245
}
12461246
p = fgetc(finputfile);

tests/longer_tests/slider_80_sat.ite

+83-83
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,87 @@
11
p bdd 80 83
22
#define add_state1(1, 15, 17, 33, 24, 40)
3-
#equ(xor3(1, and(-17, 33), nand(40, 24), ite(15, or(33, -40), -33))))
4-
*add_state1(1, 17, 15, 24, 33, 40)
5-
*add_state1(2, 18, 16, 25, 34, 41)
6-
*add_state1(3, 19, 17, 26, 35, 42)
7-
*add_state1(4, 20, 18, 27, 36, 43)
8-
*add_state1(5, 21, 19, 28, 37, 44)
9-
*add_state1(6, 22, 20, 29, 38, 45)
10-
*add_state1(7, 23, 21, 30, 39, 46)
11-
*add_state1(8, 24, 22, 31, 40, 47)
12-
*add_state1(9, 25, 23, 32, 41, 48)
13-
*add_state1(10, 26, 24, 33, 42, 49)
14-
*add_state1(11, 27, 25, 34, 43, 50)
15-
*add_state1(12, 28, 26, 35, 44, 51)
16-
*add_state1(13, 29, 27, 36, 45, 52)
17-
*add_state1(14, 30, 28, 37, 46, 53)
18-
*add_state1(15, 31, 29, 38, 47, 54)
19-
*add_state1(16, 32, 30, 39, 48, 55)
20-
*add_state1(17, 33, 31, 40, 49, 56)
21-
*add_state1(18, 34, 32, 41, 50, 57)
22-
*add_state1(19, 35, 33, 42, 51, 58)
23-
*add_state1(20, 36, 34, 43, 52, 59)
24-
*add_state1(21, 37, 35, 44, 53, 60)
25-
*add_state1(22, 38, 36, 45, 54, 61)
26-
*add_state1(23, 39, 37, 46, 55, 62)
27-
*add_state1(24, 40, 38, 47, 56, 63)
28-
*add_state1(25, 41, 39, 48, 57, 64)
29-
*add_state1(26, 42, 40, 49, 58, 65)
30-
*add_state1(27, 43, 41, 50, 59, 66)
31-
*add_state1(28, 44, 42, 51, 60, 67)
32-
*add_state1(29, 45, 43, 52, 61, 68)
33-
*add_state1(30, 46, 44, 53, 62, 69)
34-
*add_state1(31, 47, 45, 54, 63, 70)
35-
*add_state1(32, 48, 46, 55, 64, 71)
36-
*add_state1(33, 49, 47, 56, 65, 72)
37-
*add_state1(34, 50, 48, 57, 66, 73)
38-
*add_state1(35, 51, 49, 58, 67, 74)
39-
*add_state1(36, 52, 50, 59, 68, 75)
40-
*add_state1(37, 53, 51, 60, 69, 76)
41-
*add_state1(38, 54, 52, 61, 70, 77)
42-
*add_state1(39, 55, 53, 62, 71, 78)
43-
*add_state1(40, 56, 54, 63, 72, 79)
3+
#equ(xor(1, and(-17, 33), nand(40, 24)), ite(15, or(33, -40), -33))
4+
add_state1(1, 17, 15, 24, 33, 40)
5+
add_state1(2, 18, 16, 25, 34, 41)
6+
add_state1(3, 19, 17, 26, 35, 42)
7+
add_state1(4, 20, 18, 27, 36, 43)
8+
add_state1(5, 21, 19, 28, 37, 44)
9+
add_state1(6, 22, 20, 29, 38, 45)
10+
add_state1(7, 23, 21, 30, 39, 46)
11+
add_state1(8, 24, 22, 31, 40, 47)
12+
add_state1(9, 25, 23, 32, 41, 48)
13+
add_state1(10, 26, 24, 33, 42, 49)
14+
add_state1(11, 27, 25, 34, 43, 50)
15+
add_state1(12, 28, 26, 35, 44, 51)
16+
add_state1(13, 29, 27, 36, 45, 52)
17+
add_state1(14, 30, 28, 37, 46, 53)
18+
add_state1(15, 31, 29, 38, 47, 54)
19+
add_state1(16, 32, 30, 39, 48, 55)
20+
add_state1(17, 33, 31, 40, 49, 56)
21+
add_state1(18, 34, 32, 41, 50, 57)
22+
add_state1(19, 35, 33, 42, 51, 58)
23+
add_state1(20, 36, 34, 43, 52, 59)
24+
add_state1(21, 37, 35, 44, 53, 60)
25+
add_state1(22, 38, 36, 45, 54, 61)
26+
add_state1(23, 39, 37, 46, 55, 62)
27+
add_state1(24, 40, 38, 47, 56, 63)
28+
add_state1(25, 41, 39, 48, 57, 64)
29+
add_state1(26, 42, 40, 49, 58, 65)
30+
add_state1(27, 43, 41, 50, 59, 66)
31+
add_state1(28, 44, 42, 51, 60, 67)
32+
add_state1(29, 45, 43, 52, 61, 68)
33+
add_state1(30, 46, 44, 53, 62, 69)
34+
add_state1(31, 47, 45, 54, 63, 70)
35+
add_state1(32, 48, 46, 55, 64, 71)
36+
add_state1(33, 49, 47, 56, 65, 72)
37+
add_state1(34, 50, 48, 57, 66, 73)
38+
add_state1(35, 51, 49, 58, 67, 74)
39+
add_state1(36, 52, 50, 59, 68, 75)
40+
add_state1(37, 53, 51, 60, 69, 76)
41+
add_state1(38, 54, 52, 61, 70, 77)
42+
add_state1(39, 55, 53, 62, 71, 78)
43+
add_state1(40, 56, 54, 63, 72, 79)
4444
#define add_state2(1, 12, 16, 18, 27, 40)
45-
#xor3(-1, xor3(16, and(-18, 27), 18), equ(40, 12))
45+
#xor(-1, xor(16, and(-18, 27), 18), equ(40, 12))
4646
#define add_state3(1, 12, 16, 18, 27, 40)
47-
#xor3(-1, xor3(16, and(-18, 27), 18), equ(40, 12))
48-
*add_state2(1, 12, 16, 18, 27, 40)
49-
*add_state3(2, 13, 17, 19, 28, 41)
50-
*add_state2(3, 14, 18, 20, 29, 42)
51-
*add_state3(4, 15, 19, 21, 30, 43)
52-
*add_state2(5, 16, 20, 22, 31, 44)
53-
*add_state3(6, 17, 21, 23, 32, 45)
54-
*add_state2(7, 18, 22, 24, 33, 46)
55-
*add_state3(8, 19, 23, 25, 34, 47)
56-
*add_state2(9, 20, 24, 26, 35, 48)
57-
*add_state3(10, 21, 25, 27, 36, 49)
58-
*add_state2(11, 22, 26, 28, 37, 50)
59-
*add_state3(12, 23, 27, 29, 38, 51)
60-
*add_state2(13, 24, 28, 30, 39, 52)
61-
*add_state3(14, 25, 29, 31, 40, 53)
62-
*add_state2(15, 26, 30, 32, 41, 54)
63-
*add_state3(16, 27, 31, 33, 42, 55)
64-
*add_state2(17, 28, 32, 34, 43, 56)
65-
*add_state3(18, 29, 33, 35, 44, 57)
66-
*add_state2(19, 30, 34, 36, 45, 58)
67-
*add_state3(20, 31, 35, 37, 46, 59)
68-
*add_state2(21, 32, 36, 38, 47, 60)
69-
*add_state3(22, 33, 37, 39, 48, 61)
70-
*add_state2(23, 34, 38, 40, 49, 62)
71-
*add_state3(24, 35, 39, 41, 50, 63)
72-
*add_state2(25, 36, 40, 42, 51, 64)
73-
*add_state3(26, 37, 41, 43, 52, 65)
74-
*add_state2(27, 38, 42, 44, 53, 66)
75-
*add_state3(28, 39, 43, 45, 54, 67)
76-
*add_state2(29, 40, 44, 46, 55, 68)
77-
*add_state3(30, 41, 45, 47, 56, 69)
78-
*add_state2(31, 42, 46, 48, 57, 70)
79-
*add_state3(32, 43, 47, 49, 58, 71)
80-
*add_state2(33, 44, 48, 50, 59, 72)
81-
*add_state3(34, 45, 49, 51, 60, 73)
82-
*add_state2(35, 46, 50, 52, 61, 74)
83-
*add_state3(36, 47, 51, 53, 62, 75)
84-
*add_state2(37, 48, 52, 54, 63, 76)
85-
*add_state3(38, 49, 53, 55, 64, 77)
86-
*add_state2(39, 50, 54, 56, 65, 78)
87-
*add_state3(40, 51, 55, 57, 66, 79)
47+
#xor(-1, xor(16, and(-18, 27), 18), equ(40, 12))
48+
add_state2(1, 12, 16, 18, 27, 40)
49+
add_state3(2, 13, 17, 19, 28, 41)
50+
add_state2(3, 14, 18, 20, 29, 42)
51+
add_state3(4, 15, 19, 21, 30, 43)
52+
add_state2(5, 16, 20, 22, 31, 44)
53+
add_state3(6, 17, 21, 23, 32, 45)
54+
add_state2(7, 18, 22, 24, 33, 46)
55+
add_state3(8, 19, 23, 25, 34, 47)
56+
add_state2(9, 20, 24, 26, 35, 48)
57+
add_state3(10, 21, 25, 27, 36, 49)
58+
add_state2(11, 22, 26, 28, 37, 50)
59+
add_state3(12, 23, 27, 29, 38, 51)
60+
add_state2(13, 24, 28, 30, 39, 52)
61+
add_state3(14, 25, 29, 31, 40, 53)
62+
add_state2(15, 26, 30, 32, 41, 54)
63+
add_state3(16, 27, 31, 33, 42, 55)
64+
add_state2(17, 28, 32, 34, 43, 56)
65+
add_state3(18, 29, 33, 35, 44, 57)
66+
add_state2(19, 30, 34, 36, 45, 58)
67+
add_state3(20, 31, 35, 37, 46, 59)
68+
add_state2(21, 32, 36, 38, 47, 60)
69+
add_state3(22, 33, 37, 39, 48, 61)
70+
add_state2(23, 34, 38, 40, 49, 62)
71+
add_state3(24, 35, 39, 41, 50, 63)
72+
add_state2(25, 36, 40, 42, 51, 64)
73+
add_state3(26, 37, 41, 43, 52, 65)
74+
add_state2(27, 38, 42, 44, 53, 66)
75+
add_state3(28, 39, 43, 45, 54, 67)
76+
add_state2(29, 40, 44, 46, 55, 68)
77+
add_state3(30, 41, 45, 47, 56, 69)
78+
add_state2(31, 42, 46, 48, 57, 70)
79+
add_state3(32, 43, 47, 49, 58, 71)
80+
add_state2(33, 44, 48, 50, 59, 72)
81+
add_state3(34, 45, 49, 51, 60, 73)
82+
add_state2(35, 46, 50, 52, 61, 74)
83+
add_state3(36, 47, 51, 53, 62, 75)
84+
add_state2(37, 48, 52, 54, 63, 76)
85+
add_state3(38, 49, 53, 55, 64, 77)
86+
add_state2(39, 50, 54, 56, 65, 78)
87+
add_state3(40, 51, 55, 57, 66, 79)

0 commit comments

Comments
 (0)