1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* SPDX-License-Identifier: MIT
* Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
*/
use crateIdentifiable;
/// Represents a symbolic, logical, or linguistic identity.
///
/// This trait allows integration of abstract knowledge representations
/// into a unified context system—such as:
/// - Atoms (`"A"`)
/// - Named terms (`goal(X)`)
/// - Logical constructs (`∀x.P(x) → Q(x)`)
///
/// The `Repr` type is intentionally generic to support structured representations:
/// enums, trees, strings, or AST nodes.
///
/// # Example
/// ```
/// use deep_causality::{Identifiable, Symbolic};
///
/// struct RuleNode { id: u64, term: String }
///
/// impl Identifiable for RuleNode {fn id(&self) -> u64 {
/// self.id
/// }}
///
/// impl Symbolic for RuleNode {
/// type Repr = String;
/// fn symbol(&self) -> &Self::Repr { &self.term }
/// }
/// ```