Coq’s Require Import vs Require Export

The difference between Require Import MyModule and Require Export MyModule is well explained in the modules tutorial:

If a required module depends on other modules then the latter’s are automatically required beforehand. However their contents are not automatically visible. If you want a module M required in a module N to be automatically visible when N is required, you should use Require Export M in your module N.

Encapsulation is not information hiding

Notes from Encapsulation is not information hiding:

  • Encapsulation rule 1: Place data and the operations that perform on that data in the same class
  • Encapsulation rule 2: Use responsibility-driven design to determine the grouping of data and operations into classes
  • Information hiding rule 1: Don’t expose data items
  • Information hiding rule 2: Don’t expose the difference between stored data and derived data
  • Information hiding rule 3: Don’t expose a class’s internal structure
  • Information hiding rule 4: Don’t expose implementation details of a class