The two writable inputs and Boolean query belong to an abstract class; each concrete logic gate overrides just that query:All three subclasses satisfy the same object interface, so the
abstract class Gate {
var inp1: Boolean = false
var inp2: Boolean = false
def evalGate: Boolean
}
class OrG extends Gate {
override def evalGate: Boolean = inp1 || inp2
}
class AndG extends Gate {
override def evalGate: Boolean = inp1 && inp2
}
class XorG extends Gate {
override def evalGate: Boolean = inp1 ^ inp2
}Gate declarations in the supplied simulator still allow access to inputs and invoke the correct Boolean function through dynamic dispatch. Boolean ^ is exclusive or; || is Boolean disjunction and && is Boolean conjunction.The program first sets both inputs of Those are the two output lines. This is a simulation of combinational logic in an order where each gate's inputs have already been calculated; the Boolean assignments copy values rather than create live wire connections.
y, so . It sets . Therefore and , givingx: true
w: falseWrite the new exclusive or connective as . Give it the two introduction rulesand the elimination ruleIn elimination, discharge the two pairs of case assumptions; retain the assumptions needed for the major premise and the shared context . These are natural deduction rules for exactly one of , not merely at least one.
For a syntactic check, derive from by : in the first case introduce and then the left disjunct; in the second case introduce and then the right disjunct. Conversely, from that disjunction use disjunction elimination; conjunction elimination extracts in the first branch and in the second, so the respective introduction rule yields in both. This proves equivalence to the ordinary truth-functional specification and explains both the introduction and elimination rules.
Store two bits: the output , initially zero, and an
armed bit , initially one. Define the synchronous sequential circuit byHere is exclusive or, and the input restriction excludes conflicting commands. The output is the current stored .When armed, a sampled toggles and clears . Further samples leave the output unchanged. A sampled sets without changing , allowing a later to toggle it again. The same clock edge cannot both rearm and trigger because are never simultaneously high. Thus the first toggles from zero to one, and subsequent toggles each require a new followed by a later .
Phase oracle 2026-10-25
A phase oracle encodes a Boolean function in the signs of computational basis states. Its diagonal entries have modulus one, so it is a unitary operator. The usual convention changes the sign when . A complemented convention instead changes the sign when , with ; denotes exclusive or. The two conventions differ by a global phase when used without coherent control, but the global phase of a controlled quantum gate makes that difference observable when the quantum oracle is controlled.
Quantum collision finding Created 2026-10-06 Updated 2026-10-07
Given a function with an -bit output, accessed through the unitary operator , quantum collision finding asks for distinct inputs with equal outputs. Here is bitwise exclusive or on the -bit answer quantum register. The distinctness requirement excludes the uninformative pair . For a two-to-one function on inputs, Grover search algorithm methods yield a cube-root quantum query complexity, despite a square-root cost for finding a partner of just one preselected input.
Quantum oracle 2026-10-25
A quantum oracle supplies coherent access to a function through a specified unitary operator. For a function with binary string output, the standard construction retains the input and adds the output into an answer quantum register by bitwise exclusive or. This operation is its own inverse, even when the function is not injective. A Boolean quantum oracle is the single-output-bit case; Simon's algorithm uses several answer qubits. Other encodings, such as a modular-addition quantum oracle or a phase gate encoding, require their own explicit query conventions.
Rule 90 2026-10-20
Rule 90 is the binary one-dimensional cellular automaton whose update replaces each cell by the exclusive or of its two neighbors.
Security reduction 2026-11-05
A security reduction turns an adversary breaking one stated cryptographic property into an algorithm breaking another property or solving an assumed-hard problem. It specifies the simulation given to the adversary, the relation between success probabilities and the additional computation required. A primitive's hardness assumption can then imply a bound for the constructed scheme.[ref]
An original reduction illustrates this without a numerical loss. Let a pseudorandom generator expand a uniformly sampled -bit seed into an -bit string . Consider one-use encryption for -bit messages. Suppose adversary distinguishes which of was encrypted in the one-challenge cryptographic security game.
Construct a distinguisher given a string that is either a generator output or uniformly random. Run to obtain its message pair, select an independent uniform bit , and give it . Output one exactly when guesses correctly. If , this is the real encryption experiment. If is uniform, it is a one-time pad, and the success probability is . ThereforeAny nonzero advantage for that encryption game gives the same distinguishing advantage against the generator. The reduction adds the challenge-bit choice, an exclusive or and bookkeeping to the cost of running . It establishes this one-use confidentiality result, without claiming authenticity or safe pad reuse.
Other reductions lose probability or require more computation. For a separate stipulated bound,an adversary with advantage , and implies primitive advantage at least . Conversely, a primitive bound at the reduction's actual running time gives only the scheme bound . The coefficient and additive term are original illustrative values, not a published bound for a named cipher.
Separated Boolean decomposition 2026-10-14
Every Boolean function of distributed inputs is an exclusive or of products of locally computable bits. The displayed identity follows because exactly one indicator is one. It uses at most terms, each a function of times a function of ; exchanging the two input roles gives at most terms. This elementary truth-table factorization is useful for distributed computation with PR boxes and does not depend on a probabilistic approximation.
Sprague-Grundy theorem 2026-10-20
Every finite acyclic impartial game under the normal-play convention has a Grundy number. The Grundy number of a sum of independent games is the bitwise exclusive or of their individual Grundy numbers, so the sum is losing exactly when that value is zero.
Three-bit majority decision tree Created 2026-10-14 Updated 2026-10-20
Three votes give a small but revealing majority function:Our decision tree queries , then . If these bits agree, return their common value: two equal votes already force the majority function. If they disagree, query and return its value. The first two queries have a fixed order, but whether a third query occurs is adaptive.
Each internal label in the diagram names the next bit to inspect. Each leaf lists its output, decision-tree query cost , and compatible inputs; an asterisk denotes an unread bit. The two shallow leaves each cover two inputs, while each deeper leaf covers one. Reading every bit would also compute the majority function, but would miss these exact shortcuts.
All eight inputs give the following exhaustive check. The parity column is the parity of , computed by exclusive or; its decision-tree query cost is justified under parity lower bound for Boolean queries.
The worst inputs for this decision tree are , exactly those with . Its actual depth is three. Every exact decision tree for this majority function has depth at least three: after the first query, an adversary can answer the second distinct query with the opposite bit, leaving the last bit decisive. Consequently its optimal decision-tree depth is , even though some inputs finish sooner. Every input has a two-bit query certificate, namely two agreeing votes; locating those votes can require a third query. This separates having a short query certificate from finding one.
XOR separation by a product feature 2026-10-14
Give the four corners of the square the exclusive or labels: when the input signs differ and when they agree. In the following order,No affine function has the required strictly positive scores at and strictly negative scores at : both pairs have midpoint zero, so would have to be both positive and negative. This also rules out perfect classification by a single threshold with a consistent tie rule.
Under the polynomial kernel's quadratic feature map, the two classes become two distinct vectors:The hyperplane separates them. With and , the score and classifier areAll four signed scores equal one. In the input plane the boundary is , the union of the coordinate axes; in the derived coordinates it is a single hyperplane. The feature map identifies opposite corners, which is harmless for these labels because opposite corners belong to the same class. A fixed feature map would not separate labels that disagree at identical mapped vectors.
XOR labels in the input square and the quadratic feature slice
. The dashed diagonals join equal-label input pairs and share their midpoint, obstructing affine separation. In the feature panel all mapped points have third coordinate one; the two coincident pairs are separated by the horizontal hyperplane at second coordinate zero. Details.
