2-satisfiability 2026-10-18
2-satisfiability restricts SAT to CNF in which each Boolean clause has at most two Boolean literals. The example in Boolean satisfiability problem is therefore a 2-SAT instance. Unlike general SAT and 3-SAT, 2-SAT has a polynomial-time algorithm; its tractability concerns finding a satisfying assignment or deciding that none exists, not merely checking a candidate. 3-SAT allows up to three Boolean literals per Boolean clause and is NP-complete, even though it includes many individually easy instances such as this one.[ref]
The key logical equivalence iswhere are Boolean literals. It expresses a two-Boolean literal Boolean clause as two logical implications. Representing these logical implications as edges in a directed graph gives a route to the polynomial-time algorithm. In the example, says both and : enabling the feature requires its component, and an absent component excludes the feature.
De Morgan's laws Created 2026-09-28 Updated 2026-10-14
De Morgan's laws exchange logical conjunction and logical disjunction when a logical negation moves across them:Here denotes logical equivalence: the two propositional formulas agree under every Boolean valuation.[ref]
3.1 Propositional Logic. Discrete Mathematics: An Open Introduction (3rd edition) by Oscar Levin; Discrete Mathematics: An Open Introduction, 3rd edition by Oscar Levin, §3.1, Logical Equivalence: definition, Example 3.1.3 and De Morgan's Laws box
A complete verification uses the four rows of a truth table. In input order , both sides of the first logical equivalence have output sequence ; both sides of the second have . A proof in words is equally short: failure of “both” means at least one failure, whereas failure of “at least one” means both fail. The differing middle rows explain why simply pushing logical negation inward without changing AND to OR is wrong.
For the events in Boolean operations on events, the corresponding set identities areOne can prove these identities by checking an arbitrary set element : its two membership truth values obey De Morgan's laws. The same reasoning works for any two subsets of a common universal set.
De Morgan's laws shade the same set whether a compound event is complemented first or its component events are complemented first
. Details. For a nested program test, let mean “backup recent”, mean “backup verified”, and mean “manual override authorized”. Rejecting when neither an acceptable backup nor an override is present givesThe transformed condition reads “backup stale or unverified, and no override”. Apply the second of De Morgan's laws at the outside, then the first at the inner logical conjunction. For it rejects; changing only to one makes it accept. With Boolean operands in Python,
not ((recent and verified) or override) and ((not recent) or (not verified)) and (not override) have the same result and inspect the operands in the same order, with the same skipped operands. Logical equivalence Created 2026-10-14 Updated 2026-10-25
Two propositional formulas are logically equivalent in classical propositional logic when they have the same truth value under every Boolean valuation. Identical output columns in a truth table prove logical equivalence; one differing row refutes it. De Morgan's laws give useful examples.
The usual transformation to clausal normal form preserves . Removing implications and distributing logical conjunction and logical disjunction preserve logical equivalence. Skolemization introduces new symbols and chooses witnesses as functions of preceding universally quantified variables.
For example,On the domain , let be equality. Then is true. Expand this same first-order structure by interpreting as the constant function with value . The resulting first-order structure falsifies at . Interpreting as the identity instead satisfies .
Thus every model of has a reduct satisfying , and a model of can be expanded with suitable witnesses to satisfy . That model-expansion property gives equisatisfiability, not logical equivalence for every interpretation of the added function. If “CNF” means a conjunctive matrix with existential quantifiers retained, Skolemization has not yet happened and an equivalent form is possible; this is why the convention must be specified.
Take the single Boolean clauseThis is a 3-CNF formula. Suppose a 2-CNF formula were logically equivalent to . Every Boolean clause of would then be a consequence of .
Consider any nontautological Boolean clause containing at most two Boolean literals. Choose a Boolean valuation falsifying its Boolean literals. At least one of does not occur in ; assign that Boolean variable true. The resulting Boolean valuation satisfies while falsifying . This contradicts . An empty Boolean clause also cannot be a consequence of the satisfiable .
Consequently every Boolean clause of would have to be a tautology. Their logical conjunction would be true under every Boolean valuation, whereas is false when . This proves that no such exists.
The argument even allows additional ordinary Boolean variables in : at most two Boolean literals still leave one of free to be made true. Introducing extra variables together with existential quantification would change the requested notion of logical equivalence, so it is not a way around the argument.
First convert the four first-order sentences to clausal form. In the first, pull the existential quantifier across the logical disjunction, then replace its witness by a fresh unary Skolem function . The usual nonempty-domain convention for first-order logic makes this transformation valid even when already holds. The four Skolem normal forms areThe Skolemization of preserves satisfiability in an expanded first-order signature; it does not assert logical equivalence for every arbitrary interpretation of the new Skolem function. The other three first-order sentences only require elimination of implications and movement of universal quantifiers.
For a ground resolution refutation, negate the desired conclusion and introduce a fresh constant for a person who is not merry. This adds the ground clause . Use these ground instances of the four universal first-order sentences:Here comes from with , after removing a duplicate negative literal. All first-order terms in these ground clauses are ground. Resolving givesRepeated positive literals in have again been removed. The empty ground clause proves unsatisfiability of the premises together with the negated conclusion. ThereforeThe key is to apply the first three premises to Lucy herself: either she is already happy, or she loves somebody, hence loves herself, which forces her happiness and activates the final premise.
Past exam of the logic and set theory course of the University of Oxford 2007 A 1 iii Solution 2026-10-31
Assume first that is false on the all-true and all-false Boolean valuations. Use the truth-table normal form from part (ii). Every satisfying Boolean valuation on the finitely many propositional variables must have at least one true propositional variable and at least one false propositional variable. Its minterm therefore has the formwhere conjoins its true propositional variables and disjoins its false propositional variables; both lists are nonempty. This is equivalent to . If the satisfying Boolean valuations are indexed by , De Morgan's laws givesIf there are no satisfying Boolean valuations, take and : the result is , again always false.
Conversely, on the all-true Boolean valuation every nonempty is true, so every is true. On the all-false Boolean valuation every nonempty is false, so every logical implication is again true. Negating their logical conjunction gives false on both Boolean valuations. Logical equivalence transfers these values to . The usual nonempty meaning of logical conjunction and logical disjunction of propositional variables is used here; allowing empty or without qualification would destroy this converse.
Past exam of the logic and set theory course of the University of Oxford 2008 A 1 e ii Solution 2026-10-31
A useful consequence of the formation rules is that logical formulas form a prefix-free set of strings. To see this, describe a deterministic parser that reads one logical formula from its starting position. On a logical variable it consumes that one symbol. On a negation symbol it recursively reads one following logical formula. On an opening parenthesis it recursively reads a left logical formula, requires a logical implication symbol, recursively reads a right logical formula, and requires the closing parenthesis. Induction on formation proves that, if a valid logical formula begins at the current position, this procedure consumes exactly that logical formula and stops at its end.
Suppose now that both and are logical formulas and . The same parser, started at their common first symbol, must stop both at the end of and at the end of . Its deterministic stopping position cannot differ, so is empty. HenceThis argument applies to symbol strings; it does not use truth values or logical equivalence.
Past exam of the logic and set theory course of the University of Oxford 2008 A 1 g Solution 2026-10-31
Fix any Boolean valuation . Logical equivalence of and means for this Boolean valuation and every other one. Follow the unique path from the replaced node to the root of the formula syntax tree. At a negation node, equal input truth values have equal negations. At a logical implication node, the unaffected child has the same truth value before and after subformula replacement, while the affected child has the same truth value by induction; the resulting logical implications therefore agree as well.
Induction along that finite path yields . Since was arbitrary,This is the replacement theorem for logical equivalence: the semantics of each logical connective depends only on the truth values of its immediate inputs.
Past exam of the logic and set theory course of the University of Oxford 2011 A 1 c i Solution 2026-10-31
Logical equivalence means that the two propositional formulas receive the same truth value under every Boolean valuation of the propositional variables. Equivalently, is a tautology:
Past exam of the logic and set theory course of the University of Oxford 2011 A 1 c iv Solution 2026-10-31
First eliminate implication and biconditional using the logical equivalencesPush negations inwards using De Morgan's laws and eliminate double negations. Structural induction leaves only literals joined by conjunction and disjunction.
Now induct on that remaining expression. A literal is already in conjunctive normal form. A conjunction of two conjunctive normal forms is again one after associating its clauses. For a disjunction, write the two inductively obtained forms as and and use distributivity:Each is a clause. All operations preserve logical equivalence, proving the required form exists.
The raven paradox combines a plausible equivalence principle with an overly unrestricted account of positive-instance scientific confirmation. Let and mean that is a raven and black respectively. ThenA white shoe is a positive instance of the right-hand generalization. If every positive instance confirms its universal generalization, and logically equivalent statements receive the same evidential support, inspecting the shoe seems to confirm the original raven claim. There is no contradiction in the equivalence itself. The tension concerns the evidential rule and the intuition that an arbitrary shoe teaches us nothing about birds.[ref]
Studies in the Logic of Confirmation I by Carl Hempel. Section 5: instance confirmation, equivalent hypotheses and nonblack nonravens
The right response is to make background knowledge and sampling explicit. Under Bayesian confirmation, evidence increases support for precisely when its likelihood is greater under than under the alternative, assuming nondegenerate prior probabilities. A fact can therefore be compatible with yet provide no new support. The mere existence of a white shoe does not determine the needed likelihood ratio.[ref]
How Bayesian Confirmation Theory Handles the Paradox of the Ravens by Branden Fitelson and James Hawthorne. Sections 1–3: background information, competing confirmation conditions and quantitative comparisons
Consider a deliberately simple finite model. There are objects, exactly ravens, and nonravens, with . All nonravens are white. Under all ravens are black; under exactly one raven is white. Draw uniformly from the entire population. The event of drawing a white nonraven has probability under either hypothesis. Its Bayes factor is one and it leaves the prior odds unchanged. A black raven instead has likelihoods and , so gives Bayes factor for .
Now change the protocol: draw uniformly from the white objects, then discover that the selected object is a nonraven. This result has likelihoods and . It gives the small positive Bayes factorFor and , this is , whereas sampling a black raven from the full population gives . The white nonraven can now help because the search could have revealed a white raven. The two experiments have different selection information, so their differing evidential values do not violate logical equivalence.
This model establishes possibilities, not a universal numerical law about shoes. Different alternatives, population information or selection procedures change the result. If the shoe's being a nonraven was already known, discovering that it is white need not add anything. Conversely, ruling out a potential counterexample can supply a small amount of information. Retain logical equivalence, but reject the unconditional instance-confirmation rule. Once the complete evidential situation is specified, neither zero support nor weak positive support is paradoxical, and neither amounts to proof of a universal law.
Let mean that is a raven and that it is black. The hypothesisis logically equivalent to . If the observed paper is both nonblack and a nonraven, it is a positive instance of the second formulation. Combining an unrestricted positive-instance rule with preservation of scientific confirmation under logical equivalence produces the raven paradox.[ref]
How Bayesian Confirmation Theory Handles the Paradox of the Ravens by Branden Fitelson and James Hawthorne. opening derivation of the Nicod and equivalence conditions
Whether the observation actually supplies evidence depends on what was already known and how the object was selected. In Bayesian confirmation, with background , support means . If the observer already knows the selected item is a nonraven and its colour is conditionally independent of , then : the likelihood ratio is one and there is no confirmation. If all of was already known, learning it again also gives no update.
Under a different sampling scheme, the same classification can provide slight support. In the finite-population model of raven confirmation, fix ravens and nonblack objects. Compare no nonblack raven with exactly one. Sampling uniformly among the nonblack objects gives a nonraven with probabilities and , hence likelihood ratio . If is large this is tiny evidence, not a proof. This example establishes possibility under explicit assumptions, not that every white-paper observation has that evidential role.
The appropriate answer is therefore conditional: mere logical instantiation does not settle the support supplied by observing this paper. State the background and sampling procedure. A familiar paper deliberately selected as a known nonraven normally supplies no new evidence about raven colour; a specified alternative sampling model may yield a small positive update.
Old evidence challenges a simple account of confirmation as actual conditional updating, but does not refute every probabilistic treatment of the raven paradox. The strongest response distinguishes support from newly acquired information and makes the sampling procedure explicit.
Let say that every raven is black. Its contrapositive says that every nonblack thing is a nonraven. Since these statements are logically equivalent, evidence should support them equally. Combining this equivalence requirement with the unrestricted rule that every positive instance confirms a universal generalization appears to make discovering a white shoe support . The tension is between that result and the judgement that such a discovery is irrelevant.[ref]
Studies in the Logic of Confirmation I by Carl Hempel. section 5, the paradoxes generated by instance confirmation and equivalence
Bayesian confirmation replaces an automatic instance rule with a comparison of likelihoods. For background , positive prior probability for both and its alternative, and evidence of positive probability,The equivalence follows directly from Bayes' theorem. A statement's grammatical appearance as a positive instance does not determine either likelihood.
Consider an intentionally simple finite model. There are ravens and nonblack objects, with these counts fixed under both hypotheses. Under none of the nonblack objects is a raven; under the sole alternative , exactly one is. Selecting uniformly among the nonblack objects and discovering a nonraven has likelihoods and . Selecting uniformly among the ravens and discovering a black one has likelihoods and . With equal prior probabilities, the respective posterior probabilities of areIf , the first discovery supplies far less support. For and , the increases over are approximately and . This illustrates a possible resolution of the intuitive disparity, not a theorem that every nonblack nonraven always confirms . More complex alternatives can reverse the comparison, and examining something already known to be a shoe need supply no relevant new information.[ref]
How Bayesian Confirmation Theory Handles the Paradox of the Ravens by Branden Fitelson and James Hawthorne. Introduction and the analysis conditioning confirmation on background assumptions and sampling information
Now suppose is already in . Then , and ordinary conditioning givesThere is no further increase from learning the same fact again. Yet an already established observation can become an important reason to accept a subsequently developed theory. Clark Glymour's problem of old evidence exposes this mismatch between actual updating and scientific assessments of evidential support.[ref]
Why I Am Not a Bayesian by Clark Glymour. chapter 3 of Theory and Evidence, discussion of the old-evidence/new-theory problem
One response evaluates the observation relative to an earlier or counterfactual background that does not contain it. That can represent how strongly a theory accounts for the observation compared with alternatives. It must specify that background rather than pretend to remove knowledge uniquely from a person's present beliefs. Another response concerns learning that a theory successfully accounts for the observation. That discovery can be new even when the observation is old. Modelling it requires attention to limited reasoning and changing hypotheses; an ideal agent already knowing every logical consequence cannot simply learn an entailment it previously overlooked.
Neither manoeuvre licenses counting the same evidence twice, or ignoring that parameters were selected to fit it. Neither establishes a unique complete theory of confirmation. Nevertheless, the old-evidence objection concerns the interpretation and completeness of a probabilistic framework; it does not invalidate the likelihood calculation for genuinely new sampling information.
The preferable solution combines a background-sensitive account of support with rejection of unrestricted instance confirmation. It preserves logical equivalence while allowing a white shoe to provide tiny support, no support or contrary support under different justified models. This is more explanatory than assigning confirmation solely from logical form, although assessing old evidence requires additional work beyond routine conditioning.
Scientific confirmation is evidential support rather than deductive proof. Two distinct problems concern, first, what counts as relevant positive evidence and, second, which part of a tested theoretical package that evidence supports. A defensible response makes background information and the production of evidence explicit. The following two problems are independent: resolving the logical puzzle about positive instances does not eliminate ambiguity about auxiliary hypotheses.
Problem one: the raven paradox. Write the hypothesis aswhere means “is a raven” and “is black”. Its contrapositive isThe hypotheses are logically equivalent. A plausible equivalence principle says that identical information must support them equally. A plausible instance principle says that an observed that is confirms “every is ”. Combining the principles makes a nonblack nonraven, such as a white shoe, support the raven hypothesis. That conflicts with the intuition that inspecting shoes tells us nothing about ravens. Hempel develops the puzzle in his analysis of instance-based scientific confirmation.[ref]
Studies in the Logic of Confirmation I by Carl Hempel. section 5: equivalence, Nicod's criterion and the paradoxical confirming instances
My preferred response retains logical equivalence while rejecting an unconditional instance rule. By Bayes' theorem, for evidence , background and positive relevant probabilities,An instance's bearing depends on how likely it was under the competing possibilities, including how the object was selected. No rule depending only on the grammatical form of an instance can settle that comparison. Branden Fitelson and James Hawthorne analyse the role of background assumptions and Bayesian confirmation in this puzzle.[ref]
How Bayesian Confirmation Theory Handles the Paradox of the Ravens by Branden Fitelson and James Hawthorne. opening sections on the equivalence condition, versions of Nicod's condition and background evidence
Here is an explicit illustrative model. There are 100 labelled objects: ten known ravens and ninety known nonravens. Under all ten ravens are black; under the sole alternative , exactly one of the ten is nonblack, with its identity uniformly distributed. Nonraven colours are already known and identical under both possibilities, and the prior probabilities of are equal. Selecting a known white shoe according to a rule independent of has the same likelihood under each, so the posterior probability of stays . A uniformly selected raven, however, is black with probability under and under . After observing it to be black,If sampling is instead from known nonblack objects whose membership is uncertain, discovering a nonraven can rule out a possible counterexample and provide support. There is no context-independent prohibition on support from a nonraven. The response explains both the familiar irrelevance intuition and why it is not universally correct. Its limit is that the prior probabilities and sampling assumptions need independent defence; the calculation is a transparent model, not a theorem that all shoes are irrelevant.
Problem two: the Duhem problem of testing a package. Suppose the target hypothesis and auxiliary hypotheses jointly imply an outcome :A failure gives , equivalently , rather than alone. Success also does not establish either premise: that would affirm the consequent. Pierre Duhem's point is especially pressing for physical experiments whose predictions require theories of the apparatus as well as the target system.[ref]
The Aim and Structure of Physical Theory by Pierre Duhem. part II, chapter VI, section 2: an experiment tests a theoretical group rather than an isolated hypothesis
My preferred response combines independent calibration, deliberately varied tests and explicit comparison of packages. For a simple model, suppose a detector has independently calibrated false-positive probability and detection efficiency . A target predicts a signal on each trial with probability . Then the positive-output probability isUnder a no-signal rival it is . If , , and , then . One positive reading supplies a Bayes factor of for the specified target package against the specified no-signal package. But an uncalibrated faulty detector with false-positive probability fits the same positive-reading rate. Target data alone do not distinguish those packages.
Signal-absent calibration trials test the false-positive assumption directly. If ten independent such trials are all negative, their likelihood ratio in favour of against isThis does not magically isolate : the calibration relies on its own assumptions, and correlated trials would invalidate the power calculation. It shows concretely how additional evidence can discriminate explanations that the initial data leave unresolved. Repeating the target measurement with apparatus based on different physical processes further reduces dependence on one shared failure mode.
Thus the Duhem problem defeats automatic attribution of support or failure, not rational experimental comparison. Where rivals remain empirically equivalent, suspension of judgement about their difference is appropriate. Together, the two responses defend scientific confirmation as a structured, fallible comparison using background information, rather than either pure instance counting or a mechanical verdict on an isolated hypothesis.
Each parenthesized pair in the given Boolean function tests equality of two input bits:This is logical equivalence, or the two-input XNOR gate function. Thus is one whenever either input pair agrees. Generate the four complemented inputs with four inverters, and define the following NAND gate outputs:Feed these four outputs into a single four-input NAND gate. De Morgan's laws giveHere juxtaposition denotes logical conjunction. The construction uses only inverters, two-input NAND gates and one four-input NAND gate, as required.
Replacement theorem for logical equivalence 2026-10-31
Replacing a designated subformula by a logically equivalent formula preserves logical equivalence of the surrounding propositional formulas. For any Boolean valuation the two expressions at the replaced node have the same truth value. Each logical connective preserves this agreement when its other inputs are unchanged. Induction from that node to the root proves agreement of the whole formulas under every valuation.
Skolemization 2026-10-31
Replacing an existentially quantified variable by a fresh Skolem function of the preceding universally quantified variables. A witness independent of all universal variables is represented by a fresh constant. The operation preserves satisfiability after expanding the first-order signature; it is not generally logical equivalence for arbitrary interpretations of the new symbols.
XNOR gate 2026-10-31
A two-input logic gate whose output is one exactly when its two input bits agree. Its Boolean function is , equivalently . This follows by considering the two cases in which inputs are equal. It implements logical equivalence of the input truth values.
