Global key-value metadata storage for Scryer Prolog
6 months ago
- #Global State Management
- #Key-Value Storage
- #Prolog
- Provides a global environment/context management system for Scryer Prolog with key-value metadata storage.
- Offers both global persistent storage (changes persist across backtracking) and backtrackable local storage (changes roll back on backtracking).
- Includes type-safe reified predicates for conditional logic without cuts, using if_/3.
- Supports once-only initialization to prevent accidental double initialization.
- Efficient key existence checking with O(log n) operations due to AVL tree implementation.
- Features include setting global/local key-value pairs, retrieving values, checking flags, and removing keys.
- Example use cases: configuration management, feature flags, counters, and conditional execution.
- Initializes using term_expansion/2, creating an empty association tree stored in the blackboard under global_context.
- Uses reified predicates from library(reif) for pure, declarative programming.
- Licensed under BSD-2-Clause, compatible with Scryer Prolog standard libraries.