Commit Graph

954 Commits

Author SHA1 Message Date
howardwu
7b7c1bbef4 Remove object dept 2021-03-04 10:51:59 -08:00
howardwu
4e9576e58d Fix object errors 2021-03-04 10:49:47 -08:00
howardwu
d8e9edc941 Update fields structs 2021-03-04 10:48:28 -08:00
howardwu
24f5b168aa Updates r1cs traits 2021-03-04 10:45:37 -08:00
howardwu
f3daba63df Update gadgets traits 2021-03-04 10:41:33 -08:00
howardwu
fc4bc537dd Update primefield traits 2021-03-04 10:39:56 -08:00
howardwu
b95495bab3 Update r1cs error 2021-03-04 10:39:22 -08:00
howardwu
3c4b8e9f68 Update gadgets traits 2021-03-04 10:38:28 -08:00
howardwu
400e3dd440 Update r1cs traits 2021-03-04 10:36:54 -08:00
howardwu
bfdf3c4dca Update field trait 2021-03-04 10:36:29 -08:00
howardwu
4f50b44a63 itemize imports 2021-03-04 10:33:51 -08:00
howardwu
c9f70800fd Update .tomls to 0.2.0 2021-03-04 10:33:21 -08:00
Protryon
d400764e00 parser rewrite 2021-03-03 09:59:24 -08:00
howardwu
2bfb64f83e Update synthesizer to support new terminology 2021-02-27 13:21:29 -08:00
howardwu
8a05594b42 Bump snarkvm to v0.0.6 2021-02-27 13:10:39 -08:00
howardwu
77a0af18fe chore(leo): bump version for new release 2021-02-26 19:42:35 -08:00
François Garillot
0d7c6d0b65
Simplifies a number of pattern-matches
Into the direct `Result` / `Option` combinator they correspond to, for concision / clarity.

