Skip to content

Commit 89c162f

Browse files
Copilothzhangxyz
andcommitted
Add comprehensive BNF README and Support Packages section to main README
Co-authored-by: hzhangxyz <[email protected]>
1 parent af84b14 commit 89c162f

File tree

2 files changed

+416
-3
lines changed

2 files changed

+416
-3
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,45 @@ Example programs are provided in the `examples/` directory:
344344

345345
Each example demonstrates logical inference using propositional logic axioms.
346346

347+
## Support Packages
348+
349+
The DS project includes additional support packages that extend functionality:
350+
351+
### BNF Conversion Library
352+
353+
Located in the `/bnf` directory, this package provides bidirectional conversion between DS syntax formats:
354+
355+
- **apyds-bnf** (Python): [PyPI](https://pypi.org/project/apyds-bnf/)
356+
- **atsds-bnf** (JavaScript): [npm](https://www.npmjs.com/package/atsds-bnf)
357+
358+
The BNF library converts between:
359+
- **Ds format**: S-expression (lisp-like) syntax used internally by DS
360+
- **Dsp format**: Traditional, human-readable syntax with infix operators
361+
362+
This makes it easier to write logical rules in a natural mathematical notation and convert them to/from the DS internal format.
363+
364+
**Installation:**
365+
```bash
366+
# Python
367+
pip install apyds-bnf
368+
369+
# JavaScript
370+
npm install atsds-bnf
371+
```
372+
373+
**Quick example:**
374+
```python
375+
from apyds_bnf import parse, unparse
376+
377+
# Convert readable syntax to DS format
378+
parse("a, b -> c") # Returns: "a\nb\n----\nc"
379+
380+
# Convert DS format to readable syntax
381+
unparse("a\nb\n----\nc") # Returns: "a, b -> c"
382+
```
383+
384+
For more details, see the [BNF package README](/bnf/README.md).
385+
347386
## Development
348387

349388
### Code Formatting

0 commit comments

Comments
 (0)