Relations as executable specifications: taming partiality and non-determinism using invariants

  • Authors:
  • Nuno Macedo;Hugo Pacheco;Alcino Cunha

  • Affiliations:
  • HASLab -- High Assurance Software Laboratory, INESC TEC & Universidade do Minho, Braga, Portugal;HASLab -- High Assurance Software Laboratory, INESC TEC & Universidade do Minho, Braga, Portugal;HASLab -- High Assurance Software Laboratory, INESC TEC & Universidade do Minho, Braga, Portugal

  • Venue:
  • RAMiCS'12 Proceedings of the 13th international conference on Relational and Algebraic Methods in Computer Science
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

The calculus of relations has been widely used in program specification and reasoning. It is very tempting to use such specifications as running prototypes of the desired program, but, even considering finite domains, the inherent partiality and non-determinism of relations makes this impractical and highly inefficient. To tame partiality we prescribe the usage of invariants, represented by coreflexives, to characterize the exact domains and codomains of relational specifications. Such invariants can be used as pre-condition checkers to avoid runtime errors. Moreover, we show how such invariants can be used to narrow the non-deterministic execution of relational specifications, making it viable for a relevant class of problems. In particular, we show how the proposed techniques can be applied to execute specifications of bidirectional transformations, a domain where partiality and non-determinism are paramount.