https://github.com/objectionary/aoi
Abstract Object inference for EO Programs
https://github.com/objectionary/aoi
eolang
Last synced: 8 months ago
JSON representation
Abstract Object inference for EO Programs
- Host: GitHub
- URL: https://github.com/objectionary/aoi
- Owner: objectionary
- License: mit
- Created: 2022-10-16T13:52:09.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T08:42:21.000Z (about 1 year ago)
- Last Synced: 2024-10-29T09:56:15.157Z (about 1 year ago)
- Topics: eolang
- Language: Kotlin
- Homepage:
- Size: 215 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README

[](https://www.elegantobjects.org)
[](http://www.rultor.com/p/objectionary/aoi)
[](https://www.jetbrains.com/idea/)
[](https://github.com/objectionary/aoi/actions/workflows/build.yml)
[](https://hitsofcode.com/view/github/objectionary/aoi)
[](https://github.com/objectionary/aoi/blob/master/LICENSE.txt)
AOI is a project aiming at performing Abstract Object Inference for [EO](https://www.eolang.org) Programs.
### Launch
#### Using Maven
Just add this to your `pom.xml`
```
org.eolang
aoi
0.0.2
```
And then you will be able to use the tool like this:
```
import org.objectionary.aoi.launch.launch
...
launch(${path_to_your_directory})
```
`launch` method takes path to your directory as an input. After `launch` completes - a new directory
with a name `$(path_to_your_directory}_aoi` will be created near your source directory, containing modified xmirs.
### Pipeline
The tool receives a path to the directory with .xmir files as an input.
AOI generates a new `${PATH}_aoi` directory, located near your input directory, with modified xmir files.
Let's see how it modifies .xmir files on an example.
Consider the following EO program:
```
[] > cat
[] > talk
QQ.io.stdout > @
"Meow!"
[] > dog
[] > talk
QQ.io.stdout > @
"Woof!"
[] > eat
QQ.io.stdout > @
"I am eating"
[x] > pet1
x.talk > @
[x] > pet2
seq > @
x.talk
x.eat
```
The following block in the corresponding .xmir file will be generated from this program:
```
```
As we can see, object `x` from `pet1` is only used with its `talk` attribute, therefore it can either be
an instance of `cat` or `dog`. Whereas `x` located `pet2` is used with both `talk` and `eat`, which
lets us determine that `x` can only be an instance of `dog`.
Each free attribute and each object in the program have unique fully qualified names, so these names
are used in the aoi section to unequivocally define each object.
### How to Contribute
Fork repository, make changes, send us a pull request. We will review your changes and apply them to the master branch shortly, provided they don't violate our quality standards. To avoid frustration, before sending us your pull request please run full Maven build:
```
$ mvn clean install -Pqulice
```
You will need Maven 3.3+ and Java 8+.