As with the last exercise, you should load the numLib library to define the natural numbers before continuing.
Until now we have been interested in the voltage level on a wire only at a particular point in time. For this purpose it was sufficient to model a wire as a boolean value, with true representing a high value and false representing a low one. We would now like to look at how the voltage on a wire changes over time; for this we require a more elaborate model.
We will model times as natural numbers. Time 0 will be the time at which the circuit is turned on, and greater numbers will represent progressively later times. The length of time between some time point t and the next t+1 will be some arbritrary, but small, period of time; lets call it a tick. For the sake of argument, lets say that a tick is equal to the switching time of a CMOS gate, called a gate delay.
Lets now think of a wire not just as a voltage, but as a wave-form, which describes how the voltage changes over time. We can model this in HOL as a function from numbers to booleans. For example, If w is a wire, then w t models the voltage (high or low) on that wire at time t. For example, imaging the waveform below as a function from numbers to booleans.
| High: | |||||||||||
| Low: | ... | ||||||||||
| Time: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
Using this model of time, define a predicate DNOR a b c such that the predicate represents a NOR gate with input wires a and b and output wire c, and there is a one `tick' propagation delay between a value being present on the input wires and the corresponding value appearing on the output wire.
Using the DNOR predicate define a predicate SR_IMP r s q q' to represent the following circuit:
| SR Flip-Flop |
![]() |
Next, prove the following properties of the flip-flop implementation:
Hints:
Num_conv.num_CONV to get rid of `abstract' decimal notation
(e.g., `1',`2', etc.) from your goal
early on by converting it into unary form (e.g.,
`SUC 0',
`SUC (SUC 0)').
arithmeticTheory.ADD_CLAUSES.
You can search for existing theorems using the LAL documentation system by selecting the option `HOL Theorem Manual' from the search menu. Use this facility to find all the theorems with names that contain `ADD'.
The MoscowML help system can be used to learn more about any loaded
theory (and many other things besides). For example, use the command
`help "arithmeticTheory"' to learn more about the
arithmetic theory.