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.

23 lines
534 B

6 years ago
6 years ago
6 years ago
  1. #!/usr/bin/env python3
  2. from util import randomSAT as rdSAT
  3. kSATInstance = rdSAT.generateRandomKSAT(5, 4, 3)
  4. print(kSATInstance.toString())
  5. print("conflicts:")
  6. for conflict in kSATInstance.getConflicts():
  7. conflictVerified = False
  8. clause1 = kSATInstance.getClause(conflict[0][0])
  9. clause2 = kSATInstance.getClause(conflict[1][0])
  10. for binding in clause2:
  11. if binding == conflict[0][1] * -1:
  12. conflictVerified = True
  13. print(conflict[0], conflict[1], conflictVerified)