You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

22 lines
523 B

#!/usr/bin/env python3
import randomSAT as rdSAT
kSATInstance = rdSAT.generateRandomKSAT(5, 4, 3)
print(kSATInstance.toString())
print("conflicts:")
for conflict in kSATInstance.getConflicts():
conflictVerified = False
clause1 = kSATInstance.getClause(conflict[0][0])
clause2 = kSATInstance.getClause(conflict[1][0])
for binding in clause2:
if binding == conflict[0][1] * -1:
conflictVerified = True
print(conflict[0], conflict[1], conflictVerified)