module constraints is

  entity Constrained is

    identity id -> string

    is_thing -> boolean

    has_thing -> {0..1} string is
      assert not_null = "if is_thing then has_thing is not null"
    end

    has_other_thing -> {0..1} string is
      assert also_not_null is
        ∀ self, has_thing(container(self)) ==> not empty(self)
      end
    end

    has_no_constraints -> integer
  end

end
