MCPcopy
hub / github.com/TheAlgorithms/Python / assign

Method assign

other/davis_putnam_logemann_loveland.py:61–74  ·  view source on GitHub ↗

Assign values to literals of the clause as given by model.

(self, model: dict[str, bool | None])

Source from the content-addressed store, hash-verified

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 """

Callers 3

evaluateMethod · 0.95
report_generatorFunction · 0.80
tf_k_means_clusterFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected