necoherence/semantic_validation
Types
pub type DefaultApplication {
DefaultApplication(
value_path: List(semantic_types.PathStep),
type_ref: semantic_types.TypeRef,
origin: semantic_types.OccurrenceRef,
value: exact_json.JsonValue,
)
}
Constructors
-
DefaultApplication( value_path: List(semantic_types.PathStep), type_ref: semantic_types.TypeRef, origin: semantic_types.OccurrenceRef, value: exact_json.JsonValue, )
DefaultedValue
opaquepub opaque type DefaultedValue
pub type MemberProof {
MemberProof(children: List(MemberProof))
}
Constructors
-
MemberProof(children: List(MemberProof))
pub type ProjectionAssumption {
Present(path: List(semantic_types.PathStep))
NonNull(path: List(semantic_types.PathStep))
Variant(path: List(semantic_types.PathStep), tag: String)
IndexPresent(path: List(semantic_types.PathStep), index: Int)
}
Constructors
-
Present(path: List(semantic_types.PathStep)) -
NonNull(path: List(semantic_types.PathStep)) -
Variant(path: List(semantic_types.PathStep), tag: String) -
IndexPresent(path: List(semantic_types.PathStep), index: Int)
pub type ProjectionCertificate {
ProjectionCertificate(
profile: semantic_types.ProfileRef,
source_refs: List(semantic_types.SourceRef),
source: semantic_types.SlotContract,
path: List(semantic_types.PathStep),
assumptions: List(ProjectionAssumption),
destination: semantic_types.SlotContract,
)
}
Constructors
-
ProjectionCertificate( profile: semantic_types.ProfileRef, source_refs: List(semantic_types.SourceRef), source: semantic_types.SlotContract, path: List(semantic_types.PathStep), assumptions: List(ProjectionAssumption), destination: semantic_types.SlotContract, )
pub type ProjectionFailure {
WrongShape(
type_ref: semantic_types.TypeRef,
path: List(semantic_types.PathStep),
)
MissingField(type_ref: semantic_types.TypeRef, name: String)
MissingVariant(type_ref: semantic_types.TypeRef, tag: String)
BranchAssumptionRequired(
path: List(semantic_types.PathStep),
tag: String,
)
ProjectionUnresolved(
obligations: List(semantic_types.SemanticObligation),
)
CertificateMismatch(condition: String)
}
Constructors
-
WrongShape( type_ref: semantic_types.TypeRef, path: List(semantic_types.PathStep), ) -
MissingField(type_ref: semantic_types.TypeRef, name: String) -
MissingVariant(type_ref: semantic_types.TypeRef, tag: String) -
BranchAssumptionRequired( path: List(semantic_types.PathStep), tag: String, ) -
ProjectionUnresolved( obligations: List(semantic_types.SemanticObligation), ) -
CertificateMismatch(condition: String)
pub type ProjectionValueFailure {
Projection(failure: ProjectionFailure)
Validation(failure: ValidationFailure)
UnsatisfiedGuard
}
Constructors
-
Projection(failure: ProjectionFailure) -
Validation(failure: ValidationFailure) -
UnsatisfiedGuard
ValidatedSlot
opaquepub opaque type ValidatedSlot
ValidatedValue
opaquepub opaque type ValidatedValue
pub type ValidationFailure {
Rejected(failure: semantic_types.ValueFailure)
Unresolved(
obligations: List(semantic_types.SemanticObligation),
)
CertificateMismatchFailure(condition: String)
}
Constructors
-
Rejected(failure: semantic_types.ValueFailure) -
Unresolved(obligations: List(semantic_types.SemanticObligation)) -
CertificateMismatchFailure(condition: String)
Values
pub fn accepts_slot(
graph: semantic_types.SemanticGraph,
contract: semantic_types.SlotContract,
value: semantic_types.SlotValue(exact_json.JsonValue),
) -> Bool
pub fn accepts_value(
graph: semantic_types.SemanticGraph,
reference: semantic_types.TypeRef,
value: exact_json.JsonValue,
) -> Bool
pub fn assumption_holds(
tag: option.Option(semantic_types.TagModel),
value: exact_json.JsonValue,
assumption: ProjectionAssumption,
) -> Bool
pub fn check_default_applications(
graph: semantic_types.SemanticGraph,
before: exact_json.JsonValue,
after: exact_json.JsonValue,
applications: List(DefaultApplication),
) -> Bool
pub fn check_meaning_defined(
graph: semantic_types.SemanticGraph,
references: List(semantic_types.TypeRef),
) -> Result(Nil, semantic_types.MeaningFailure)
pub fn check_member_certificate(
graph: semantic_types.SemanticGraph,
reference: semantic_types.TypeRef,
value: exact_json.JsonValue,
proof: MemberProof,
) -> Result(Nil, ValidationFailure)
pub fn check_profile(
profile: semantic_types.SemanticProfile,
) -> Result(
semantic_types.CheckedProfile,
semantic_types.ProfileFailure,
)
pub fn check_projection_certificate(
graph: semantic_types.SemanticGraph,
certificate: ProjectionCertificate,
) -> Result(Nil, ProjectionFailure)
pub fn declared_value_decision(
graph: semantic_types.SemanticGraph,
reference: semantic_types.TypeRef,
value: exact_json.JsonValue,
) -> semantic_types.ValueDecision
pub fn defaulted_value(
value: DefaultedValue,
) -> exact_json.JsonValue
pub fn defaulted_value_applications(
value: DefaultedValue,
) -> List(DefaultApplication)
pub fn defaulted_value_graph(
value: DefaultedValue,
) -> semantic_types.SemanticGraph
pub fn defaulted_value_type_ref(
value: DefaultedValue,
) -> semantic_types.TypeRef
pub fn element_allows_null(
graph: semantic_types.SemanticGraph,
contract: semantic_types.ElementContract,
) -> Bool
pub fn grapheme_boundaries(
rules: semantic_types.GraphemeRules,
text: String,
) -> List(Int)
pub fn grapheme_count(
rules: semantic_types.GraphemeRules,
text: String,
) -> Int
pub fn materialize_defaults(
graph: semantic_types.SemanticGraph,
reference: semantic_types.TypeRef,
value: exact_json.JsonValue,
) -> Result(DefaultedValue, ValidationFailure)
pub fn meaning_obligations(
graph: semantic_types.SemanticGraph,
references: List(semantic_types.TypeRef),
) -> List(semantic_types.SemanticObligation)
pub fn member_certificate(
graph: semantic_types.SemanticGraph,
reference: semantic_types.TypeRef,
value: exact_json.JsonValue,
) -> Result(MemberProof, ValidationFailure)
pub fn node_meaning_obligations(
graph: semantic_types.SemanticGraph,
reference: semantic_types.TypeRef,
) -> List(semantic_types.SemanticObligation)
pub fn object_class(
profile: semantic_types.SemanticProfile,
value: exact_json.JsonValue,
) -> semantic_types.ObjectClass
pub fn project_slot(
graph: semantic_types.SemanticGraph,
source: semantic_types.SlotContract,
path: List(semantic_types.PathStep),
assumptions: List(ProjectionAssumption),
) -> Result(ProjectionCertificate, ProjectionFailure)
pub fn project_value(
graph: semantic_types.SemanticGraph,
certificate: ProjectionCertificate,
source: semantic_types.SlotValue(exact_json.JsonValue),
) -> Result(ValidatedSlot, ProjectionValueFailure)
pub fn recognizes(
rule: semantic_types.FormatRule,
text: String,
) -> Bool
pub fn validate_slot(
graph: semantic_types.SemanticGraph,
contract: semantic_types.SlotContract,
value: semantic_types.SlotValue(exact_json.JsonValue),
) -> Result(ValidatedSlot, ValidationFailure)
pub fn validate_value(
graph: semantic_types.SemanticGraph,
reference: semantic_types.TypeRef,
value: exact_json.JsonValue,
) -> Result(ValidatedValue, ValidationFailure)
pub fn validated_slot_contract(
value: ValidatedSlot,
) -> semantic_types.SlotContract
pub fn validated_slot_graph(
value: ValidatedSlot,
) -> semantic_types.SemanticGraph
pub fn validated_slot_value(
value: ValidatedSlot,
) -> semantic_types.SlotValue(exact_json.JsonValue)
pub fn validated_value(
value: ValidatedValue,
) -> exact_json.JsonValue
pub fn validated_value_graph(
value: ValidatedValue,
) -> semantic_types.SemanticGraph
pub fn validated_value_proof(
value: ValidatedValue,
) -> MemberProof
pub fn validated_value_type_ref(
value: ValidatedValue,
) -> semantic_types.TypeRef
pub fn value_at_path(
tag: option.Option(semantic_types.TagModel),
value: exact_json.JsonValue,
path: List(semantic_types.PathStep),
) -> semantic_types.SlotValue(exact_json.JsonValue)
pub fn wrapper_payload_text(
profile: semantic_types.SemanticProfile,
wrapper: semantic_types.Wrapper,
value: exact_json.JsonValue,
) -> Result(String, semantic_types.ValueCondition)