Public
Edited
Aug 31, 2022
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
truthTable(formula)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
logicParser = {
const expParserData = {
tokens: {
Space: /\s+/,
Literal: /\w+/,
Or: [/∨/, /\|/],
And: [/∧/, /&/],
Implies: [/→/, /->/],
Equiv: [/↔/, /<->/],
Xor: [/⊕/, /\^/],
Not: [/¬/, /\!/],
LeftParen: /\(/,
RightParen: /\)/
},
binaryOp: ["Or", "And", "Implies", "Equiv", "Xor"],
precedence: { Or: 3, And: 3, Xor: 3, Implies: 2, Not: 4, Equiv: 1 },
associativity: { Implies: "Right", Equiv: "Right" },
unaryOp: ["Not"],
terminal: ["Literal"]
};

return expressionParser(expParserData);
}
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more