detect_contradictions
Detect logical contradictions in knowledge structures by flagging mutually exclusive relations, multi-valued functional relations, and inference confidence conflicts. Ensures consistent, valid knowledge.
Instructions
Detect logical contradictions in a Knowledge Structure using the contradiction/conflict extension constraints. Supports three types of detection:
mutual_exclusion: Flags when the same source-target pair has both of two declared relation types.
functional_relation: Flags when a source has multiple targets via a declared single-valued relation type.
inference_confidence_conflict (see ADR-001): Flags when two or more active (non-superseded) InferenceStep objects share a 'conclusion' but disagree on 'confidence'. Reported at WARNING severity, not ERROR -- this is a resolvable belief conflict between agreeing inference paths, not a jointly-nonsensical relation pair. Mark a step no longer active with its own 'superseded_by' field, not by editing another step. Examples of contradiction rules:
MutualExclusionRule: {"identity": {"id": "rule-1", "type": "MutualExclusionRule", "name": "no-support-and-refute"}, "structure": {"relation_type_a": "supports", "relation_type_b": "refutes"}}. This flags when the SAME source-target pair has BOTH a 'supports' and a 'refutes' relation.
FunctionalRelationRule: {"identity": {"id": "rule-2", "type": "FunctionalRelationRule", "name": "single-orbit"}, "structure": {"relation_type": "orbits"}}. This flags when a single source has MORE THAN ONE target via 'orbits'. To use mutual_exclusion/functional_relation, ensure your structure contains MutualExclusionRule and/or FunctionalRelationRule objects. inference_confidence_conflict needs no rule object -- it applies to any InferenceStep objects present.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json_data | No | Optional. JSON Knowledge Structure to check (if no session_id). | |
| session_id | No | Optional. Session whose structure to check for contradictions. |