Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #abcd | comm1, comm2, comm3 := comm -23, comm -13, comm -12
- #0000 cc ┌──┤ C ├──┐
- #0001 0132 │ │
- #0010 4576 b ┌───────────┼───────────┼───┐
- #0011 a CDFE b │ ┌─────┼─────┐ │ │
- #0100 a 89BA │ │ │ │ │ ┴
- #0101 dd ┌──┼─────┼─────┼─────┼─────┼─┐ B
- #0110 Karnaugh map │ │ │ │ │ │ │ ┬
- #0111 ┴ │ │ │ │ │ │ │
- #1000 A └─────┼─────┼─────┼─────┼─┼─┘
- #1001 ┬ │ │ │ │ │
- #1010 │ │ │ │ │ │
- #1011 └────────┼─────┼─────┼─────┼─┘
- #1100 │ │ │ │
- #1101 │ └─────┼─────┘
- #1110 │ │
- #1111 └──┤ D ├──┘
- echo "We suppose that a, b, c, d are ordered lists."
- #s0000 not needed
- comm1 d c >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 a >s0001
- comm1 c d >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 a >s0010
- comm3 c d >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 a >s0011 #in both c and d, from result: not in b, from result: not in a
- comm1 b d >tmp1; comm1 tmp1 c >tmp2; comm1 tmp2 a >s0100
- comm3 b d >tmp1; comm1 tmp1 c >tmp2; comm1 tmp2 a >s0101
- comm3 b c >tmp1; comm1 tmp1 a >tmp2; comm1 tmp2 d >s0110
- comm3 c d >tmp1; comm3 tmp1 b >tmp2; comm1 tmp2 a >s0111
- comm1 a b >tmp1; comm1 tmp1 c >tmp2; comm1 tmp2 d >s1000
- comm3 a d >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 c >s1001
- comm3 a c >tmp1; comm1 tmp1 b >tmp2; comm1 tmp2 d >s1010
- comm3 a c >tmp1; comm3 tmp1 d >tmp2; comm1 tmp2 b >s1011
- comm3 a b >tmp1; comm1 tmp1 c >tmp2; comm1 tmp2 d >s1100
- comm3 a b >tmp1; comm3 tmp1 d >tmp2; comm1 tmp2 c >s1101
- comm3 a b >tmp1; comm3 tmp1 c >tmp2; comm1 tmp2 d >s1110
- comm3 a b >tmp1; comm3 tmp1 c >tmp2; comm3 tmp2 d >s1111
- rm -f tmp1 tmp2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement