You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

36 lines
481 B

package circuitcompiler
import (
"fmt"
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func TestCircuitParser(t *testing.T) {
/*
input:
def test():
y = x**3
return x + y + 5
flattened:
m1 = s1 * s1
m2 = m1 * s1
m3 = m2 + s1
out = m3 + 5
*/
raw := `
y = x^x
z = x + y
out = z + 5
`
parser := NewParser(strings.NewReader(raw))
res, err := parser.Parse()
assert.Nil(t, err)
fmt.Println(res)
// flat code
// flat code to R1CS
}