Skip to content

Write two implication constraints from scratch

write-from-scratch

a -> b means “whenever a holds, b holds too”. It says nothing about the case where a doesn’t hold, and it isn’t symmetric: write the sides backwards and it still compiles, but enforces the opposite rule.

Fix the class below.

Requirements

  1. alarm_active is only ever true when temp_reading is over 100. A high reading doesn’t force the alarm on.
  2. Whenever maint_mode is true, alarm_active is false.

Source on GitHub

implies_basics.sv