Giter Site home page Giter Site logo

eog's Introduction

EO principles respected here DevOps By Rultor.com We recommend IntelliJ IDEA

This is a command line tool that takes a directory with XMIR files (XML representation of EO programs) and produces a directory with .eog files, each of which is a textual representaiton of a Control Flow Graph (CFG) in EOG language (we invented it). Run it like this (download the latest version of the eog.jar JAR from here):

$ java -jar eog.jar --help

For example, this is an input EO program:

[n] > fibo
  if. > @
    n.lt 2
    1
    plus.
      fibo (n.minus 1)
      fibo (n.minus 2)

This is how a generated EOG program may look (this is a very early draft!):

@fibo(n):
  x1 := @if(n)
  Return x1

@if(n):
  x1 := Dataized @lt(n)
  Jump #A If x1
  x2 := @plus(n)
  Jump #B
  #A
  x2 := Int 1
  #B
  Return x2

@lt(n):
  x1 := Dataized n
  x2 := Int 2
  x3 := Math.Lt x1 x2
  Return x3

@plus(n):
  x1 := Dataized @fibo1(n)
  x2 := Dataized @fibo2(n)
  x3 := Math.Plus x1 x2
  Return x3

@fibo1(n):
  x1 := @minus1(n)
  x2 := @fibo(n=x1)
  Return x2

@minus1(n):
  x1 := Dataized n
  x2 := Int 1
  x3 := Math.Minus x1 x2
  Return x3

@fibo2(n):
  x1 := @minus1(n)
  x2 := @fibo(n=x1)
  Return x2

@minus2(n):
  x1 := Dataized n
  x2 := Int 2
  x3 := Math.Minus x1 x2
  Return x3

This is how it can be sequentialized:

@fibo(n):
  @if(n):
    @lt(n):
      x1.1.1 := Dataized n
      x1.1.2 := Int 2
      x1.1.3 := Math.Lt x1.1.1 x1.1.2
      x1.1 := Dataized x1.1.3
    Jump #A If x1.1
          x1.2.1.1.1 := Dataized n
          x1.2.1.1.2 := Int 1
          x1.2.1.1.3 := Math.Minus x1.2.1.1.1 x1.2.1.1.2
          x1.2.1.1 := x1.2.1.1.3
        x1.2.1.2 := @fibo(n=x1.2.1.1)
        x1.2.1 := Dataized x1.2.1.2
          x1.2.2.1.1 := Dataized n
          x1.2.2.1.2 := Int 2
          x1.2.2.1.3 := Math.Minus x1.2.2.1.1 x1.2.2.1.2
          x1.2.2.1 := x1.2.2.1.3
        x1.2.2.2 := @fibo(n=x1.2.2.1)
        x1.2.2 := Dataized x1.2.2.2
      x1.2.3 := Math.Plus x1.2.1 x1.2.2
      x1.2 := x1.2.3
    Jump #B
    #A
    x1.2 := Int 1
    #B
    x1 := x1.2
  Return x1

The EOG-script of the if atom may look like this:

@if(ρ, α0, α1):
  x1 := Dataized ρ
  Jump #A If x1
  x2 := α1
  Jump #B
  #A
  x2 := α0
  #B
  Return x2

There is also a Java API, which helps you read a file with EOG program and then access it in a graph-traversing mode.

eog's People

Contributors

yegor256 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Forkers

graur

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.