|
1 | | -# plingua |
2 | | -The P-Lingua language for Membrane Computing |
| 1 | +# RR-PLingua: Relevance Realization Enhanced Membrane Computing |
3 | 2 |
|
4 | | -P-Lingua is a comprehensive framework for membrane computing that provides a complete ecosystem for defining, parsing, simulating, and generating code for P-systems (membrane systems). |
| 3 | +**RR-PLingua** is an advanced membrane computing framework that integrates **Relevance Realization (RR)** dynamics with **OpenCog AtomSpace** symbolic reasoning, creating a unified platform for membrane computing with cognitive architectures. |
5 | 4 |
|
6 | | -## 📚 Documentation |
| 5 | +## 🧠 RR-RNN: Relevance Realization with Recursive Neural Networks |
| 6 | + |
| 7 | +This implementation extends the traditional P-Lingua framework with four major Next Development Directions, creating a sophisticated system for symbolic-subsymbolic integration in membrane computing environments. |
| 8 | + |
| 9 | +### ✨ Key Features |
| 10 | + |
| 11 | +- **🔗 Advanced PLN Integration**: Probabilistic Logic Networks with RR pattern reasoning |
| 12 | +- **💬 Enhanced Scheme Interface**: Interactive REPL for system exploration and manipulation |
| 13 | +- **💾 Persistent AtomSpace**: JSON serialization and incremental learning capabilities |
| 14 | +- **🏗️ Multi-Level Integration**: Hierarchical membrane structures with cross-level emergence |
| 15 | + |
| 16 | +## 🎯 Implementation Summary |
| 17 | + |
| 18 | +### 1. Advanced PLN Integration ✅ |
| 19 | +**File**: `include/pln_integration.hpp` |
| 20 | + |
| 21 | +- **PLN Truth Values**: Complete implementation with strength/confidence pairs |
| 22 | +- **Inference Rules**: |
| 23 | + - Deduction: A→B, A ⊢ B |
| 24 | + - Abduction: A→B, B ⊢ A (with reduced confidence) |
| 25 | +- **RR Pattern Implications**: Automatic generation of implications from high-coupling agent-arena relationships |
| 26 | +- **Full Inference Cycle**: Integrated PLN reasoning over membrane structures |
7 | 27 |
|
8 | | -### [Comprehensive Architecture Documentation](docs/README.md) |
9 | | -Detailed architectural insights with Mermaid diagrams covering: |
10 | | -- **[System Architecture](docs/ARCHITECTURE.md)**: High-level design patterns and data flows |
11 | | -- **[Component Deep Dive](docs/COMPONENTS.md)**: Internal architecture of parser, simulator, and generator |
12 | | -- **[Usage Examples](docs/EXAMPLES.md)**: Practical demonstrations and integration guides |
| 28 | +### 2. Enhanced Scheme Interface ✅ |
| 29 | +**File**: `include/scheme_interface.hpp` |
13 | 30 |
|
14 | | -## Dependencies |
| 31 | +- **Interactive REPL**: Full Scheme-style command evaluation |
| 32 | +- **Command Set**: 8+ commands for system exploration and manipulation |
| 33 | +- **Pattern Matching**: Query and analyze both RR and AtomSpace structures |
| 34 | +- **Real-time Updates**: Modify system state through Scheme commands |
15 | 35 |
|
16 | | -* Linux OS (tested on Ubuntu 16.04 and Ubuntu 18.04) |
17 | | -* GCC 4.9.0 or higher (with support for regex) |
18 | | -* Flex |
19 | | -* Bison |
20 | | -* libboost-filesystem-dev |
21 | | -* libboost-program-options-dev |
| 36 | +### 3. Persistent AtomSpace ✅ |
| 37 | +**File**: `include/persistent_atomspace.hpp` |
22 | 38 |
|
23 | | -sudo apt-get install build-essential flex bison libboost-filesystem-dev libboost-program-options-dev |
| 39 | +- **JSON Serialization**: Complete save/load for AtomSpace state |
| 40 | +- **RR Hypergraph Persistence**: Serialize all RR dynamics and structure |
| 41 | +- **Incremental Learning**: Merge new experiences with existing knowledge |
| 42 | +- **Memory Consolidation**: Remove low-confidence atoms to optimize storage |
24 | 43 |
|
25 | | -## Compiling |
| 44 | +### 4. Multi-Level Integration ✅ |
| 45 | +**Distributed across**: `relevance_realization.hpp`, `atomspace_integration.hpp`, test files |
26 | 46 |
|
27 | | -* make grammar |
28 | | -* make compiler |
29 | | -* make simulator |
30 | | -* sudo make install |
| 47 | +- **Hierarchical Structures**: Support for nested membrane architectures |
| 48 | +- **Cross-Level Emergence**: Detection of patterns spanning multiple hierarchy levels |
| 49 | +- **Temporal Reasoning**: Track relevance evolution over time |
| 50 | +- **Multi-Scale Dynamics**: Coordinated RR updates across system levels |
31 | 51 |
|
32 | | -## Architecture Overview |
| 52 | +## 🏛️ Architecture Overview |
33 | 53 |
|
34 | 54 | ```mermaid |
35 | 55 | graph TD |
36 | | - A[P-Lingua Source] --> B[Parser] |
37 | | - B --> C[P-System Model] |
38 | | - C --> D[Simulator] |
39 | | - C --> E[Code Generator] |
40 | | - D --> F[Results] |
41 | | - E --> G[Generated Code] |
| 56 | + subgraph "Traditional P-Lingua Core" |
| 57 | + A[P-Lingua Source] --> B[Parser] |
| 58 | + B --> C[P-System Model] |
| 59 | + C --> D[Simulator] |
| 60 | + C --> E[Code Generator] |
| 61 | + end |
42 | 62 | |
43 | | - style A fill:#e3f2fd |
44 | | - style C fill:#f3e5f5 |
45 | | - style F fill:#e8f5e8 |
46 | | - style G fill:#fff3e0 |
| 63 | + subgraph "RR Enhancement Layer" |
| 64 | + F[RR Hypergraph] --> G[Relevance Dynamics] |
| 65 | + G --> H[Agent-Arena-Relation Triad] |
| 66 | + H --> I[Trialectic Co-constitution] |
| 67 | + end |
| 68 | + |
| 69 | + subgraph "AtomSpace Integration" |
| 70 | + J[OpenCog AtomSpace] --> K[PLN Inference] |
| 71 | + K --> L[Pattern Recognition] |
| 72 | + L --> M[Symbolic Reasoning] |
| 73 | + end |
| 74 | + |
| 75 | + subgraph "Unified Architecture" |
| 76 | + N[RR-AtomSpace Bridge] |
| 77 | + O[Scheme Interface] |
| 78 | + P[Persistent Storage] |
| 79 | + Q[Multi-Level Coordination] |
| 80 | + end |
| 81 | + |
| 82 | + C --> F |
| 83 | + F --> J |
| 84 | + J --> N |
| 85 | + N --> O |
| 86 | + N --> P |
| 87 | + N --> Q |
| 88 | + |
| 89 | + style F fill:#e3f2fd |
| 90 | + style J fill:#f3e5f5 |
| 91 | + style N fill:#e8f5e8 |
| 92 | + style O fill:#fff3e0 |
47 | 93 | ``` |
48 | 94 |
|
49 | | -The framework consists of three main components: |
50 | | -- **Parser**: Transforms P-Lingua source into executable models |
51 | | -- **Simulator**: Executes membrane computing simulations |
52 | | -- **Generator**: Produces optimized C++ implementations |
| 95 | +## 🔄 RR Dynamics Process Flow |
| 96 | + |
| 97 | +```mermaid |
| 98 | +sequenceDiagram |
| 99 | + participant Agent as Agent Membrane |
| 100 | + participant Arena as Arena Membrane |
| 101 | + participant RR as RR Engine |
| 102 | + participant AtomSpace as AtomSpace |
| 103 | + participant PLN as PLN Engine |
| 104 | + |
| 105 | + Agent->>RR: Update salience |
| 106 | + Arena->>RR: Update affordances |
| 107 | + RR->>RR: Compute trialectic dynamics |
| 108 | + RR->>AtomSpace: Sync RR properties |
| 109 | + AtomSpace->>PLN: Generate implications |
| 110 | + PLN->>PLN: Perform inference cycle |
| 111 | + PLN->>AtomSpace: Update truth values |
| 112 | + AtomSpace->>RR: Feedback to RR dynamics |
| 113 | + RR->>Agent: Update relevance gradient |
| 114 | + RR->>Arena: Update coupling strength |
| 115 | +``` |
| 116 | + |
| 117 | +## 🚀 Quick Start |
| 118 | + |
| 119 | +### Dependencies |
| 120 | + |
| 121 | +```bash |
| 122 | +sudo apt-get install build-essential flex bison libboost-filesystem-dev libboost-program-options-dev libfl-dev |
| 123 | +``` |
| 124 | + |
| 125 | +### Build & Test |
| 126 | + |
| 127 | +```bash |
| 128 | +# Build traditional P-Lingua |
| 129 | +make grammar |
| 130 | +make compiler |
| 131 | +make simulator |
| 132 | + |
| 133 | +# Build RR-enhanced test programs |
| 134 | +g++ -I./include -std=c++11 -o test_rr_enhanced test_rr_enhanced.cpp |
| 135 | +g++ -I./include -std=c++11 -o test_next_directions test_next_directions.cpp |
| 136 | +g++ -I./include -std=c++11 -o demo_repl demo_repl.cpp |
| 137 | + |
| 138 | +# Run comprehensive demo |
| 139 | +./test_next_directions |
| 140 | +``` |
| 141 | + |
| 142 | +### Interactive RR/AtomSpace REPL |
| 143 | + |
| 144 | +```bash |
| 145 | +./demo_repl |
| 146 | +``` |
| 147 | + |
| 148 | +Available Scheme commands: |
| 149 | +```scheme |
| 150 | +(list-rr-nodes) ; List all RR nodes with properties |
| 151 | +(list-atoms) ; Show AtomSpace contents |
| 152 | +(get-system-relevance) ; Compute overall system relevance |
| 153 | +(run-pln-inference) ; Execute PLN reasoning cycle |
| 154 | +(find-patterns) ; Detect emergent patterns |
| 155 | +(get-salience node-ID) ; Query node salience |
| 156 | +(update-salience node-ID VALUE) ; Modify node properties |
| 157 | +(find-atom "NAME") ; Search atoms by name |
| 158 | +``` |
| 159 | + |
| 160 | +## 📊 Performance Characteristics |
| 161 | + |
| 162 | +### RR Dynamics Complexity |
| 163 | +- **Trialectic Updates**: O(n) per node per timestep |
| 164 | +- **Coupling Computation**: O(n²) for agent-arena pairs |
| 165 | +- **Emergence Detection**: O(n·m) for n agents, m arenas |
| 166 | + |
| 167 | +### AtomSpace Integration |
| 168 | +- **RR→Atom Conversion**: O(n) for n RR nodes |
| 169 | +- **PLN Inference**: O(r·a) for r rules, a atoms |
| 170 | +- **Pattern Matching**: O(p·log(a)) for p patterns |
| 171 | + |
| 172 | +## 🔬 Research Applications |
| 173 | + |
| 174 | +### Cognitive Architecture Integration |
| 175 | +- **Symbolic-Subsymbolic Bridge**: RR provides the dynamic foundation for symbolic reasoning |
| 176 | +- **Emergent Pattern Recognition**: Multi-level emergence detection across membrane hierarchies |
| 177 | +- **Adaptive Learning**: Persistent storage enables incremental knowledge accumulation |
| 178 | + |
| 179 | +### Membrane Computing Enhancements |
| 180 | +- **Dynamic Rule Selection**: RR salience influences rule application priorities |
| 181 | +- **Adaptive Membrane Behavior**: Agent-arena coupling drives membrane evolution |
| 182 | +- **Hierarchical Organization**: Multi-level integration supports complex system architectures |
| 183 | + |
| 184 | +## 📚 Documentation |
| 185 | + |
| 186 | +### [Comprehensive RR-RNN Documentation](docs/README.md) |
| 187 | +Detailed technical documentation with diagrams covering: |
| 188 | +- **[RR-RNN Architecture](docs/ARCHITECTURE.md)**: Relevance Realization integration patterns |
| 189 | +- **[Component Deep Dive](docs/COMPONENTS.md)**: PLN, Scheme, and persistence systems |
| 190 | +- **[Usage Examples](docs/EXAMPLES.md)**: RR dynamics and AtomSpace integration demos |
| 191 | + |
| 192 | +### Core Implementation Files |
| 193 | + |
| 194 | +``` |
| 195 | +include/ |
| 196 | +├── relevance_realization.hpp # RR framework with trialectic dynamics |
| 197 | +├── atomspace_integration.hpp # RR-AtomSpace bridge |
| 198 | +├── pln_integration.hpp # PLN inference engine |
| 199 | +├── scheme_interface.hpp # Interactive Scheme REPL |
| 200 | +└── persistent_atomspace.hpp # Serialization & persistence |
| 201 | +
|
| 202 | +test_*.cpp # Comprehensive test suite |
| 203 | +demo_*.cpp # Interactive demonstrations |
| 204 | +``` |
| 205 | + |
| 206 | +## 🎯 Future Extensions |
| 207 | + |
| 208 | +The implemented framework provides the foundation for: |
| 209 | + |
| 210 | +1. **Advanced Cognitive Architectures**: Full symbolic-subsymbolic integration |
| 211 | +2. **Distributed RR Systems**: Multi-agent relevance realization networks |
| 212 | +3. **Learning Systems**: Persistent knowledge accumulation and refinement |
| 213 | +4. **Interactive Exploration**: Real-time system analysis and manipulation |
| 214 | + |
| 215 | +## 🤝 Contributing |
| 216 | + |
| 217 | +This RR-enhanced membrane computing framework represents a significant advancement toward unified cognitive architectures. Contributions are welcome in: |
| 218 | + |
| 219 | +- Enhanced RR dynamics algorithms |
| 220 | +- Additional PLN inference rules |
| 221 | +- Extended Scheme command sets |
| 222 | +- Multi-level emergence patterns |
| 223 | +- Performance optimizations |
| 224 | + |
| 225 | +## 📄 License |
| 226 | + |
| 227 | +Licensed under the same terms as the original P-Lingua framework. |
| 228 | + |
| 229 | +--- |
| 230 | + |
| 231 | +*RR-PLingua successfully bridges dynamic self-organization (RR) and symbolic reasoning (AtomSpace/PLN), representing a significant advancement toward unified cognitive architectures.* |
53 | 232 |
|
0 commit comments