https://github.com/objectionary/eo-phi-normalizer
Command Line Normalizer and Rewriter of 𝜑-calculus Expressions (part of EOLANG family)
https://github.com/objectionary/eo-phi-normalizer
eolang normalization object-oriented-programming oop
Last synced: about 2 months ago
JSON representation
Command Line Normalizer and Rewriter of 𝜑-calculus Expressions (part of EOLANG family)
- Host: GitHub
- URL: https://github.com/objectionary/eo-phi-normalizer
- Owner: objectionary
- License: mit
- Created: 2023-12-14T04:48:59.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-17T18:03:31.000Z (8 months ago)
- Last Synced: 2024-10-18T12:47:18.901Z (8 months ago)
- Topics: eolang, normalization, object-oriented-programming, oop
- Language: Haskell
- Homepage: https://www.objectionary.com/eo-phi-normalizer/
- Size: 57.9 MB
- Stars: 7
- Watchers: 4
- Forks: 2
- Open Issues: 80
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Normalizer for 𝜑-calculus
[](http://hackage.haskell.org/package/eo-phi-normalizer)
[![Haddock]()](https://www.objectionary.com/eo-phi-normalizer/haddock/)
[](LICENSE.txt)
[](https://hitsofcode.com/github/objectionary/eo-phi-normalizer/view?branch=master&label=Hits-of-Code)
This command line tool helps you deal with 𝜑-calculus expressions, usually
produced by the [EO compiler][eo].First, install it (you should install [Stack][stack] first):
```bash
stack update
stack install eo-phi-normalizer
```Then, normalize a simple 𝜑-expression:
```bash
$ cat > foo.phi
{⟦ m ↦ ⟦ x ↦ ⟦ ρ ↦ ∅ ⟧.ρ.k, k ↦ ⟦ Δ ⤍ 42- ⟧ ⟧.x ⟧}
$ eo-phi-normalizer rewrite --chain --tex foo.phi
```The output will contain a ready-to-use LaTeX document, where all
rewritting steps are explained.More detailed documentation is [here][site].
## How to use custom rules?
By default, the rules of normalization of 𝜑-calculus are used. They are
defined in the [rules.yaml][rules] file. You can use your own rules, with the
help of our custom YAML format, for example in `forty-three.yml`:```yaml
title: "forty-three"
rules:
- name: forty-three
description: 'change 33 double to 42 double'
pattern: |
Φ.org.eolang.bytes ( α0 ↦ ⟦ Δ ⤍ 40-40-80-00-00-00-00-00 ⟧ )
result: |
Φ.org.eolang.bytes ( α0 ↦ ⟦ Δ ⤍ 40-45-00-00-00-00-00-00 ⟧ )
tests: [ ]
```Then, use this file:
```bash
eo-phi-normalizer rewrite --rules=forty-three.yml foo.phi
```[site]: https://www.objectionary.com/eo-phi-normalizer/
[stack]: https://docs.haskellstack.org/en/stable/install_and_upgrade/
[eo]: https://github.com/objectionary/eo
[rules]: https://github.com/objectionary/eo-phi-normalizer/blob/master/eo-phi-normalizer/test/eo/phi/rules/new.yaml