حسن حربي
unread,Apr 4, 2026, 2:38:51 PMApr 4Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to The Ring Programming Language
Hello All,
I am pleased to announce the release of **منطق.ض** – a pure object-oriented inference engine written in Ring, now published under the name **منطق.ض** and available at:
[https://abgd2000.github.io/لغة.ض/منطق.ض/](https://abgd2000.github.io/لغة.ض/منطق.ض/)
This engine is designed from the ground up to follow a **no‑dictionary, no‑map** philosophy – everything is implemented using only classes, objects, and lists. It provides a flexible rule‑based system that can be used for educational purposes, game logic, or lightweight expert systems.
## Key Features
1. **Pure OOP Architecture**
- All components (`حقيقة`, `بيئة`, `قاعدة`, `منطق`) are classes.
- No built‑in dictionaries or maps – variable bindings are stored in parallel lists.
2. **Full Arabic Syntax Support**
- The engine has been completely translated into Arabic.
- Keywords like `fact` → `حقيقة`, `notEqual` → `ليس`, `or` → `أو`, `and` → `و`.
- Method names: `addFact` → `ضف_حقيقة`, `query` → `استعلام`, etc.
3. **Variable Prefix `#`**
- Variables are written with a leading `#` (e.g., `#X`, `#س`, `#ص`), making them easy to distinguish from constants.
- The engine also supports uppercase variables (e.g., `X`) for backward compatibility.
4. **Logical Operators**
- `notEqual` (`ليس`)
- `equal` (`يساوي`) – optional
- `or` (`أو`) – evaluates all branches and merges results
- `and` (`و`) – sequential conjunction of conditions
5. **Wildcard Support**
- The underscore `_` matches any value without binding it to a variable – perfect for “don’t care” positions in facts.
6. **Duplicate‑Free Results**
- The engine automatically removes duplicate environments (bindings) so you get only unique solutions.
7. **Built‑in Example: “Stop Bus” Word Game**
- The distribution includes a complete vocabulary game (أتوبيس كمبلية) covering 28 Arabic letters and 10 categories (countries, boys, girls, animals, plants, inanimate objects, birds, professions, colors, foods).
- Demonstrates how to use facts, rules, and queries in a real‑world scenario.
8. **Self‑Contained**
- All code is in a single Ring file.
- No external dependencies – works with any standard Ring distribution.
## How to Use
1. Download `منطق.ض` from the link above.
2. Load the file in your Ring environment (it includes both the engine and the game example).
3. Define your own facts and rules using the Arabic keywords and `#`‑prefixed variables.
4. Call `المحرك.استعلام(...)` to get unique results.
## Example Rule (from the game)
```ring
المحرك.ضف_قاعدة("كلمات_الحرف_والفئة", ["#ح", "#ف", "#ك"], [
["حقيقة", "كلمة_لعبة", "#ح", "#ف", "#ك"]
], "شوف 'كلمة: ' + #ك")
```
This rule retrieves all words that match a given letter and category.
## License
The engine is open source and free to use, modify, and distribute.
I hope you find it useful for teaching logic programming, building Arabic‑language educational tools, or simply exploring pure OOP inference in Ring. Feedback and contributions are welcome!
Best regards,
Hassan Harby