jfeser / l2 Goto Github PK
View Code? Open in Web Editor NEWλ² is a tool for synthesizing functional programs from input-output examples.
License: Apache License 2.0
λ² is a tool for synthesizing functional programs from input-output examples.
License: Apache License 2.0
I am trying to build the L2 project and facing type errors during compilation. I have set the compiler version to 4.06.0, as in issue #3, and the dependencies seem to install fine, but am getting the following error:
$ jbuilder build @install
ocamlc src/.l2.eobjs/util.{cmi,cmo,cmt} (exit 2)
(cd _build/default && /home/rolf/.opam/4.06.0/bin/ocamlc.opt -w -40 -g -bin-annot -I src/.l2.eobjs -I /home/rolf/.opam/4.06.0/lib/base -I /home/rolf/.opam/4.06.0/lib/base/caml -I /home/rolf/.opam/4.06.0/lib/base/md5 -I /home/rolf/.opam/4.06.0/lib/base/shadow_stdlib -I /home/rolf/.opam/4.06.0/lib/bin_prot -I /home/rolf/.opam/4.06.0/lib/bin_prot/shape -I /home/rolf/.opam/4.06.0/lib/biniou -I /home/rolf/.opam/4.06.0/lib/bytes -I /home/rolf/.opam/4.06.0/lib/core -I /home/rolf/.opam/4.06.0/lib/core_kernel -I /home/rolf/.opam/4.06.0/lib/core_kernel/base_for_tests -I /home/rolf/.opam/4.06.0/lib/easy-format -I /home/rolf/.opam/4.06.0/lib/fieldslib -I /home/rolf/.opam/4.06.0/lib/jane-street-headers -I /home/rolf/.opam/4.06.0/lib/oUnit -I /home/rolf/.opam/4.06.0/lib/ocaml/threads -I /home/rolf/.opam/4.06.0/lib/parsexp -I /home/rolf/.opam/4.06.0/lib/ppx_assert/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_bench/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_compare/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_expect/collector -I /home/rolf/.opam/4.06.0/lib/ppx_expect/common -I /home/rolf/.opam/4.06.0/lib/ppx_expect/config -I /home/rolf/.opam/4.06.0/lib/ppx_hash/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_inline_test/config -I /home/rolf/.opam/4.06.0/lib/ppx_inline_test/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_sexp_conv/runtime-lib -I /home/rolf/.opam/4.06.0/lib/sexplib -I /home/rolf/.opam/4.06.0/lib/sexplib/unix -I /home/rolf/.opam/4.06.0/lib/sexplib0 -I /home/rolf/.opam/4.06.0/lib/spawn -I /home/rolf/.opam/4.06.0/lib/splittable_random -I /home/rolf/.opam/4.06.0/lib/stdio -I /home/rolf/.opam/4.06.0/lib/typerep -I /home/rolf/.opam/4.06.0/lib/variantslib -I /home/rolf/.opam/4.06.0/lib/yojson -no-alias-deps -o src/.l2.eobjs/util.cmo -c -impl src/util.pp.ml)
File "src/util.ml", line 68, characters 44-55:
Error: The function applied to this argument has type
compare:('a -> 'a -> int) -> 'a list
This argument cannot be applied with label ~cmp
This error I can fix by removing the label. With this fix the compilation errors out with the following output:
$ jbuilder build @install
ocamlc src/.l2.eobjs/expr.{cmi,cmo,cmt}
File "src/expr.ml", line 80, characters 17-26:
Warning 3: deprecated: Not_found
[since 2018-02] Instead of raising [Not_found], consider using [raise_s] with an
informative error message. If code needs to distinguish [Not_found] from other
exceptions, please change it to handle both [Not_found] and [Not_found_s]. Then, instead
of raising [Not_found], raise [Not_found_s] with an informative error message.
ocamlc src/.l2.eobjs/structure.{cmi,cmo,cmt} (exit 2)
(cd _build/default && /home/rolf/.opam/4.06.0/bin/ocamlc.opt -w -40 -g -bin-annot -I src/.l2.eobjs -I /home/rolf/.opam/4.06.0/lib/base -I /home/rolf/.opam/4.06.0/lib/base/caml -I /home/rolf/.opam/4.06.0/lib/base/md5 -I /home/rolf/.opam/4.06.0/lib/base/shadow_stdlib -I /home/rolf/.opam/4.06.0/lib/bin_prot -I /home/rolf/.opam/4.06.0/lib/bin_prot/shape -I /home/rolf/.opam/4.06.0/lib/biniou -I /home/rolf/.opam/4.06.0/lib/bytes -I /home/rolf/.opam/4.06.0/lib/core -I /home/rolf/.opam/4.06.0/lib/core_kernel -I /home/rolf/.opam/4.06.0/lib/core_kernel/base_for_tests -I /home/rolf/.opam/4.06.0/lib/easy-format -I /home/rolf/.opam/4.06.0/lib/fieldslib -I /home/rolf/.opam/4.06.0/lib/jane-street-headers -I /home/rolf/.opam/4.06.0/lib/oUnit -I /home/rolf/.opam/4.06.0/lib/ocaml/threads -I /home/rolf/.opam/4.06.0/lib/parsexp -I /home/rolf/.opam/4.06.0/lib/ppx_assert/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_bench/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_compare/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_expect/collector -I /home/rolf/.opam/4.06.0/lib/ppx_expect/common -I /home/rolf/.opam/4.06.0/lib/ppx_expect/config -I /home/rolf/.opam/4.06.0/lib/ppx_hash/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_inline_test/config -I /home/rolf/.opam/4.06.0/lib/ppx_inline_test/runtime-lib -I /home/rolf/.opam/4.06.0/lib/ppx_sexp_conv/runtime-lib -I /home/rolf/.opam/4.06.0/lib/sexplib -I /home/rolf/.opam/4.06.0/lib/sexplib/unix -I /home/rolf/.opam/4.06.0/lib/sexplib0 -I /home/rolf/.opam/4.06.0/lib/spawn -I /home/rolf/.opam/4.06.0/lib/splittable_random -I /home/rolf/.opam/4.06.0/lib/stdio -I /home/rolf/.opam/4.06.0/lib/typerep -I /home/rolf/.opam/4.06.0/lib/variantslib -I /home/rolf/.opam/4.06.0/lib/yojson -no-alias-deps -o src/.l2.eobjs/structure.cmo -c -impl src/structure.pp.ml)
File "src/structure.ml", line 57, characters 23-25:
Error: This expression has type
compare:(Ast.example *
([> `List of Ast.expr Core.List.t
| `Tree of Ast.expr Ast.Tree.t ]
as 'a)
Util.SMap.t Core.ref ->
Ast.example * 'a Util.SMap.t Core.ref -> int) ->
(Ast.example * 'a Util.SMap.t Core.ref) Core.List.t
but an expression was expected of type
(Example.t * Ast.expr Util.Ctx.t) list
ocamlopt src/.l2.eobjs/expr.{cmx,o}
File "src/expr.ml", line 80, characters 17-26:
Warning 3: deprecated: Not_found
[since 2018-02] Instead of raising [Not_found], consider using [raise_s] with an
informative error message. If code needs to distinguish [Not_found] from other
exceptions, please change it to handle both [Not_found] and [Not_found_s]. Then, instead
of raising [Not_found], raise [Not_found_s] with an informative error message.
Let me know if I can provide you with any additional info in order to get the compilation to work.
I tried to synthesize
dune exec l2 synth bench/concat.json
,which is the motivation example in their paper, didn't terminate.
(I am not sure the above command is correct because the command in README is not available in the current implementation.)
I used following commands to build with opam 0.2.5:
git clone [email protected]:jfeser/L2.git; cd L2
opam switch create 4.06.1
eval $(opam env)
opam install --deps-only ./l2.opam.locked
dune build
Could you check whether it is a problem with my usage or build?
Hi,
Your build depends on JBuilder, but doesn't otherwise tell us anything about it. When I search for JBuilder, I see several different JBuilder projects available.
Which one is the right one? Can you at least provide a link in the README? Thanks.
Hi,
I followed the instructions on how to build L2 and encountered the following 2 warnings during building stage:
$ make
ocaml setup.ml -build
W: Cannot find source file matching module 'l2' in library l2.
W: Use InterfacePatterns or ImplementationPatterns to define this file with feature "source_patterns".
Finished, 1 target (0 cached) in 00:00:00.
......
File "src/l2-lib/fast_example_deduction.ml", line 389, characters 29-34:
Warning 40: Omega was selected from type Abstract_int.value.
It is not visible in the current scope, and will not
be selected if the type becomes unknown.
File "src/l2-lib/fast_example_deduction.ml", line 390, characters 40-45:
Warning 40: Omega was selected from type Abstract_int.value.
It is not visible in the current scope, and will not
be selected if the type becomes unknown.
File "src/l2-lib/fast_example_deduction.ml", line 395, characters 29-34:
Warning 40: Omega was selected from type Abstract_int.value.
It is not visible in the current scope, and will not
be selected if the type becomes unknown.
File "src/l2-lib/fast_example_deduction.ml", line 396, characters 40-45:
Warning 40: Omega was selected from type Abstract_int.value.
It is not visible in the current scope, and will not
be selected if the type becomes unknown.
File "src/l2-lib/fast_example_deduction.ml", line 401, characters 29-34:
Warning 40: Omega was selected from type Abstract_int.value.
It is not visible in the current scope, and will not
be selected if the type becomes unknown.
...... (Many other similar warnings)
Now the compiled program seems not working and all 55 tests failed. Do you have any idea what might cause this?
$ ./tests.native
........................E..........................E.EE
==============================================================================
Error: all-tests:7:fold_constants:8:(lambda (x) (+ 1 (* 1 5))) => 6.
File "/Users/weijiayi/Programming/OCaml/L2/_build/oUnit-all-tests-meowbook.local#01.log", line 106, characters 1-1:
Error: all-tests:7:fold_constants:8:(lambda (x) (+ 1 (* 1 5))) => 6 (in the log).
Raised by primitive operation at file "lexing.ml", line 65, characters 15-37
Called from file "src/l2-lib/lexer.ml", line 1955, characters 8-65
Called from file "src/l2-lib/parser.ml", line 4729, characters 15-27
Called from file "src/l2-lib/parser.ml", line 3499, characters 22-49
Called from file "src/l2-lib/expr.ml", line 191, characters 6-32
Called from file "src/l2-tests/tests.ml", line 173, characters 31-56
Called from file "src/l2-tests/tests.ml", line 32, characters 40-52
Called from file "src/oUnitRunner.ml", line 46, characters 13-26
(Failure "lexing: empty token")
------------------------------------------------------------------------------
==============================================================================
Error: all-tests:7:fold_constants:7:(lambda (x) (+ x (* 1 5))) => (lambda (x) (+ x 5)).
File "/Users/weijiayi/Programming/OCaml/L2/_build/oUnit-all-tests-meowbook.local#02.log", line 116, characters 1-1:
Error: all-tests:7:fold_constants:7:(lambda (x) (+ x (* 1 5))) => (lambda (x) (+ x 5)) (in the log).
Raised by primitive operation at file "lexing.ml", line 65, characters 15-37
Called from file "src/l2-lib/lexer.ml", line 1955, characters 8-65
Called from file "src/l2-lib/parser.ml", line 4729, characters 15-27
Called from file "src/l2-lib/parser.ml", line 3684, characters 22-49
Called from file "src/l2-lib/expr.ml", line 191, characters 6-32
Called from file "src/l2-tests/tests.ml", line 173, characters 31-56
Called from file "src/l2-tests/tests.ml", line 32, characters 40-52
Called from file "src/oUnitRunner.ml", line 46, characters 13-26
(Failure "lexing: empty token")
..... (Many similar failure)
Error: all-tests:3:v2-engine:0:cost-model:0.
File "/Users/weijiayi/Programming/OCaml/L2/_build/oUnit-all-tests-meowbook.local#01.log", line 43, characters 1-1:
Error: all-tests:3:v2-engine:0:cost-model:0 (in the log).
Raised at file "pervasives.ml", line 32, characters 17-33
Called from file "src/l2-lib/hypothesis.ml" (inlined), line 218, characters 20-44
Called from file "src/l2-tests/v2_engine_tests.ml", line 36, characters 10-54
Called from file "src/oUnitRunner.ml", line 46, characters 13-26
(Failure "Implement me!")
------------------------------------------------------------------------------
Ran: 55 tests in: 0.12 seconds.
FAILED: Cases: 55 Tried: 55 Errors: 4 Failures: 0 Skip: 0 Todo: 0 Timeouts: 0.
And here is my system information:
$ ./configure
Configuration:
ocamlfind: ........................................... /Users/weijiayi/.opam/system/bin/ocamlfind
ocamlc: .............................................. /usr/local/bin/ocamlc.opt
ocamlopt: ............................................ /usr/local/bin/ocamlopt.opt
ocamlbuild: .......................................... /Users/weijiayi/.opam/system/bin/ocamlbuild
Package name: ........................................ L2
Package version: ..................................... 0.2.0
os_type: ............................................. Unix
system: .............................................. macosx
architecture: ........................................ amd64
ccomp_type: .......................................... cc
ocaml_version: ....................................... 4.04.0
standard_library_default: ............................ /usr/local/lib/ocaml
standard_library: .................................... /usr/local/lib/ocaml
standard_runtime: .................................... /usr/local/bin/ocamlrun
bytecomp_c_compiler: ................................. gcc -O2 -fno-strict-aliasing -fwrapv -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
native_c_compiler: ................................... gcc -O2 -fno-strict-aliasing -fwrapv -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
model: ............................................... default
ext_obj: ............................................. .o
ext_asm: ............................................. .s
ext_lib: ............................................. .a
ext_dll: ............................................. .so
default_executable_name: ............................. a.out
systhread_supported: ................................. true
Install architecture-independent files dir: .......... /usr/local
Install architecture-dependent files in dir: ......... $prefix
User executables: .................................... $exec_prefix/bin
System admin executables: ............................ $exec_prefix/sbin
Program executables: ................................. $exec_prefix/libexec
Read-only single-machine data: ....................... $prefix/etc
Modifiable architecture-independent data: ............ $prefix/com
Modifiable single-machine data: ...................... $prefix/var
Object code libraries: ............................... $exec_prefix/lib
Read-only arch-independent data root: ................ $prefix/share
Read-only architecture-independent data: ............. $datarootdir
Info documentation: .................................. $datarootdir/info
Locale-dependent data: ............................... $datarootdir/locale
Man documentation: ................................... $datarootdir/man
Documentation root: .................................. $datarootdir/doc/$pkg_name
HTML documentation: .................................. $docdir
DVI documentation: ................................... $docdir
PDF documentation: ................................... $docdir
PS documentation: .................................... $docdir
findlib_version: ..................................... 1.7.1
is_native: ........................................... true
suffix_program: ......................................
Remove a file.: ...................................... rm -f
Remove a directory.: ................................. rm -rf
Turn ocaml debug flag on: ............................ true
Turn ocaml profile flag on: .......................... false
Compiler support generation of .cmxs.: ............... true
OCamlbuild additional flags: .........................
Create documentations: ............................... true
Compile tests executable and library and run them: ... false
menhir: .............................................. /Users/weijiayi/.opam/system/bin/menhir
ocamllex: ............................................ /usr/local/bin/ocamllex
pkg_core: ............................................ /Users/weijiayi/.opam/system/lib/core
pkg_core_extended: ................................... /Users/weijiayi/.opam/system/lib/core_extended
pkg_yojson: .......................................... /Users/weijiayi/.opam/system/lib/yojson
pkg_hashcons: ........................................ /Users/weijiayi/.opam/system/lib/hashcons
pkg_ounit: ........................................... /Users/weijiayi/.opam/system/lib/oUnit
On the pldi-modernize branch I'm getting a type error during build:
> jbuilder build @install
ocamlopt src/verify.{cmx,o}
ocamlc src/l2.{cmi,cmo,cmt} (exit 2)
...
File "src/l2.ml", line 51, characters 4-834:
Error: The function applied to this argument has type
?readme:(unit -> string) -> Core__Command.t
This argument cannot be applied without label
I'm using ocaml 4.06.0. All dependencies seem to have been installed. Am I doing something wrong?
Hi,
I encountered a similar issue as #5 . In the master branch, none of the simple benchmarks I've tried work. It seems to be stuck. There is no output with the 'verbose' or 'debug' flag turned on as well.
Example:
~/L2$ _build/default/bin/l2_cli.exe synth bench/add.json
.lkO0K0xc.
'kk;. .;kWXc Synthesizing.
.NN, kMMo
'WMWx kMMk Hypotheses verified: 1
;dkc lWMX, Hypotheses saved: 0
.:loc. .OMWx.
.okcdWMN, .oXOc. Memoization table hit rate: 60.00
.0o kMM0 .xNk' ';
.' lMMN. .cOl. .KO Hashcons table equals calls: 2 (2 t, 0 f)
;MMM, lXWOddddddx0Md Hashcons table hash calls: 15, hashcons calls: 15
oMMM: ;kkkkkkkkkkkkk, Hashcons table len: 49157, num entries: 6
.ONWMMl Hashcons bucket sum: 39, min: 0, med: 0, max: 3
'XO.0MMo
,Ko OMMx Signatures: 2 none, 0 checked, 0 dups, 0 fails
.xNc xMMO
;NK, dMM0
.dNd. lMMX. ..
;XMo :MMM' ,O.
dWNl .NMMOlxd.
Could you point me to a simple benchmark that works?
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.