fiveham / Sudoku_Solver

Solve sudoku puzzles by representing the puzzle as a bipartite graph of truth-claims about cells' values and rule-statements that have exactly one true neighbor and removing edges as information is added
MIT License
0 stars 0 forks source link

WhatIf can assume contradictory things. #14

Closed fiveham closed 8 years ago

fiveham commented 8 years ago

An exception should be thrown in assumeTrue() if a Claim to be assumed true is already known to be false as a consequence of an (or some) other Claim(s) assumed to be true.

To expedite such a check, Claims should be partitioned, for example in a Map<Boolean,Set> paired with a reverse Map<Claim,Boolean> to quickly check for the Claim's status.

fiveham commented 8 years ago

Also, if any Fact is affected under a WhatIf such that that Fact has only false Claims, an exception should be thrown.

fiveham commented 8 years ago

Intersections between the assumed-true and concluded-false sets now throw an exception. Illegal empty facts now throw an exception.