Conjunctive normal form

Run Settings
LanguagePlaintext
-- Schema 1: Reify disjunctions. CREATE TABLE conjunctions ( id uuid PRIMARY KEY ); CREATE TABLE disjunctions ( id uuid PRIMARY KEY, conjunction_id uuid FOREIGN KEY REFERENCES conjunctions (id) ); CREATE TABLE literals ( id uuid PRIMARY KEY, disjunction_id uuid FOREIGN KEY REFERENCES disjunctions (id), value boolean NOT NULL ); -- Schema 2: Implicit disjunctions. CREATE TABLE conjunctions ( id uuid PRIMARY KEY ); CREATE TABLE literals ( id uuid PRIMARY KEY, conjunction_id uuid FOREIGN KEY REFERENCES conjunctions (id), disjunction_id uuid NOT NULL, value boolean NOT NULL ); -- Literals belong to the same disjunction if -- they have the same (conjunction_id, disjunction_id) combination.
Editor Settings
Theme
Key bindings
Full width
Lines