Skip to content

Commit

Permalink
feat(#50): added xmir representation
Browse files Browse the repository at this point in the history
  • Loading branch information
maxonfjvipon committed Dec 13, 2023
1 parent 8ed37a1 commit 3821c93
Showing 1 changed file with 180 additions and 0 deletions.
180 changes: 180 additions & 0 deletions _posts/2023/12/2023-12-08-phi-and-unphi-mojos.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,186 @@ Here's an example of how the EO Fibonacci program looks in φ-calculus (you can
n.minus 2
```

Its [XMIR](https://news.eolang.org/2022-11-25-xmir-guide.html) representation (default location is
`target/eo/2-optimize`):
```xml
<?xml version="1.0" encoding="UTF-8"?>
<program dob="2023-03-19T00:00:00"
ms="12"
name="foo.x.main"
revision="1234567"
source="/var/folders/xj/f4s949893tq37zzw0pdmd68h0000gn/T/junit2727451398454004374/foo/x/main.eo"
time="2023-12-13T10:04:53.022835Z"
version="0.0-SNAPSHOT">
<!--This is XMIR - a dialect of XML, which is used to present a parsed EO program. For more information please visit https://news.eolang.org/2022-11-25-xmir-guide.html-->
<listing>+package eo.example

[n] &gt; fibonacci
if. &gt; @
lt.
n
2
n
plus.
fibonacci
n.minus 1
fibonacci
n.minus 2
</listing>
<errors>
<error check="missing-home"
line=""
severity="warning"
sheet="mandatory-home-meta"
step="0">Missing home</error>
<error check="missing-version-meta"
line=""
severity="warning"
sheet="mandatory-version-meta"
step="0">Missing version meta</error>
</errors>
<sheets>
<sheet>not-empty-atoms</sheet>
<sheet>duplicate-names</sheet>
<sheet>many-free-attributes</sheet>
<sheet>broken-aliases</sheet>
<sheet>duplicate-aliases</sheet>
<sheet>global-nonames</sheet>
<sheet>same-line-names</sheet>
<sheet>self-naming</sheet>
<sheet>cti-adds-errors</sheet>
<sheet>add-refs</sheet>
<sheet>wrap-method-calls</sheet>
<sheet>expand-qqs</sheet>
<sheet>add-probes</sheet>
<sheet>vars-float-up</sheet>
<sheet>add-refs</sheet>
<sheet>sparse-decoration</sheet>
<sheet>unsorted-metas</sheet>
<sheet>incorrect-architect</sheet>
<sheet>incorrect-home</sheet>
<sheet>incorrect-version</sheet>
<sheet>expand-aliases</sheet>
<sheet>resolve-aliases</sheet>
<sheet>add-refs</sheet>
<sheet>add-default-package</sheet>
<sheet>broken-refs</sheet>
<sheet>unknown-names</sheet>
<sheet>noname-attributes</sheet>
<sheet>duplicate-names</sheet>
<sheet>duplicate-metas</sheet>
<sheet>mandatory-package-meta</sheet>
<sheet>mandatory-home-meta</sheet>
<sheet>mandatory-version-meta</sheet>
<sheet>correct-package-meta</sheet>
<sheet>prohibited-package</sheet>
<sheet>external-weak-typed-atoms</sheet>
<sheet>unused-aliases</sheet>
<sheet>unit-test-without-phi</sheet>
<sheet>explicit-data</sheet>
<sheet>set-locators</sheet>
</sheets>
<license/>
<metas>
<meta line="1">
<head>package</head>
<tail>eo.example</tail>
<part>eo.example</part>
</meta>
<meta line="4">
<head>probe</head>
<tail>n.lt.if</tail>
<part>n.lt.if</part>
</meta>
</metas>
<objects>
<o abstract=""
line="3"
loc="Φ.eo.example.fibonacci"
name="fibonacci"
pos="0">
<o line="3" loc="Φ.eo.example.fibonacci.n" name="n" pos="1"/>
<o base=".if"
line="4"
loc="Φ.eo.example.fibonacci.φ"
name="@"
pos="2">
<o base=".lt" line="5" loc="Φ.eo.example.fibonacci.φ.ρ" pos="4">
<o base="n"
line="6"
loc="Φ.eo.example.fibonacci.φ.ρ.ρ"
pos="6"
ref="3"/>
<o base="org.eolang.int"
line="7"
loc="Φ.eo.example.fibonacci.φ.ρ.α0"
pos="6">
<o base="org.eolang.bytes"
data="bytes"
loc="Φ.eo.example.fibonacci.φ.ρ.α0.α0">00 00 00 00 00 00 00 02</o>
</o>
</o>
<o base="n"
line="8"
loc="Φ.eo.example.fibonacci.φ.α0"
pos="4"
ref="3"/>
<o base=".plus" line="9" loc="Φ.eo.example.fibonacci.φ.α1" pos="4">
<o base="fibonacci"
line="10"
loc="Φ.eo.example.fibonacci.φ.α1.ρ"
pos="6"
ref="3">
<o base=".minus"
line="11"
loc="Φ.eo.example.fibonacci.φ.α1.ρ.α0"
pos="9">
<o base="n"
line="11"
loc="Φ.eo.example.fibonacci.φ.α1.ρ.α0.ρ"
pos="8"
ref="3"/>
<o base="org.eolang.int"
line="11"
loc="Φ.eo.example.fibonacci.φ.α1.ρ.α0.α0"
pos="16">
<o base="org.eolang.bytes"
data="bytes"
loc="Φ.eo.example.fibonacci.φ.α1.ρ.α0.α0.α0">00 00 00 00 00 00 00 01</o>
</o>
</o>
</o>
<o base="fibonacci"
line="12"
loc="Φ.eo.example.fibonacci.φ.α1.α0"
pos="6"
ref="3">
<o base=".minus"
line="13"
loc="Φ.eo.example.fibonacci.φ.α1.α0.α0"
pos="9">
<o base="n"
line="13"
loc="Φ.eo.example.fibonacci.φ.α1.α0.α0.ρ"
pos="8"
ref="3"/>
<o base="org.eolang.int"
line="13"
loc="Φ.eo.example.fibonacci.φ.α1.α0.α0.α0"
pos="16">
<o base="org.eolang.bytes"
data="bytes"
loc="Φ.eo.example.fibonacci.φ.α1.α0.α0.α0.α0">00 00 00 00 00 00 00 02</o>
</o>
</o>
</o>
</o>
</o>
</o>
</objects>
</program>
```

And its φ-calculus representation:

```phi
Expand Down

0 comments on commit 3821c93

Please sign in to comment.