Expand description
Dynamic Epistemic Logic (DEL) layer — separating objective and subjective reality.
§Core design
Standard databases have one “God’s eye” table. QualiaDB separates:
-
Objective reality (
OBJECTIVE_CONTEXT) — cryptographically proven facts. A quin here hasprov:wasGeneratedBypointing to aq42ep:CryptoSensororq42ep:SignedObjectiveEvent. SHACLObjectiveKnowledgeShapevalidates this. -
Per-agent epistemic space (
agent_epistemic_context(did)) — beliefs, inferences, and hearsay scoped to one agent. Multiple agents can hold different valid epistemic states about the same proposition at the same time.
§John / Frank / Jane scenario
t₁: John directly observes the matter.
→ assert_objective_knowledge(john_did, matter_hash, sensor_hash, t1)
t₂: Frank queries the matter — his query is itself an epistemic event.
→ record_query_observation(frank_did, matter_hash, t2)
t₃: Jane observes Frank's query (not the original matter).
t₄: Jane derives her own version.
→ assert_inferred_belief(jane_did, jane_variant_hash, frank_query_hash, t4)Jane’s context (agent_epistemic_context(jane_did)) never overwrites
John’s context. SPARQL queries traverse either timeline independently.
§SHACL classification
classify_epistemic_state() evaluates the quin slice against three shapes:
ObjectiveKnowledge—prov:wasGeneratedBy→ CryptoSensor/SignedObjectiveEventInferredBelief—prov:wasDerivedFrom→ AgentQuery/HearsayEventHearsayBelief—q42ep:believesViaHearsaypresentUnknown— no matching modality predicate found
Integration with deontic_logic.rs:
OP_PERMIT read IF classify() == ObjectiveKnowledge
OP_CONDITIONALLY_PERMIT read IF classify() == InferredBelief
Enums§
- Epistemic
State - The epistemic weight of an agent’s belief about a proposition.
Constants§
- C_
AGENT_ QUERY q42ep:AgentQueryclass hash — a query event is itself an epistemic event.- C_
CRYPTO_ SENSOR q42ep:CryptoSensorclass hash — hardware-attested or cryptographically signed source.- C_
HEARSAY_ EVENT q42ep:HearsayEventclass hash — information from an unverified peer.- C_
SIGNED_ OBJECTIVE_ EVENT q42ep:SignedObjectiveEventclass hash — notarized or DID-signed objective event.- EPISTEMIC_
CONTEXT - Base epistemic metadata context (query events, propagation records).
- OBJECTIVE_
CONTEXT - Cryptographically verified facts, shared across all agents.
- P_
BELIEVES_ VIA_ HEARSAY q42ep:believesViaHearsay— belief received from an unverified peer.- P_
COG_ BELIEVES cog:believes— the core JTB belief relation.- P_
COG_ INFERS cog:infers— an agent infers a new belief.- P_
COG_ OBSERVES cog:observes— an agent observes an event.- P_
COG_ QUERIES cog:queries— an agent queries about a proposition.- P_
INFERS_ FROM q42ep:infersFrom— agent derived a belief via local logic from a source event.- P_
KNOWS_ DIRECTLY q42ep:knowsDirectly— agent has direct cryptographic or sensory proof.- P_
WAS_ DERIVED_ FROM prov:wasDerivedFrom— derivation edge in the PROV-O provenance chain.
Functions§
- agent_
epistemic_ context - Derive the per-agent epistemic context for
did_hash. - all_
beliefs_ of - Write the propositions that
agent_didbelieves via any modality intoout. - assert_
hearsay_ belief - Record that
agent_didholds a HearsayBelief aboutproposition_hash, received frominformant_did(an unverified peer). - assert_
inferred_ belief - Record that
agent_didholds an InferredBelief aboutproposition_hash, derived fromsource_hash(anAgentQueryorHearsayEvent). - assert_
objective_ knowledge - Record that
agent_didhas ObjectiveKnowledge ofproposition_hash, justified byproof_hash(e.g. aq42ep:CryptoSensororq42ep:SignedObjectiveEvent). - classify_
epistemic_ state - Classify the epistemic state of
agent_didregardingproposition_hash. - has_
objective_ proof - Return true if any quin in the slice classifies
propositionas ObjectiveKnowledge for at least one agent. - objective_
knowledge_ of - Write the propositions that
agent_didholds ObjectiveKnowledge of intoout. - record_
query_ observation - Record a query event —
observer_didqueries aboutquery_subject_hash. - register_
crypto_ sensor_ output - Record that
agent_didtypedevent_hashas aq42ep:CryptoSensorresult. Call this when wiring hardware-attested data into the objective context. - register_
query_ event - Record that
agent_didtypedevent_hashas aq42ep:AgentQuery. Call this alongsiderecord_query_observationso SHACL shapes can validate it.