Command line normalizer of ๐-calculus expressions (as produced by the EO compiler).
Consult the project documentation for more details.
Command Line Normalizer of ๐-calculus Expressions
Home Page: https://www.objectionary.com/normalizer/
License: MIT License
Command line normalizer of ๐-calculus expressions (as produced by the EO compiler).
Consult the project documentation for more details.
Par.y
:
Abs.hs
Print.hs
Bytes
This is used in Yegor's rule 1.
BNFC 2.9.6
doesn't exist on Hackage. The latest version is 2.9.5
.
It also doesn't exist in our current resolver.
Line 1 in c1b2a13
https://www.stackage.org/nightly-2023-12-14
However, I see comments that some files were generated by bnfc 2.9.6.
--chain
Allow to set how many different answers to show.
These are used in Yegor's rules 1, 2, 3, 8, 11, for example.
The rules are being implemented in eo-phi-normalizer/test/eo/phi/rules/yegor.yaml
:
Let's configure and make sure we deploy the package on every new tag (or by request)
"editor.formatOnSave": true
in .vscode/settings.json
Related to #51
Superseded by #93
./integration-tests
This is used in Yegor's rules 1 and 10, for example.
Support integration into a Maven plugin.
The plugin will run a command like this.
normalizer evaluate --rules rules.yaml --input-file phi/input.phi --output-file phi/output.phi
So, we already support this integration.
diff
exit codenormalize-phi
outputBased on some prior conversations, there appears to be a request for attribute name manipulation:
This is used in Yegor's rules 1 and 4, for example.
VTX
- "vertex" (see grammar)VTX
to VERTEX
(objectionary/eo#2768)n
- "normal form" (see paper)support conflict resolution rules
support importing these rules
conflicts:
- not_allowed
- conflict_resolution_1.yaml
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.github/workflows/ghc.yml
actions/checkout v4
haskell-actions/run-fourmolu v10
haskell-actions/hlint-setup v2
haskell-actions/hlint-run v2
actions/checkout v4
actions/cache v4
freckle/stack-action v5
actions/cache v4
actions/checkout v4
actions/cache v4
freckle/stack-action v5
actions/cache v4
actions/setup-node v4
actions/setup-java v4
actions/cache v4
actions/cache v4
baptiste0928/cargo-install v3.1.1
actions/upload-artifact v4
actions/checkout v4
freckle/stack-action v5
actions/download-artifact v4
jontze/action-mdbook v3
JamesIves/github-pages-deploy-action v4
.github/workflows/release.yml
actions/checkout v4
freckle/stack-action v4
haskell-actions/hackage-publish v1
package.json
eolang ^0.21.0
prettier ^3.2.5
requirements.txt
pre-commit ==3.7.1
For now, we run the pipeline on a single file.
Lines 9 to 13 in b43f6e3
Several EO files (e.g. four) should not be treated as different "universes", but rather as a single program (glued out of these files)
Alternatively, run normalizer on multiple test files
Describe a framework for normalization of terms given an arbitrary term rewriting system.
Requires #60.
I found inconsistency between canonical phi-calculus grammar (on the pic) and grammar in https://github.com/objectionary/normalizer/blob/master/eo-phi-normalizer/grammar/EO/Phi/Syntax.cf.
Rules program
, formation
and application
must have different braces
This is required to allow user-defined rules to specify minimal
isNu :: Binding -> Bool
isNu (AlphaBinding VTX _) = True
isNu (EmptyBinding VTX) = True
isNu _ = False
instance Plated Object
instance Plated Binding
count :: (a -> Bool) -> [a] -> Int
count = (length .) . filter
countNus :: Object -> Int
countNus = getSum . go
where
go t =
Sum ((\case Formation bindings -> count isNu bindings; _ -> 0) t)
<> foldMapOf plate go t
pad :: [Char] -> [Char]
pad s = (if even (length s) then "" else "0") ++ s
insertDashes :: [Char] -> [Char]
insertDashes s
| length s <= 2 = s ++ "-"
| otherwise =
let go = \case
[] -> []
[x] -> [x]
[x, y] -> [x, y, '-']
(x : y : xs) -> x : y : '-' : go xs
in go s
insertNus :: Object -> Object
insertNus o =
evalState
( rewriteM
( \case
Formation bindings | not (any isNu bindings) -> do
nus <- get
id += 1
pure $ Just (Formation $ AlphaBinding VTX (Formation [DeltaBinding (Bytes $ insertDashes $ pad $ showHex nus "")]) : bindings)
_ -> pure Nothing
)
o
)
(countNus o)
N.B.: insertNus
hangs indefinitely (see comment).
finalBindings <-
if not $ any isNu normalizedBindings
then do
nus <- gets totalNuCount
- modify (\c -> c{totalNuCount = totalNuCount c + 1})
+ #totalNuCount += 1
./pipeline
directory (@yegor256)
stack
The pipeline would be the following:
First, start with the /tmp/test/app.eo
file:
[args] > app
QQ.io.stdout > @
"Hello, world!\n"
Then, compile it via eoc and execute:
$ npm -g install eolang
$ cd /tmp/test
$ eoc dataize app
EO objects registered in .eoc/eo-foreign.json
Assembling into .eoc
EO program assembled in .eoc
EO program verified in .eoc
Java sources generated in .eoc/generated-sources
Java .class files compiled into .eoc
Executable JAR created at .eoc/eoc.jar
Hello, world!
---
[1]
Then, generate the .phi
file:
$ eoc phi
EO objects registered in .eoc/eo-foreign.json
Assembling into .eoc
EO program assembled in .eoc
XMIR files converted into PHI files at .eoc
It will be generated in .eoc/phi/app.phi
.
Then, normalize it and replace the .eoc/phi/app.phi
file with new content (overwrite it!).
Then, generate XMIR from the app.phi
file:
$ eoc unhpi
PHI files converted into XMIR files at .eoc/unphi
There should be new .eoc/unphi/app.xmir
file generated.
Then, replace .eoc/2-optimize/app.xmir
with this new file:
$ cp .eoc/unphi/app.xmir .eoc/2-optimize/app.xmir
Then, create a new EO file:
$ eoc print
XMIR files converted into EO files at .eoc/print
The .eoc/print/app.eo
should be generated.
Copy it to app.eo
(overwrite the existing one!):
$ cp .eoc/print/app.eo app.eo
Then, execute:
$ eoc clean
$ eoc dataize app
Hello, world!
Expect the Hello, world!
output, as in the previous execution. If they match, your test passes.
rules:
- name: Rule 6
description: "Accessing an ฮฑ-binding"
pattern: |
โฆ ?a โฆ ?n, ?B โง.?a
result: |
?n(ฯ โฆ ?B)
when:
- nf: [ "?n" ]
Depends on #11.
Features:
Example:
TODO
Example:
TODO
Example:
TODO
Related to #69 .
There'll be separate meetings dedicated to (1) phi-calculus, (2) normalizer formalization, (3) normalizer implementation
Bytes
definition (see EO grammar)A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.