Re:Racket: Parsing propositional logic in 33 lines
by ahelwer on Friday October 16, 2020 @06:44AM
(#24799467)
TLA+ is an example. What I really like about this notation is you can use alignment to indicate precedence:
\/ /\ A
/\ B
\/ /\ C
/\ D
Which represents (A & B) || (C & D). It helps quite a bit for parsing large formulas in your head. In TLA+ the individual expressions are usually much more complicated than a single variable.
Re:Racket: Parsing propositional logic in 33 lines
by fanf2 on Friday October 16, 2020 @07:00AM
(#24799556)
Aha, occam is another example, but it uses AND and OR for logical expressions but \/ or /\ for bitwise, plus the exciting >< for xor! http://transputer.net/obooks/obooks.asp
Re:Racket: Parsing propositional logic in 33 lines
by kazinator on Friday October 16, 2020 @01:38PM
(#24803078)
XOR is just a Boolean "not equal to"; if I had to express that with > and <, I would crib from BASIC and use <>.
I am having trouble finding real world examples right now, but it happens in languages like ALGOL and CPL (tho they predate ASCII)