========================
Entity, With Constraints
========================

module corpus_test_entity is

  entity Campaign is

    identity a -> CampaignId

    b -> xsd:string is
      assert not_null = "self is not null"
    end

    c -> Target is
      assert tagged_with_foo is
        self.tags.contains("foo")
      end

    end

  end

end

---

    (module
      (identifier)
      (module_body
        (entity_def
          (identifier)
          (entity_body
            (entity_identity
              (member
                (member_def
                  (identifier)
                  (type_reference
                    (identifier_reference
                      (identifier))))))
            (member
              (member_def
                (identifier)
                (type_reference
                  (identifier_reference
                    (qualified_identifier
                      (identifier)
                      (identifier))))
                (annotation_only_body
                  (annotation
                    (constraint
                      (identifier)
                      (informal_constraint
                        (quoted_string)))))))
            (member
              (member_def
                (identifier)
                (type_reference
                  (identifier_reference
                    (identifier)))
                (annotation_only_body
                  (annotation
                    (constraint
                      (identifier)
                      (formal_constraint
                        (constraint_sentence
                          (simple_sentence
                            (atomic_sentence
                              (term
                                (function_composition
                                  (reserved_self)
                                  (identifier)
                                  (identifier)))
                              (term
                                (predicate_value
                                  (simple_value
                                    (string
                                      (quoted_string))))))))))))))))))
