<< Prev | - Up - | Next >> |
Write an abstract data-structure to represent finite sets. Your data type should at least provide the functionality of adding an element to the set and testing whether an element is in the set.
Implement another abstract data-structure to represent finite sets. This time, however, assume the all elements of your sets belong to a given finite subset of atomic values.
Reduce an until loop to a while loop.
Write an abstract data structure Counter
in object style which supports the operations increment
, decrement
, and toInt
.
Represent the formulas of propositional logics as terms. The labels of these terms should subsume
and 'or' implies 'not' var
and other atoms for propositional variables. Then write a function that maps all propositional variables occuring in propositional formula to a unique number you assign to it. Hint: dictionaries and counters might help.
<< Prev | - Up - | Next >> |