Skip to contents

Built-in validation. The default (full = FALSE) checks required fields and enum membership. With full = TRUE it additionally checks referential integrity: that every id is unique within its collection and that every cross-reference (proposition endpoints, prediction derivations and diagnostics, and assumption, evidence and test-outcome targets) points to a declared id. The full checks are deterministic.

Usage

tf_validate(theory, full = FALSE)

Arguments

theory

A theory object (named list), e.g. from tf_read().

full

When TRUE, also run the referential-integrity checks.

Value

TRUE (invisibly) on success; otherwise stops with a message listing every problem found.

Examples

theory <- tf_theory("demo-1", "A demonstration theory")
tf_validate(theory)
tf_validate(theory, full = TRUE)