Jim Newton
1/13/2016 1:42:00 PM
I'm working on some code to do reductions of type specifiers.
I've come across 4 reductions which I especially thought were interesting which I
didn't think about until they came up in test cases.
1. (and number (member 1 2 a b))
2. (or number (member 1 2 a b))
3. (and number (not (member 1 2 a b)))
4. (or number (not (member 1 2 a b)))
1. --> (member 1 2)
2. --> (or number (member a b))
3. --> (and number (not (member 1 2)))
4. --> (not (member a b)))
1. keep (member...) but throw away everything which DOES NOT match all the other types
2. keep the form but remove the elements of (member) which DO match any of the other types.
3 & 4 can be seen using d'morgen's theorem
3: (and number (not (member 1 2 a b)))
--> (not (or (not number) (member 1 2 a b)))
--> (not (or (not number) (member 1 2))) ; by reduction 2
--> (and number (not (member 1 2)))
4: (or number (not (member 1 2 a b)))
--> (not (and (not number) (number 1 2 a b)))
--> (not (number a b)) ; by reduction 1