Propositional Implication Deduction Engine
Hard · Software Engineering Fundamentals · Software Engineer · Online Assessment
Problem Statement
Build a propositional deduction engine that classifies query variables under partial information.
Each proposition is named by an alphanumeric identifier without spaces (such as "BuildGreen" or "VaultSealed"). A literal is either a proposition name "X" (asserting X is true) or "!X" (asserting X is false).
Implement the following function:
def evaluate_propositions(
facts: List[str],
rules: List[str],
queries: List[str],
) -> List[str]:
You receive three inputs:
facts: literals ("X"or"!X") known to hold unconditionally.rules: directed implications formatted as"P -> Q", wherePandQare each literals (either positive or negated, such as"!A -> B"or"C -> !D"). Every rule requires that wheneverPholds,Qalso holds—which automatically enforces the contrapositive"!Q -> !P".queries: unnegated proposition names to classify.
The supplied facts and rules are guaranteed to be mutually consistent (at least one boolean assignment across all variables satisfies every fact and every rule). Across the set of all satisfying boolean assignments, classify each query proposition X in queries (preserving query order) as:
"TRUE"ifXis true in every satisfying assignment,"FALSE"ifXis false in every satisfying assignment, or"CANNOT_DETERMINE"if at least one satisfying assignment makesXtrue and at least one makesXfalse.
Examples
Example 1
facts = ["BuildGreen", "!CanaryLive"]
rules = [
"BuildGreen -> ArtifactSigned",
"ArtifactSigned -> ReadyToStage",
"CanaryLive -> TrafficSplit",
]
queries = ["ReadyToStage", "TrafficSplit", "CanaryLive"]
# Expected output: ["TRUE", "CANNOT_DETERMINE", "FALSE"]
Walk-through: BuildGreen forces ArtifactSigned, which in turn forces ReadyToStage ("TRUE"). !CanaryLive pins CanaryLive to false ("FALSE"). Because CanaryLive is false, "CanaryLive -> TrafficSplit" places no constraint on TrafficSplit, leaving both true and false valid ("CANNOT_DETERMINE").
Example 2
facts = ["!VaultSealed"]
rules = [
"KeyRotated -> VaultSealed",
"AuditMode -> KeyRotated",
]
queries = ["KeyRotated", "AuditMode"]
# Expected output: ["FALSE", "FALSE"]
Walk-through: Because VaultSealed is false, the contrapositive "!VaultSealed -> !KeyRotated" forces KeyRotated false, and "!KeyRotated -> !AuditMode" then forces AuditMode false.
Example 3
facts = ["RegionEast"]
rules = [
"CacheHit -> FastReply",
"!CacheHit -> FastReply",
]
queries = ["FastReply", "CacheHit"]
# Expected output: ["TRUE", "CANNOT_DETERMINE"]
Walk-through: In every valid assignment, CacheHit is either true or false, and both branches force FastReply to hold ("TRUE"), even though CacheHit itself remains unconstrained ("CANNOT_DETERMINE").
Constraints
1 <= len(facts) <= 2000 <= len(rules) <= 5001 <= len(queries) <= 200- Every proposition identifier consists of
1to20ASCII alphanumeric characters (A-Z,a-z,0-9). - All
factsandrulestogether admit at least one satisfying truth assignment.
Step-by-step walkthrough
Understand the goal: true in EVERY valid world
Each proposition name (such as
"BuildGreen"or"KeyRotated") is a boolean variable that is either true or false. A literal is a variable ("A") or its negation ("!A").- Every entry in
factspins down a literal that is unconditionally true ("!CanaryLive"meansCanaryLiveis false). - Every rule
"P -> Q"says: wheneverPholds,Qmust also hold. Notice what a rule forbids and what it allows:- If
Pis true,Qmust be true. - If
Qis false (!Qholds),Pcannot be true, so!Pmust hold. This reversed form,"!Q -> !P", is called the contrapositive and is 100% logically equivalent to"P -> Q". - If
Pis false, the rule places zero restriction onQ(Qcould be true or false).
- If
A truth assignment to all variables that satisfies every fact and every rule is called a valid interpretation (or model). For each query variable
X, we classify what happens across all valid models:X is true in every valid model -> "TRUE" X is false in every valid model -> "FALSE" X is true in >= 1 valid model and false in >= 1 -> "CANNOT_DETERMINE"With up to 200 facts, 500 rules, and 200 queries, there can be up to ~1,400 distinct variables (~2,800 literals). Listing a brute-force truth table (
2^1400rows) is completely impossible, so we need a graph algorithm over the literals.- Every entry in
Represent literals cleanly so double negations vanish
If we kept literals as raw strings and negated them by prepending
"!", negating"!A"would produce"!!A", which would not match"A". Double negations happen constantly when forming contrapositives—for example, the contrapositive of"!G -> F"is"!F -> !!G", which means"!F -> G".Instead, represent every literal as a 2-tuple
(name, is_positive):"A" -> ("A", True) "!A" -> ("A", False) "!!A" -> ("A", True)Flipping a literal's truth value is now just
not is_positive, with zero string gymnastics:def parse_literal(text: str): """Parse 'A' -> ('A', True) and '!A' -> ('A', False), canceling double '!'.""" cleaned = text.strip() is_positive = True # Each leading '!' flips the truth sign, so '!!A' cleanly becomes ('A', True) while cleaned.startswith("!"): is_positive = not is_positive cleaned = cleaned[1:].strip() return (cleaned, is_positive) def negate(literal): """Flip ('A', True) <-> ('A', False).""" name, is_positive = literal return (name, not is_positive)Build the implication graph with contrapositives
Now turn
rulesinto a directed implication graph where every node is a literal(name, is_positive)and a directed arrowU -> Vmeans "if literalUholds, literalVmust also hold."Every rule
"P -> Q"contributes two arrows: the forward ruleP -> Qand its contrapositive!Q -> !P. Without that second arrow, Example 2 (facts = ["!VaultSealed"],rules = ["KeyRotated -> VaultSealed", "AuditMode -> KeyRotated"]) would have no outgoing arrow from!VaultSealedand would miss!KeyRotatedand!AuditMode:Rule "KeyRotated -> VaultSealed" creates two directed edges: ("KeyRotated", True) ---> ("VaultSealed", True) [forward] ("VaultSealed", False) ---> ("KeyRotated", False) [contrapositive] Rule "!G -> F" creates two directed edges: ("G", False) ---> ("F", True) [forward] ("F", False) ---> ("G", True) [contrapositive: negate(("G", False)) = ("G", True)]def add_edge(graph: dict, source, target) -> None: """Append directed implication edge source -> target to adjacency list.""" if source not in graph: graph[source] = [] graph[source].append(target) def build_graph(rules: List[str]) -> dict: """Build implication graph: each 'P -> Q' adds edges P -> Q and !Q -> !P.""" # graph: dict mapping literal (name, is_positive) -> list of implied literals graph = {} for rule in rules: left_text, right_text = rule.split("->") premise = parse_literal(left_text) conclusion = parse_literal(right_text) # Forward implication: if premise holds, conclusion must hold add_edge(graph, premise, conclusion) # Contrapositive: if conclusion is false, premise must also be false add_edge(graph, negate(conclusion), negate(premise)) return graphCollect consequences with Breadth-First Search (and why not recursion)
Starting from any set of literals we know (or assume) to be true, every literal reachable along directed arrows in
graphis also forced to be true. We find all reachable literals with Breadth-First Search (BFS) using adequequeue and aseenset so cycles in the rules never cause infinite loops.Why use an explicit
dequeinstead of recursive DFS? Because 500 rules can create nearly 1,000 edges in a single chain: 499 rulesV0 -> V1 -> ... -> V499plus one ruleV499 -> !V499produce the 999-edge pathV0 -> ... -> V499 -> !V499 -> !V498 -> ... -> !V0, which hits CPython's ~1,000-frame recursion limit and raisesRecursionError. An iterative queue handles any depth effortlessly:from collections import deque def derive(graph: dict, start_literals) -> set: """Return all literals reachable from start_literals via iterative BFS.""" # seen: set of (name, is_positive) literals proven true from start_literals seen = set(start_literals) # Use a FIFO queue instead of recursion because 500 rules can form a 999-edge path queue = deque(start_literals) while queue: current = queue.popleft() for implied in graph.get(current, []): if implied not in seen: seen.add(implied) queue.append(implied) return seenWhy forward chaining from facts alone misses valid deductions
It is tempting to run
derive(graph, fact_literals)once and answer"TRUE"ifXwas reached,"FALSE"if!Xwas reached, and"CANNOT_DETERMINE"otherwise. That handles direct chains (Examples 1 and 2), yet fails on valid deductions that require reasoning by cases (such as Example 3)!Look at two tiny examples where
facts = ["RegionEast"]:Puzzle 1 (Example 3 case split): rules = ["CacheHit -> FastReply", "!CacheHit -> FastReply"], query = "FastReply" In every valid world, CacheHit is either True or False: - If CacheHit is True, "CacheHit -> FastReply" forces FastReply = True. - If CacheHit is False, "!CacheHit -> FastReply" forces FastReply = True. So FastReply is TRUE in 100% of valid models! Yet starting BFS at fact "RegionEast" goes nowhere because no arrow leaves "RegionEast". Puzzle 2 (self-contradicting premise): rules = ["X -> Y", "X -> !Y"], query = "X" If X were True, both Y and !Y would have to be True at once (impossible!). So X must be FALSE in 100% of valid models—again with zero arrows leaving "RegionEast".Forward chaining from
factsonly discovers consequences triggered directly by a known fact; it misses truths forced by the structure of the rules themselves.Key insight: proof by contradiction makes two-literal deduction exact
Go right back to the definition:
Xis"TRUE"in every valid model if and only if no valid model hasXfalse (i.e.,!Xtrue).So we test
!Xby proof by contradiction:- Precompute
base = derive(graph, fact_literals)once—everything forced byfacts. - Temporarily assume
assumption(say!X) holds, and computereached = derive(graph, [assumption]). - Check whether
basetogether withreachedforces both some literalYand its negation!Y. If it does,assumptionis impossible!
Why is "no clash between
Yand!Y" a guarantee that a valid model withassumptionreally exists? Because all our rules have just one literal on each side: take any valid modelMof the consistent premises, overwrite every literal inS = base ∪ reachedto be true (which is conflict-free since noYand!Yare both inS), and keepM's truth values for all remaining variables. For any ruleP -> Q: - IfPis inS, our BFS followedP -> Q, soQis also inS(and true). - If!Qis inS, our BFS followed!Q -> !P, so!Pis also inS(makingPfalse). - Otherwise neitherPnor!Qwas forced byS, soPandQcould only break the rule ifMalready broke it—whichMdoes not!Because
basealone has no internal conflict, any conflict inbase ∪ reachedmust involve at least one literal insidereached:def leads_to_conflict(graph: dict, base: set, assumption) -> bool: """Return True if adding `assumption` to known `base` derives both Y and !Y.""" # Derive every consequence forced by temporarily assuming `assumption` holds reached = derive(graph, [assumption]) # Because `base` itself is conflict-free, any contradiction must touch `reached` for literal in reached: opposite = negate(literal) if opposite in base or opposite in reached: return True return False- Precompute
Trace two tricky examples step by step
Trace 1 — Example 2 (
facts = ["!VaultSealed"],rules = ["KeyRotated -> VaultSealed", "AuditMode -> KeyRotated"],queries = ["KeyRotated", "AuditMode"]):Graph edges: KeyRotated -> VaultSealed, !VaultSealed -> !KeyRotated AuditMode -> KeyRotated, !KeyRotated -> !AuditMode Precompute base from facts ["!VaultSealed"]: base = { !VaultSealed, !KeyRotated, !AuditMode } Evaluate query "AuditMode": 1) Test assumption !AuditMode: reached = { !AuditMode } opposite AuditMode is neither in base nor in reached -> NO conflict 2) Test assumption AuditMode: reached = { AuditMode, KeyRotated, VaultSealed } opposites !AuditMode, !KeyRotated, !VaultSealed ARE in base -> CONFLICT! Result -> "FALSE" (and likewise "FALSE" for "KeyRotated")Trace 2 — Example 3 (
facts = ["RegionEast"],rules = ["CacheHit -> FastReply", "!CacheHit -> FastReply"],queries = ["FastReply", "CacheHit"]):Graph edges: CacheHit -> FastReply, !FastReply -> !CacheHit !CacheHit -> FastReply, !FastReply -> CacheHit base = { RegionEast } Evaluate query "FastReply": 1) Test assumption !FastReply: !FastReply -> !CacheHit -> FastReply, and !FastReply -> CacheHit -> FastReply reached = { !FastReply, !CacheHit, CacheHit, FastReply } contains both CacheHit and !CacheHit -> CONFLICT! Assuming FastReply is false is impossible -> Result: "TRUE" Evaluate query "CacheHit": 1) Test assumption !CacheHit -> reached = { !CacheHit, FastReply } -> no conflict with base { RegionEast } 2) Test assumption CacheHit -> reached = { CacheHit, FastReply } -> no conflict with base { RegionEast } Both worlds are valid -> Result: "CANNOT_DETERMINE"Complete solution
Put all the pieces together inside
evaluate_propositions: buildgraphonce, computebaseonce, and run at most two small BFS checks per query.from typing import List from collections import deque def parse_literal(text: str): """Parse 'A' -> ('A', True) and '!A' -> ('A', False), canceling double '!'.""" cleaned = text.strip() is_positive = True # Each leading '!' flips the truth sign, so '!!A' cleanly becomes ('A', True) while cleaned.startswith("!"): is_positive = not is_positive cleaned = cleaned[1:].strip() return (cleaned, is_positive) def negate(literal): """Flip ('A', True) <-> ('A', False).""" name, is_positive = literal return (name, not is_positive) def add_edge(graph: dict, source, target) -> None: """Append directed implication edge source -> target to adjacency list.""" if source not in graph: graph[source] = [] graph[source].append(target) def build_graph(rules: List[str]) -> dict: """Build implication graph: each 'P -> Q' adds edges P -> Q and !Q -> !P.""" # graph: dict mapping literal (name, is_positive) -> list of implied literals graph = {} for rule in rules: left_text, right_text = rule.split("->") premise = parse_literal(left_text) conclusion = parse_literal(right_text) # Forward implication: if premise holds, conclusion must hold add_edge(graph, premise, conclusion) # Contrapositive: if conclusion is false, premise must also be false add_edge(graph, negate(conclusion), negate(premise)) return graph def derive(graph: dict, start_literals) -> set: """Return all literals reachable from start_literals via iterative BFS.""" # seen: set of (name, is_positive) literals proven true from start_literals seen = set(start_literals) # Use a FIFO queue instead of recursion because 500 rules can form a 999-edge path queue = deque(start_literals) while queue: current = queue.popleft() for implied in graph.get(current, []): if implied not in seen: seen.add(implied) queue.append(implied) return seen def leads_to_conflict(graph: dict, base: set, assumption) -> bool: """Return True if adding `assumption` to known `base` derives both Y and !Y.""" # Derive every consequence forced by temporarily assuming `assumption` holds reached = derive(graph, [assumption]) # Because `base` itself is conflict-free, any contradiction must touch `reached` for literal in reached: opposite = negate(literal) if opposite in base or opposite in reached: return True return False def evaluate_propositions(facts: List[str], rules: List[str], queries: List[str]) -> List[str]: # Phase 1: build the implication graph once and close the unconditionally true facts graph = build_graph(rules) fact_literals = [parse_literal(fact) for fact in facts] # base: set of all literals forced true in every valid model by the facts alone base = derive(graph, fact_literals) # Phase 2: test each query by checking whether false or true causes a contradiction answers = [] for query in queries: query_literal = parse_literal(query) # If assuming !query_literal causes a contradiction, query_literal must be TRUE if leads_to_conflict(graph, base, negate(query_literal)): answers.append("TRUE") # If assuming query_literal causes a contradiction, query_literal must be FALSE elif leads_to_conflict(graph, base, query_literal): answers.append("FALSE") # Otherwise at least one valid model has it true and another has it false else: answers.append("CANNOT_DETERMINE") return answers✅ Submit now — all tests should pass.
Intuition & how it works
Picture every proposition A as a pair of dominoes on a table: one labeled A ("A is true") and one labeled !A ("A is false"). Each rule "P -> Q" connects domino P to domino Q with a one-way ramp—and because "if P holds then Q holds" is logically identical to "if Q is false then P must be false" (called the contrapositive, the reversed negated form of an implication), that same rule also lays a second ramp from !Q to !P. First, we tip over all known facts dominoes to record every domino base that must fall. Then, to judge a query X, we test by proof by contradiction (assuming the opposite of a statement to see whether an impossible clash follows): we test tipping !X—if doing so knocks over both Y and !Y for any variable Y, then X can never be false, so X is "TRUE"; if tipping X causes such a clash, X is "FALSE"; if neither clashes, both worlds are valid ("CANNOT_DETERMINE").
Why do simpler approaches fall short? Enumerating a truth table (checking all 2^N combinations of True and False across N variables) explodes astronomically as soon as dozens or hundreds of variables appear. Conversely, merely following arrows forward from facts is fast, cleanly solving simple chains, yet misses truths forced by case splits—for example, if "Rain -> Wet" and "!Rain -> Wet", then "Wet" must be true in every valid truth assignment even when no fact mentions "Rain".
Walk through a combined contrapositive and case-split example with facts = ["!VaultSealed"], rules = ["KeyRotated -> VaultSealed", "CacheHit -> FastReply", "!CacheHit -> FastReply"]:
1. Build ramps: "KeyRotated -> VaultSealed" adds KeyRotated -> VaultSealed and !VaultSealed -> !KeyRotated; "CacheHit -> FastReply" adds CacheHit -> FastReply and !FastReply -> !CacheHit; "!CacheHit -> FastReply" adds !CacheHit -> FastReply and !FastReply -> CacheHit.
2. Close facts: Starting from !VaultSealed, Breadth-First Search (BFS) (exploring a graph layer by layer with a queue) reaches base = {!VaultSealed, !KeyRotated}.
3. Query "KeyRotated": Assuming KeyRotated reaches {KeyRotated, VaultSealed}, colliding with !KeyRotated in base -> "FALSE".
4. Query "FastReply": Assuming !FastReply follows !FastReply -> !CacheHit and !FastReply -> CacheHit, colliding on CacheHit and !CacheHit -> !FastReply is impossible, so "FastReply" -> "TRUE".
Complexity
Let F be the number of facts, R the number of rules, Q the number of queries, and L the number of distinct literals (L <= 2 * (F + 2R + Q), at most ~2,800 under the constraints).
- Time: O(F + R + Q * (L + R)). Parsing
Rrules and adding two directed edges per rule takesO(R)time, and computingbasefromFfacts runs one BFS visiting each literal and rule edge at most once inO(F + L + R)time. Each of theQqueries runs at most two BFS searches (derive) plus a hash-set scan overreached, costingO(L + R)per query—at most ~1.5 million tiny operations at the maximum limits (F = 200, R = 500, Q = 200). - Space: O(L + R). The adjacency list
graphstores2Rdirected edges across at mostLliteral keys, and the setsbase,seen, andreachedplus the BFSdequeeach hold at mostLliterals at any moment.
Edge cases
- Query variable never appears in
factsorrules: Assuming!Xreaches only{!X}and assumingXreaches only{X}, neither of which conflicts withbase, returning"CANNOT_DETERMINE". - Query is directly in
facts(or negated infacts): If"A"is infacts,"A"is inbase; assuming"!A"immediately collides with"A"inbaseand returns"TRUE". - Negated literals inside rules (
"!A -> B","!G -> F"): Representing literals as(name, is_positive)makes negating("G", False)produce("G", True)automatically, avoiding"!!G"bugs. - Case splits (
"A -> B"and"!A -> B"): Assuming"!B"reaches both"!A"and"A"via contrapositives, proving"B"is"TRUE"without knowing"A". - Self-contradicting antecedents (
"X -> Y"and"X -> !Y"): Assuming"X"derives both"Y"and"!Y", proving"X"must be"FALSE". - Deep 999-edge chains through contrapositives:
499rulesV0 -> ... -> V499plusV499 -> !V499create a999-edge path down to!V0; iterativedequeBFS avoidsRecursionError. - Empty
ruleslist or duplicatequeries: Works cleanly withgraph = {}and preserves exact query order.
Common mistakes
- Omitting contrapositive edges: Adding
P -> Qwithout!Q -> !Pfails whenever a false conclusion forces a premise false (such as!VaultSealedforcing!KeyRotated). - Confusing an implication with an
if-and-only-ifequivalence:"CanaryLive -> TrafficSplit"with"!CanaryLive"does not imply"!TrafficSplit"—adding!P -> !Qwrongly answers"FALSE"instead of"CANNOT_DETERMINE". - Only running forward BFS from
facts: Misses variables proven true or false via case splits ("A -> B"plus"!A -> B"), violating the "true in all valid interpretations" contract. - Keeping literals as unparsed strings: Negating
"!A"as"!!A"or failing to strip whitespace around"->"breaks dictionary lookups in the graph. - Using recursive DFS: Because each rule generates two edges, a valid 500-rule input can form a 999-step path that overflows Python's default 1,000-frame call stack.
Alternative approaches
- Single-path 2-SAT check: Because binary implications are an instance of 2-SAT (boolean satisfiability where every constraint is a clause of at most two literals), adding a graph edge
!f -> ffor each factfmeansXis"TRUE"if and only if there is a directed path from!XtoX(and"FALSE"if and only if there is a path fromXto!X). Ourleads_to_conflictcheck is equivalent because contrapositive symmetry funnels any clashYand!Yback toX. - Strongly Connected Components (SCCs) + DAG reachability: Grouping mutually reachable literals into strongly connected components (maximal groups of nodes where every node can reach every other node) via Tarjan's algorithm in
O(L + R)time lets you precompute reachability across the graph when query countQis huge relative toL. - Exhaustive truth table: Testing all
2^Nassignments takes exponential time, unusable in production beyond ~20 variables, though great as a tiny randomized test oracle (N = 5).
Follow-up questions
- If the caller could supply mutually inconsistent facts and rules, how would you check whether at least one valid truth assignment exists? Add a directed edge
!f -> fto the implication graph for every factf(encoding thatfcannot be false), then run Tarjan's or Kosaraju'sO(L + R)algorithm to find all strongly connected components (clusters of literals that all imply one another in a cycle). By the standard 2-SAT theorem, the premises contain a contradiction—even one hidden entirely inside rules like"A -> B","A -> !B","!A -> B","!A -> !B"with no matching fact—if and only if some variable has bothYand!Yin the same strongly connected component (Y ->* !Yand!Y ->* Y). Extracting the cycleY -> ... -> !Y -> ... -> Yalso gives a human-readable proof of the contradiction. - How does the algorithm change if rule premises can combine multiple literals with AND, such as 'P AND Q -> R'? A rule
"P AND Q -> R"is equivalent to the 3-literal clause(!P OR !Q OR R), whose contrapositive!R -> (!P OR !Q)splits into anORrather than a single graph arrow. If rules only have positive preconditions leading to a single literal (P AND Q -> RorP AND Q -> !R), every constraint is a Horn clause (a disjunction with at most one positive literal), where unit propagation—maintaining an unsatisfied-premise counter on each clause and firing whenever all but one literal in the clause are falsified (so knownPand!Ralso force!Q)—still decides"TRUE"/"FALSE"/"CANNOT_DETERMINE"exactly inO(Q * total_rule_size)time! If rules also allow arbitrary negations on the left like"!P AND !Q -> R"(P OR Q OR R), the problem becomes general 3-SAT (which is coNP-complete to check across all models), requiring two calls to a CDCL SAT solver per query (Premises + !XandPremises + X). - Suppose each implication rule holds only with a given probability; how could you estimate lower and upper probability bounds for a query? Under independent rule probabilities (Dempster-Shafer style), treat each rule
r_ias active in a sampled world with probabilityp_i, drop worlds whose active rules contradict the facts or each other, and normalize over consistent worlds: belief (the lower bound) isP(world proves X | consistent)and plausibility (the upper bound) is1 - P(world proves !X | consistent). For example, with factsA, Dand independent rulesA -> B(0.9),B -> C(0.8, so chain0.72), andD -> !C(0.5), conflicting worlds have probability0.72 * 0.5 = 0.36(leaving0.64consistent mass),C-proving worlds have0.72 * 0.5 = 0.36(Bel(C) = 0.36 / 0.64 = 0.5625), and!C-proving worlds have0.28 * 0.5 = 0.14(Pl(C) = 1 - 0.14 / 0.64 = 0.78125). Because exact summation over2^Rworlds is#P-hard, estimate both bounds via Monte Carlo sampling (K = 10,000kept worlds gives standard error<= 0.5 / sqrt(10,000) = 0.005), or use linear programming (Nilsson probabilistic logic) if rule probabilities are not assumed independent.
Follow-up questions
- If the caller could supply mutually inconsistent facts and rules, how would you check whether at least one valid truth assignment exists?
- How does the algorithm change if rule premises can combine multiple literals with AND, such as 'P AND Q -> R'?
- Suppose each implication rule holds only with a given probability; how could you estimate lower and upper probability bounds for a query?
Similar questions
- Multi-Tap Phone Keypad String Encoder
- Exponential Patch Growth and Coin Counts
- Dynamic Dynasty Succession Without an Initial Monarch
- DOM Button Click Listener and Event Target
- Catalog Search, Filtering, and Pagination
- Case-Insensitive Ticket Queue Filtering and UI State Debugging