ValidQ

ValidQ[expr]
gives True if expr is a valid class instance, and False otherwise.

ValidQ[expr,class]
gives True if expr is a class instance with class class or one of its parents and satisfying the invariant of class, and False otherwise.

ValidQ[expr,invariant]
gives True if all functions in invariant produce True when acting on the Association of elements in the class instance expr, and False otherwise.

DetailsDetails

  • ValidQ[instance] checks the invariant specified for the class symbol to which instance belongs
  • Additional invariants can be specified using DeclareInvariant.
  • The following options can be given:
  • "Verbose"Falsegenerates messages indicating validity of elements