File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 77(eval-when (:compile-toplevel )
88 (defconstant F nil ))
99
10- (defparameter *valid-operators* ' (~ ^ <=> => v [+]))
10+ (defparameter *valid-operators* ' (~ ^ <=> => -> <-> v [+]))
1111
1212; ; operators
1313(defun ~ (p)
2323 (or p q))
2424
2525(defun => (p q)
26- " Implication binary operator"
26+ " Conditional binary operator"
2727 (v (~ p) q))
2828
2929(defun <=> (p q)
3030 " Biconditional binary operator"
3131 (^ (=> p q) (=> q p)))
3232
33+ (defun -> (p q)
34+ " Notation alias for conditional"
35+ (=> p q))
36+
37+ (defun <-> (p q)
38+ " Notation alias for biconditional"
39+ (<=> p q))
40+
3341(defun [+] (p q)
3442 " XOR operator or exclusive disjunction operator"
3543 (^ (~ (^ p q))
Original file line number Diff line number Diff line change 4747 # :truth
4848 # :truth-infix
4949 # :*output-stream*
50+ # :*valid-operators*
5051 # :main)
5152 (:nicknames " INFERENCE" ))
Original file line number Diff line number Diff line change 7878 :placeholder (trim-paren (prop table)))
7979 (:input :type " submit"
8080 :value " Eval" ))
81- (:pre (truth table))))
81+ (:pre (truth table))
82+ (:pre (format nil " Operators: ~a " inference :*valid-operators* ))
83+ (:p " Some notes: "
84+ (:ul
85+ (loop for note in ' (" My lexer doesn't works very well for parenthesis."
86+ " Please, don't be evil. Use less than 10 variables."
87+ " Yes, [+] it's a XOR. Mathematically: p ⊕ q."
88+ " (=> ->) and (<=> <->) are aliases." )
89+ do (:li (render note)))))))
8290
8391(defmethod render ((string string ))
8492 (with-html
You can’t perform that action at this time.
0 commit comments