Reviewed from automated suggestions generated from [comby-rust](https://github.com/huitseeker/comby-rust).
2021-02-26 13:03:04 -08:00
gluax
6e38cc3b31 merge master for uid deprecation 2021-02-25 13:25:38 -05:00
gluax
3e20a9a177
Merge branch 'master' into feature/485-defines 2021-02-25 13:06:40 -05:00
collin
356b7ba062 merge master 2021-02-25 09:51:12 -08:00
damirka
efd193f187 Merge branch 'master' into console-assert-error 2021-02-25 20:24:43 +03:00
howardwu
be398437c6 Updates snarkVM to 0.0.5, updates rand usage 2021-02-25 08:56:20 -08:00
gluax
88bdc45eb1 merge master 2021-02-25 11:56:14 -05:00
gluax
38f5417571 last bit of clean up 2021-02-25 11:48:13 -05:00
Protryon
ed8d2fb11d remove uuid dependency 2021-02-25 07:40:47 -08:00
howardwu
2e00ff451e Rename all instances of 'ctx' to 'context' 2021-02-24 18:13:36 -08:00
gluax
e970194ed3 tuple const fixes, compiler tests 2021-02-24 11:48:00 -05:00
damirka
6448dac047 Fixes #580
- changes error message for console.assert inside main()
- small rewrite of setup command
- adds some autoformatting
2021-02-24 19:17:44 +03:00
dependabot-preview[bot]
f38cce71b3
Bump bincode from 1.3.1 to 1.3.2
Bumps [bincode](https://github.com/servo/bincode) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/servo/bincode/releases)
- [Commits](https://github.com/servo/bincode/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-24 10:47:15 +00:00
gluax
f7314625ff basic use case works, need to clean up, and test more advanced use cases 2021-02-23 14:38:50 -05:00
bors[bot]
211fcb0195
Merge #678
678: Bug 662 Fix r=collinc97 a=gluax

Allows -field values in input values, resolves #662. Also add tests for that and group - input values. Cleans up the re-written code used in a few places by adding a pub crate function. Depends on #626.

Co-authored-by: gluax <jonathan.t.pavlik@gmail.com>
Co-authored-by: gluax <16431709+gluax@users.noreply.github.com>
2021-02-19 22:10:36 +00:00
gluax
c5641a5507
Update compiler/src/value/field/input.rs
Co-authored-by: Collin Chin <collin.chin@berkeley.edu>
2021-02-19 13:25:11 -05:00
gluax
ad6f3fcf84 allow -field values in input values, clean up repeated code 2021-02-18 14:36:38 -05:00
bors[bot]
c62af038c5
Merge #672 #673
672: Feature/515 eliminate const vars r=collinc97 a=gluax

Resolves #515. Removes const keyword from statements. Also resolves #514. Still allows const y in function declaration of args.

673: feature/671-primefield-refactor r=collinc97 a=gluax

Resolves #671. Refactor "Field + PrimeField" -> "PrimeField" and all tests still pass.

Co-authored-by: gluaxspeed <jonathan.t.pavlik@gmail.com>
Co-authored-by: gluax <jonathan.t.pavlik@gmail.com>
Co-authored-by: Collin Chin <collin.chin@berkeley.edu>
2021-02-18 18:46:46 +00:00
gluax
a7b28fbf0a resolve all the merge conflicts 2021-02-18 11:39:35 -05:00
Collin Chin
9baa9388a0
Merge branch 'master' into feature/515-eliminate-const-vars 2021-02-17 22:06:12 -08:00
bors[bot]
6715f91690
Merge #670
670: feature_626/negative-group-contstraints r=collinc97 a=gluax

Resolves #626. Allows a negative group outside of a pair as well as negative numbers inside a pair group. Waiting to see if the later was necessary in the feature discussion, but I assume it would be.

Co-authored-by: gluax <jonathan.t.pavlik@gmail.com>
2021-02-17 20:50:30 +00:00
bors[bot]
54a9691b73
Merge #652 #663
652: ASG refactor r=collinc97 a=Protryon

## Motivation

This PR makes the ASG more user friendly by using arenas instead of RefCell/Arc:
1. Impossible to leak the ASG by creating a circular strong reference chain
2. We don't need RefCell's everywhere to implement passes

663: Bug 625/fix negative fields not allowed r=collinc97 a=gluax

Resolves #625. Logic used to do so is in check if first character of string to convert is a negative sign. If so remove first character convert from string to field, and then negate it on the leo side. If first character wasn't a negative sign, do the same as before.

Co-authored-by: Protryon <max.bruce12@gmail.com>
Co-authored-by: gluax <jonathan.t.pavlik@gmail.com>
Co-authored-by: gluax <16431709+gluax@users.noreply.github.com>
2021-02-17 20:10:30 +00:00
Protryon
29711ff041 clippy 2021-02-16 13:33:22 -08:00
Protryon
bf61820115 asg refactor 2021-02-16 13:32:34 -08:00
gluax
7e7db4d93b
remove comment
Co-authored-by: Collin Chin <collin.chin@berkeley.edu>
2021-02-16 15:12:20 -05:00
gluax
6cdefa7128
remove comment
Co-authored-by: Collin Chin <collin.chin@berkeley.edu>
2021-02-16 15:12:07 -05:00
gluax
ba3ca6069a refactor Field + PrimeField -> PrimeField, all tests still pass 2021-02-16 14:41:59 -05:00
gluax
d549fda7b5 rebase and replace const keyword in tests 2021-02-16 14:19:20 -05:00
gluax
8150869c6c negative groups, and negative group coords allowed 2021-02-16 12:00:08 -05:00
gluax
5bbaf9d999 add non negated field to test, merge master 2021-02-16 09:22:10 -05:00
bors[bot]
a7c9caf4b3
Merge #653
653: Fix return type error for input-dependent branches r=collinc97 a=Protryon

This PR fixes failure to handle input-dependent branches. No tests added here since base case is covered, and this only occurs with production constraints. Should fix #535.

There is an additional issue not solved by this PR on branching on booleans from input.

Co-authored-by: Protryon <max.bruce12@gmail.com>
2021-02-12 23:36:59 +00:00
gluax
eda78dd968 clippy fix 2021-02-12 15:22:59 -05:00
gluax
500a3e76d2 fix negative fields, add test for them 2021-02-12 15:20:58 -05:00
Collin Chin
6ac356819c
Merge pull request #656 from AleoHQ/dependency/snarkvm-0.0.4
[Dependencies] bump snarkvm module versions to 0.0.4
2021-02-11 19:50:48 -08:00
collin
537ea39513 bump snarkvm module versions to 0.0.4 2021-02-11 17:33:53 -08:00
bors[bot]
fa53e75f51
Merge #641
641: Bug/564 input array len not enforced r=collinc97 a=gluax

Resolves #564, depends on #563. The changes for this branch have pulled from PR #638, which is the PR that fixes #563.

Co-authored-by: gluaxspeed <jonathan.t.pavlik@gmail.com>
2021-02-11 21:41:53 +00:00
bors[bot]
d418b5330c
Merge #638
638: bug/563-array-input-wrong-dimensions r=collinc97 a=gluax

Closes #563. Fixes the array dimension builder when coming from the input file. Adds a test for it as well.

Co-authored-by: gluaxspeed <jonathan.t.pavlik@gmail.com>
2021-02-11 21:22:50 +00:00
Protryon
0bd324bcb4 fix return type error for input-dependent branches 2021-02-11 08:52:22 -08:00
gluaxspeed
9a015e1e5f console assert tests 2021-02-11 10:46:54 -05:00
gluaxspeed
cedcc6e1d1 console assert tests 2021-02-11 10:46:20 -05:00
Collin Chin
20a046bbbb
Merge pull request #643 from AleoHQ/feat/readme_license
Adds READMEs and LICENSEs to each Leo workspace member
2021-02-11 00:58:22 -08:00
bors[bot]
a3f0f9d587
Merge #633 #634
633: duplicate name context test r=collinc97 a=gluax

Adding a test for duplicate name context that was resolved in #546.

634: fn call array params r=collinc97 a=gluax

Adding a test for bug #522, which was resolved by the asg.

Closes #522 

Co-authored-by: gluaxspeed <jonathan.t.pavlik@gmail.com>
2021-02-11 07:53:26 +00:00
bors[bot]
b72b5ac125
Merge #620
620: Feature/254 strengthen import rules r=collinc97 a=gluax

Grammar changes are a bit different than what was suggested in the original feature request #254. However, it should be logically equivalent and I think makes more sense on the rust side.

Closes #254 

Co-authored-by: gluaxspeed <jonathan.t.pavlik@gmail.com>
2021-02-11 07:31:56 +00:00
howardwu
777a67fb40 Adds README.md 2021-02-10 22:27:37 -08:00
howardwu
55db999a9e Adds LICENSE.md 2021-02-10 22:23:45 -08:00
gluaxspeed
9812c76e1f fix test needed to expect it to fail 2021-02-10 12:49:18 -05:00
gluaxspeed
42fb5ea635 merge from pr 638 2021-02-10 11:59:42 -05:00
gluaxspeed
202f056531 fix pushed but depends on pr #638 2021-02-10 11:57:10 -05:00
gluaxspeed
e48b971789 reverse iter for building array, add test case for it 2021-02-09 10:26:16 -05:00
gluaxspeed
2f6cc6c995 add test for the fixed bug 2021-02-08 15:42:37 -05:00
gluaxspeed
9651af3089 add test for the fixed bug 2021-02-08 13:44:30 -05:00
howardwu
1898cc6840 chore(leo): bump version for new release 2021-02-07 08:14:56 -08:00
gluaxspeed
f7add0fc98 re-ignore import test-many in compiler, it breaks pipeline 2021-02-05 15:33:48 -05:00
gluaxspeed
26f9973e14 resolve merge conflict, asg + grammar tests 2021-02-05 14:20:48 -05:00
gluaxspeed
59acb1a022 unignore test and add test case to thoroughly test 2021-02-05 11:36:21 -05:00
Collin Chin
770f660f3a
Merge pull request #617 from AleoHQ/const-args
[Feature] Const Function Arguments
2021-02-04 23:05:51 -08:00
Collin Chin
2bb10c2e8b
Merge pull request #621 from AleoHQ/dependency/snarkvm-0.0.3
[Dependencies] Bump snarkvm module versions
2021-02-04 22:57:36 -08:00
Collin Chin
a239e17bb6
Merge pull request #622 from AleoHQ/refactor/compiler
Adds ASG struct, updates ASG to support debug
2021-02-04 22:52:40 -08:00
howardwu
2a4052975f Fix clippy 2021-02-04 20:34:24 -08:00
howardwu
749e70b5b0 Fix clippy 2021-02-04 20:32:59 -08:00
howardwu
1b99c42470 Adds ASG struct, updates ASG to support debug 2021-02-04 19:21:17 -08:00
howardwu
f80c3d236a Renames InnerProgram to InternalProgram 2021-02-04 17:31:44 -08:00
howardwu
fb7a9f4a18 Simplify compiler calls 2021-02-04 17:26:29 -08:00
Howard Wu
fd5ce2f393
Merge pull request #585 from AleoHQ/feature/228-implied-circuit-name
[Feature] 228 implied circuit name
2021-02-04 14:28:14 -08:00
collin
f5be2e037f add inline circuit integration tests 2021-02-04 13:18:28 -08:00
collin
c706ef65b8 bump snarkvm module versions 2021-02-04 13:00:30 -08:00
Protryon
5d4fbdbbe2 unignore swap test 2021-02-04 07:36:41 -08:00
Protryon
9c6eb23a1e const func arguments 2021-02-04 07:35:12 -08:00
howardwu
90fc6a9c12 chore(leo): bump version for new release 2021-02-03 13:34:03 -08:00
howardwu
0d907bbb26 chore(leo): bump version for new release 2021-02-03 12:36:17 -08:00
Howard Wu
59aa8ac21c
Merge pull request #603 from AleoHQ/asg-return-check
Remove compiler return check
2021-02-03 11:28:35 -08:00
Protryon
fcbb5e4fd9 remove compiler return check 2021-02-02 19:33:41 -08:00
Protryon
abee76680b add test 2021-02-02 18:42:00 -08:00
Protryon
b078c6e09f remove mutable constrainedvalue 2021-02-02 18:37:27 -08:00
Protryon
e028255513 update license headers 2021-02-02 11:31:54 -08:00
Protryon
c417f2f082 fix build 2021-02-02 11:11:43 -08:00
collin
90ee77cad5 mirror swap test in asg 2021-02-02 11:09:36 -08:00
Protryon
ca549258b8 blake2s unwrap muts 2021-02-02 11:08:57 -08:00
Protryon
da52984385 output bytes update 2021-02-02 11:08:57 -08:00
Protryon
80d5c87b8a asg 2021-02-02 11:08:56 -08:00
howardwu
cbd45e56d7 Resolves unknown clippy flags 2021-02-01 20:39:01 -08:00
howardwu
c935d6a486 Update license to 2021 2021-02-01 20:26:56 -08:00
gluaxspeed
2bda443d9c added more tests 2021-01-27 12:10:34 -05:00
collin
d7cced6e53 rustup update && cargo clippy 2021-01-26 14:55:15 -05:00
gluaxspeed
29ff3c90b6 error and error message for deprecated test syntax, fmt, clean up 2021-01-25 15:12:10 -05:00
collin
fe78b2ec11 deprecate old test function syntax 2021-01-21 16:50:15 -05:00
Protryon
3c063d725f rename conditional expr to ternary 2021-01-14 05:27:31 -08:00
howardwu
1a36a262b8 chore(leo): bump version for new release 2021-01-12 17:03:16 -04:00
Howard Wu
d3fcd19506
Merge pull request #536 from AleoHQ/fix/return-type-check
Fix/return type check
2021-01-12 16:42:13 -04:00
collin
f3452b9706 test program output array registers 2021-01-11 21:48:57 -05:00
collin
9215d911e6 use eq_flat type comparison method 2021-01-11 21:40:02 -05:00
Collin Chin
5f80cc4642
Merge pull request #532 from huitseeker/no-panic
Removes a panic
2021-01-11 20:52:59 -05:00
collin
758cf88de7 fix warnings 2021-01-08 20:08:14 -05:00
collin
c48c39caaf check output register type == return value type + tests 2021-01-08 20:06:23 -05:00
François Garillot
d41c1b7138
Removes a panic
One panic can be folded in the error case of its enclosing `Result`, an `unwrap` call can be elided through pattern-matching reformulation.
2021-01-08 07:12:23 -08:00
Howard Wu
2cde6d0659
Merge pull request #520 from AleoHQ/fix/conditional-logging
fix conditional logging bug #407
2021-01-07 20:30:48 -04:00
collin
fea8bb6d1e Merge branch 'master' of github.com:AleoHQ/leo into ast-cleanup 2021-01-05 13:09:41 -05:00
collin
d28e161706 fix conditional logging bug #407 2021-01-04 11:34:38 -05:00
howardwu
87ccc0fe3d Update snarkVM deps to crates 2021-01-03 22:37:06 -04:00
howardwu
d5cb59c206 Update ci.yml 2021-01-02 19:18:38 -04:00
howardwu
c20822e828 Update revision 2021-01-02 18:17:26 -04:00
howardwu
11fc60c9e0 Update revision 2020-12-30 18:07:20 -04:00
howardwu
f4ad1ffff4 Add revision for snarkvm 2020-12-30 12:54:48 -04:00
howardwu
2d64515763 Migrate to snarkVM 2020-12-30 12:40:45 -04:00
howardwu
141ee7eb0f Resolve merge conflicts 2020-12-30 11:37:51 -04:00
howardwu
1d9215a1ac Migrates to hot 1.1.4 and adds memory usage improvements for programs 2020-12-30 11:32:10 -04:00
Protryon
91cac5f9d0 remove custom eq/hash implementations, add node implementations, remove range_or_expression 2020-12-21 05:58:10 -08:00
howardwu
1e79277728 Remove tracing-subscriber dep from compiler 2020-12-20 10:20:13 -04:00
Protryon
833eeb7fc5 fix mutable match error 2020-12-16 15:01:15 -08:00
Protryon
6bb3437280 remove unused assign code 2020-12-16 15:01:14 -08:00
Protryon
d1276bd95d statement breakout 2020-12-16 15:00:45 -08:00
collin
6e2dcdd1b0 fix serialization 2020-12-16 14:21:57 -05:00
collin
1dbd72c453 Merge branch 'master' of github.com:AleoHQ/leo into expression-breakout 2020-12-16 13:46:43 -05:00
dependabot-preview[bot]
8894f10de7
Bump indexmap from 1.6.0 to 1.6.1
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/bluss/indexmap/releases)
- [Commits](https://github.com/bluss/indexmap/compare/1.6.0...1.6.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-15 10:44:12 +00:00
howardwu
9038c5a17a chore(leo): bump version for new release 2020-12-14 13:57:01 -04:00
howardwu
babb8ec175 Hotfix cargo fmt 2020-12-14 13:54:46 -04:00
Howard Wu
235f85e039
Merge pull request #494 from AleoHQ/refactor/parse-program-from-string
Undeprecate parse_program_from_string
2020-12-11 17:35:10 -04:00
Howard Wu
878f0a8461
Merge pull request #493 from AleoHQ/fix/self-access-scope
fix accessing self variable inside nested scope bug
2020-12-11 17:33:32 -04:00
Howard Wu
32dad40521
Merge pull request #492 from AleoHQ/fix/array-spread-type
Fix array spread type bug
2020-12-11 17:32:44 -04:00
collin
ca36d06022 undeprecate parse_program_from_string and add test 2020-12-11 13:31:13 -05:00
collin
8ace306e2c fix cargo lock 2020-12-11 12:22:07 -05:00
collin
161fe2608c fix accessing self variable inside nested scope bug 2020-12-10 18:02:25 -05:00
collin
08e90f5c59 fix array spread type bug 2020-12-10 17:54:19 -05:00
collin
e2406bec86 fix lower array slice bug 2020-12-09 17:42:15 -05:00
collin
40c816f921 update swap test 2020-12-09 17:08:22 -05:00
collin
6e67ea485a Merge branch 'master' of github.com:AleoHQ/leo into fix/nested-mut-assignee 2020-12-09 17:06:49 -05:00
collin
00dac3709a Merge branch 'master' of github.com:AleoHQ/leo into fix/prefer-index-map 2020-12-08 16:07:49 -05:00
collin
8a44eff4a5 fix nested mutable assignee bug, add swap test 2020-12-08 16:00:12 -05:00
Collin Chin
8541eb3fb8
Update mod.rs 2020-12-08 12:21:18 -05:00
Collin Chin
ac68e8e6a4
Merge branch 'master' into fix/prefer-include-str 2020-12-08 11:37:30 -05:00
collin
b7e5cd13df fix failing test 2020-12-08 10:47:07 -05:00
Protryon
5c1a522f89 remove debug prints 2020-12-07 17:05:45 -08:00
Protryon
f9dc75f70c expression breakout 2020-12-07 17:05:44 -08:00
collin
c351c300a2 merge master 2020-12-07 20:05:15 -05:00