File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import test from 'ava';
22import * as sat from '../../src/index.js' ;
33
44import * as compare from '@aureooms/js-compare' ;
5- import { list } from '@aureooms/js-itertools' ;
5+ import { list , map } from '@aureooms/js-itertools' ;
66
77const lex = compare . lexicographical ( compare . increasing ) ;
88
@@ -77,3 +77,32 @@ test('#2', (t) => {
7777 [ 'C' , 1 ] ,
7878 ] ) ;
7979} ) ;
80+
81+ test ( '#3' , ( t ) => {
82+ const instance = sat . from . signs ( [
83+ [ - 1 , 2 , 3 ] ,
84+ [ - 2 , - 4 , 5 ] ,
85+ [ 1 , - 5 ] ,
86+ ] ) ;
87+ const satisfying_assignments = list (
88+ map ( ( certificate ) => instance . assignment ( certificate ) , sat . solve ( instance ) ) ,
89+ ) ;
90+ t . deepEqual ( satisfying_assignments , [
91+ [ 0 , 0 , 0 , 0 , 0 , 0 ] ,
92+ [ 0 , 0 , 0 , 0 , 1 , 0 ] ,
93+ [ 0 , 0 , 0 , 1 , 0 , 0 ] ,
94+ [ 0 , 0 , 0 , 1 , 1 , 0 ] ,
95+ [ 0 , 0 , 1 , 0 , 0 , 0 ] ,
96+ [ 0 , 0 , 1 , 1 , 0 , 0 ] ,
97+ [ 0 , 1 , 0 , 1 , 0 , 0 ] ,
98+ [ 0 , 1 , 0 , 1 , 0 , 1 ] ,
99+ [ 0 , 1 , 0 , 1 , 1 , 0 ] ,
100+ [ 0 , 1 , 0 , 1 , 1 , 1 ] ,
101+ [ 0 , 1 , 1 , 0 , 0 , 0 ] ,
102+ [ 0 , 1 , 1 , 0 , 0 , 1 ] ,
103+ [ 0 , 1 , 1 , 0 , 1 , 1 ] ,
104+ [ 0 , 1 , 1 , 1 , 0 , 0 ] ,
105+ [ 0 , 1 , 1 , 1 , 0 , 1 ] ,
106+ [ 0 , 1 , 1 , 1 , 1 , 1 ] ,
107+ ] ) ;
108+ } ) ;
You can’t perform that action at this time.
0 commit comments