1.0.11 • Published 5 years ago

live-backend-nfn5 v1.0.11

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Live programming

Trying to make something like the video below in atom

https://www.youtube.com/watch?v=tKmx2myzFEU

Install instructions

first install atom, then:

git clone https://github.com/Jack-Huang1/liveprogramming
cd liveprogramming
apm link

You might also need to update the package dependencies

press ctrl+shift+p
type 'udup' to execute "Update Package Dependencies: Update"
press enter

You will also need a sygus solver installed. CVC4 is the easiest installation process. Download the binary, rename is 'cvc4', and add it to your path. This is an easy way to do that

wget http://cvc4.cs.stanford.edu/downloads/builds/x86_64-linux-opt/cvc4-1.6-x86_64-linux-opt
mv cvc4-1.6-x86_64-linux-opt cvc4
chmod u+x cvc4
mv cvc4 /usr/bin/

For Windows users it is important to download an appropriate (64 bit, 32 bit) binary for your machine. It is also important that cvc4 is put under an appropriate path, which can be found using set. Here is an example on how to do this using PowerShell commands

wget http://cvc4.cs.stanford.edu/downloads/builds/win64-opt/cvc4-1.6-win64-opt.exe -outfile "cvc4"
cmd /C set
Move-Item -Path cvc4 -Destination C:\????\??

Use ctrl+shfit+F5 to reload package in Atom (sometimes need to press twice)

Usage instructions

Open the .js file you want to use PBE repair. Turn on the package with ctrl+shift+e (or Packages > liveprogramming1 > Toggle).

Examples should be given in the form below in the .examples file. One example per line.

f("a b") = "a*b"
f("b a ") = "b*a*"
main("d","y") = "dy y"

This file is saved in the "./live" subdirectory, of the code's directory. For example tests/addition.js has examples in tests/.live/addition.js.examples. Atom will automatically open the proper file for you.

Notes

Only string are supported at the moment.

It is really important to start the package with the correct file open. If you start the package with the wrong file, or you want to use the package with a different file, you need to refresh the atom editor (ctrl+shift+f5), then start the package again. This will be fixed when one of us learns to use the atom API.

Testing

Tests are organized in the test subdirectory, and use the mocha testing framework. https://mochajs.org Due to difficulties configuring babel and mocha, use of the atom-mocha plugin is recommended: https://atom.io/packages/atom-mocha

TODOs

progress:

  • can read and evaluate basic functions from current file window (i.e., addition.js)
  • open workspace panel as an editable window for user inputs
  • reevaluates code on code (onDidChange)
  • multiple input/output examples for single function
  • reevaluate code on example change (cannot be done until we have TextEditor)
  • provide examples for multiple functions
  • allow for arbitrary number of examples
  • allow for deleting examples
  • save input examples in a temp file (associated with code file) and load when we pull up that code file
  • only rerun/update output examples on syntactically correct code (for .js, this means catching syntax errors at runtime)
  • basic white space formatting for example file
  • basic code repair
  • add support for .replace() and string indexing
  • new language for giving examples - only using json on the backend now

TODOS (sorted by difficulty):

  • ability to turn off package
  • only generate .sl files for target pbe code
  • better example interface?
  • add spinner icon when trying to synthesize something that takes a while
  • allow synthesis to use component user-defined functions
  • support types (only have strings at the moment). maybe this requires user-provided annotations? or can we use typeof on the examples provided?
  • use existing function definition as basis for grammar of sygus initial repair attempt. if no solution is found, iteratively expand grammar.
  • if we cannot find a solution for the function with new examples, or multiple examples have changed, we need a strategy to try multiple functions. One idea: First pick one function to try repairing. Then supply define-fxn in SYGUS format for the other fixed fxns so they can be used in synthesis of target function. Then try this for all functions. then pick best repair. Note, this approach still means only one function definition can be updated in a single synthesis step.

Long term TODOS:

  • support Haskell
  • repair to multiple functions at the same time. This entirely out-of-scope for sygus solvers.
1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago