Donatas Latauskas

Greenhorn

Posts: 14

posted 11 years ago

I assume you mean this???

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors

Stan James

(instanceof Sidekick)

Ranch Hand

Ranch Hand

Posts: 8791

posted 11 years ago

I'm curious what you're using them for. My only exposure was building Karnaugh maps which can be used to reduce a set of predicates to their minimal form, eliminating redundant logic tests. I don't even know if taht makes sense. Here are some class notes from tenty some years ago ...

The numbers in the boxes are the decimal value of a set of bits made up of the predicates. The order is the "Gray Code" which changes by one bit from one box to another in any direction. Note that the top and bottom edges are "adjacent", as are the right and left edges. For example, in the 4-variable map only one bit changes when moving from box 2 to box 0, or from box 2 to box A.

For each combination of predicates, if the result is true shade in the box. Also shade in "don't care" boxes; combinations which cannot happen, or for which the result is ignored.

If there are two adjacent shaded boxes, you can ignore the predicate which changes and test only the predicate(s) which do not. For four adjacent boxes ignore the two predicates which change, and for eight adjacent boxes ignore the three predicates which change.

Create an "if test" for each contiguous group of boxes, and "or" those tests together for the final result.

The numbers in the boxes are the decimal value of a set of bits made up of the predicates. The order is the "Gray Code" which changes by one bit from one box to another in any direction. Note that the top and bottom edges are "adjacent", as are the right and left edges. For example, in the 4-variable map only one bit changes when moving from box 2 to box 0, or from box 2 to box A.

For each combination of predicates, if the result is true shade in the box. Also shade in "don't care" boxes; combinations which cannot happen, or for which the result is ignored.

If there are two adjacent shaded boxes, you can ignore the predicate which changes and test only the predicate(s) which do not. For four adjacent boxes ignore the two predicates which change, and for eight adjacent boxes ignore the three predicates which change.

Create an "if test" for each contiguous group of boxes, and "or" those tests together for the final result.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi