Predicate logic for invariants

Description

Writes the properties an interface must always satisfy as logical statements, so that designs and implementations can be checked against them systematically.

An invariant is a condition that must hold in every reachable state. Expressed in predicate logic, interface invariants make design intentions testable: 'for all states s, displayed_mode(s) = actual_mode(s)'; 'for all states s, if armed(s) then stop_enabled(s)'; 'for all actions a, if destructive(a) then reversible(a) or confirmed(a)'. Dix and Harrison's work defined classes of interaction properties such as predictability, observability and reachability in this way. Invariants can then be checked by model checkers, property-based tests or runtime assertions. Rigour comes from precise variable definitions, quantifiers that cover all states and actions, and linking each invariant to a hazard or usability principle.

Attributes

Loss type
Siloed
Stage
Design
Effort
Days

Steps

  1. Identify hazards and usability principles that must never be violated (mode visibility, reversibility, stop availability, consent).
  2. Define the state variables and predicates needed to express them unambiguously.
  3. Write each invariant in predicate logic with explicit quantifiers, and a plain-language paraphrase for stakeholders.
  4. Check invariants against a state model with a model checker (for example NuSMV, UPPAAL or TLA+) or encode them as property-based tests running thousands of generated action sequences.
  5. Investigate every counter-example trace, deciding whether to change the design or refine the invariant.
  6. Keep invariants as living requirements, re-checking at each release.

Sources

  • Weyers, B., Bowen, J., Dix, A. & Palanque, P. (eds), The Handbook of Formal Methods in Human-Computer Interaction (2017)
  • Handbook of Formal Methods in HCI
  • The Inquiry Series, Ch 5 — State, Transition & the Logic of Interaction
  • Hofstadter, D., Gödel, Escher, Bach: An Eternal Golden Braid (1979)
  • Gödel Escher Bach (Hofstadter)

Also known as

  • Invariant specification
  • Interface invariants
  • Safety property specification

Categories

  • User Research
  • Task Analysis & Cognitive Modelling