Assign values to literals of the clause as given by model.
(self, model: dict[str, bool | None])
| 59 | return len(self.literals) |
| 60 | |
| 61 | def assign(self, model: dict[str, bool | None]) -> None: |
| 62 | """ |
| 63 | Assign values to literals of the clause as given by model. |
| 64 | """ |
| 65 | for literal in self.literals: |
| 66 | symbol = literal[:2] |
| 67 | if symbol in model: |
| 68 | value = model[symbol] |
| 69 | else: |
| 70 | continue |
| 71 | # Complement assignment if literal is in complemented form |
| 72 | if value is not None and literal.endswith("'"): |
| 73 | value = not value |
| 74 | self.literals[literal] = value |
| 75 | |
| 76 | def evaluate(self, model: dict[str, bool | None]) -> bool | None: |
| 77 | """ |
no outgoing calls
no test coverage detected