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 7
7
(eval-when (:compile-toplevel )
8
8
(defconstant F nil ))
9
9
10
- (defparameter *valid-operators* ' (~ ^ <=> => v [+]))
10
+ (defparameter *valid-operators* ' (~ ^ <=> => -> <-> v [+]))
11
11
12
12
; ; operators
13
13
(defun ~ (p)
23
23
(or p q))
24
24
25
25
(defun => (p q)
26
- " Implication binary operator"
26
+ " Conditional binary operator"
27
27
(v (~ p) q))
28
28
29
29
(defun <=> (p q)
30
30
" Biconditional binary operator"
31
31
(^ (=> p q) (=> q p)))
32
32
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
+
33
41
(defun [+] (p q)
34
42
" XOR operator or exclusive disjunction operator"
35
43
(^ (~ (^ p q))
Original file line number Diff line number Diff line change 47
47
# :truth
48
48
# :truth-infix
49
49
# :*output-stream*
50
+ # :*valid-operators*
50
51
# :main)
51
52
(:nicknames " INFERENCE" ))
Original file line number Diff line number Diff line change 78
78
:placeholder (trim-paren (prop table)))
79
79
(:input :type " submit"
80
80
: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)))))))
82
90
83
91
(defmethod render ((string string ))
84
92
(with-html
You can’t perform that action at this time.
0 commit comments