shithub: riscv

Download patch

ref: 39dd26bf0807046b8c9824745751248db3bf2de0
parent: 8389465f94cce8a571910c8575d5a87c0b8dbd5c
author: aiju <devnull@localhost>
date: Thu Mar 22 09:35:52 EDT 2018

sat: satget: don't duplicate binary clauses

--- a/sys/src/libsat/satget.c
+++ b/sys/src/libsat/satget.c
@@ -18,7 +18,7 @@
 		}
 	for(l = s->lit; l < s->lit + 2 * s->nvar; l++)
 		for(k = 0; k < l->nbimp; k++)
-			if(i-- == 0){
+			if(l - s->lit < l->bimp[k] && i-- == 0){
 				if(n > 0) t[0] = -signf(l - s->lit);
 				if(n > 1) t[1] = signf(l->bimp[k]);
 				return 2;