Abstract Wikipedia/Validation of core types

This is the state for the pre-generic function model.

Z1/ObjectEdit

  1. This is the standard checker which is called by most of the other validators
  2. Checks that the schemata is being followed (this should cover the following points)
  3. the type Z1 is forbidden on Z1K1
  4. (Condition 1) All keys used on the instance are defined on the type
  5. (Condition 2) All required keys are used on the instance
  6. (Condition 3) The types of the values are compatible with the declared types for the respective keys (compatible means that the value is either of the type given or a reference or a function call) - if we can look into other objects, ensure the reference has the correct type or the function call returns either the correct type or Z1
  7. (Condition 4) All values on the keys are checked recursively and validation errors on those are propagated

Z2/Persistent objectEdit

  1. Use the standard checker of Z1
  2. Ensure that the value of Z2K2 is not of type Z1, Z2, Z3, Z9, Z17, Z18, Z39

Z3/KeyEdit

  1. Use the standard checker of Z1
  2. ensure the syntax of the Z3K2/key is is ZnKn

Z4/TypeEdit

  1. Use the standard checker of Z1
  2. Ensure all Z3K2/key ids of all Z4K2/keys are unique
  3. Ensure all Z3K2/key ids of all Z4K2/keys are consecutive and start with ZnK1
  4. Ensure all Z3K2/key ids of all Z4K2/keys start with the Z4K1/identity
  5. ensure the Z8K2/return type of the function on Z4K3/validator is Z10/List

Z5/ErrorEdit

  1. Use the standard checker of Z1
  2. Ensure the type of the value of Z5K2 is the type given in Z5K1

Z6/StringEdit

  1. Use the standard checker of Z1
  2. the Z6K1 must be a JSON string and not a reference or function call or another object

Z7/Function callEdit

  1. Do not use the standard checker of Z1
  2. the keys must be Z1K1, Z7K1, and the keys of the arguments defined on the function given in the Z7K1, and nothing else
  3. the type of Z7K1 must be a function
  4. the type of the arguments must be compatible with the type defined on the argument declaration
  5. Add general condition 4

Z8/FunctionEdit

  1. Use the standard checker of Z1
  2. Ensure all Z17K2/key ids of all Z8K1/arguments are unique
  3. Ensure all Z17K2/key ids of all Z8K1/arguments are consecutive and start with ZnK1
  4. Ensure all Z17K2/key ids of all Z8K1/arguments start with the Z8K5/identity

Z9/ReferenceEdit

  1. Use the standard checker of Z1
  2. the Z9K1 must be a JSON string and not a reference or function call or another object
  3. the Z9K1 string must be of the form Zn

Z10/ListEdit

  1. Either the only key is Z1K1, or use the standard checker of Z1

Z11/Monolingual textEdit

  1. Use the standard checker of Z1

Z12/Multilingual textEdit

  1. Use the standard checker of Z1
  2. each Z11K1/language on all Z12K1/texts appears only once

Z14/ImplementationEdit

  1. Use only condition 1, 3, and 4 of the standard checker of Z1
  2. require Z14K1
  3. require one, and exactly one of Z14K2, Z14K3, or Z14K4

Z16/CodeEdit

  1. Use the standard checker of Z1

Z17/Argument declarationEdit

  1. Use the standard checker of Z1
  2. ensure the syntax of the Z17K2/key is ZnKn

Z18/Argument referenceEdit

  1. Use the standard checker of Z1
  2. ensure the syntax of the Z18K1/key id is ZnKn

Z20/TesterEdit

  1. Use the standard checker of Z1
  2. ensure the Z8K2/return type of the function on Z20K2/result validation is Z40/Boolean

Z21/UnitEdit

  1. Use the standard checker of Z1

Z22/PairEdit

  1. Use the standard checker of Z1

Z23/NothingEdit

  1. always fail (no instances of Nothing are allowed), i.e. just return an error that no instances of Nothing are allowed

Z40/BooleanEdit

  1. Use the standard checker of Z1
  2. the value of Z40K1/identity must be either Z41 or Z42

Z50/Error typeEdit

  1. Use the standard checker of Z1
  2. Ensure all Z3K2/key ids of all Z50K1/keys are unique
  3. Ensure all Z3K2/key ids of all Z8K1/arguments are consecutive and start with ZnK1
  4. Ensure all Z3K2/key ids of all Z8K1/arguments start with the Z8K5/identity

Z60/LanguageEdit

  1. Use the standard checker of Z1
  2. check if Z60K1 is a valid language code (? Maybe skip that, maybe make its own task) - i.e. check if it is of the form 2 or 3 letters, potentially followed by a dash and region code (i.e. 2 letters), potentially followed by a script identifier (i.e. a dash and then four letters)

Z61/Programming languageEdit

  1. Use the standard checker of Z1
  2. ensure the Z61K1 is just letters and dashes

Z80/ByteEdit

  1. Use the standard checker of Z1
  2. ensure Z80K1 has exactly two characters, both in 0..9A..F

Z86/CharacterEdit

  1. Use the standard checker of Z1
  2. ensure the length of Z86K1 is 1

Z99/QuoteEdit

  1. Do not use the standard checker of Z1 (the idea of the quote is that the quote value can be erroneous)
  2. do check that the only two keys are a Z1K1 and a Z99K1 and that both are there. Do not check the value of Z99K1 recursively.