diff --git a/CLAUDE.md b/CLAUDE.md index 710184242..d39954b7d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -30,36 +30,35 @@ make install ### Running specific test subsets The test targets vary widely in runtime — pick the smallest set that covers -your change to keep the iteration loop tight. The slow targets (`asm-unit`, -`asm-bench`, `corset-test`) will exceed the default 2-minute `go test` +your change to keep the iteration loop tight. The slow targets (`corset-test`, +`zkc-unit-test`, the benchmarks) will exceed the default 2-minute `go test` timeout if invoked directly, which is why the Makefile passes `--timeout 0`. ```shell -# ZkC compiler/VM tests — Test_ZkcBench|Test_ZkcUnit|Test_ZkcInvalid (fast) -make zkc-test +# ZkC compiler/VM tests — Test_ZkcUnit|Test_ZkcMixed|Test_ZkcInvalid (slow) +make zkc-unit-test +make zkc-util-test # go test -run "Test_ZkcUtil" +make zkc-bench-test # go test -run "Test_ZkcBench" -# Cheap "everything else" — skips Asm/Bench/Corset/Zkc system tests (fast) +# Cheap "everything else" — skips Bench/Corset/Zkc system tests (fast) make unit-test # Corset constraint tests (valid/invalid/agnostic) — slow (minutes) make corset-test # go test -run "Test_Agnostic|Test_Valid|Test_Invalid" - -# Assembly tests — slow; Test_AsmUnit_ByteShift alone takes ~2+ min -make asm-unit # go test -run "Test_AsmInvalid|Test_AsmUnit" -make asm-util # go test -run "Test_AsmUtil" -make asm-bench # go test -run "Test_AsmBench" (slowest; -p 1) +make corset-bench # go test -run "Test_Bench" (slowest; -p 1) # Run a single named test go test --timeout 0 -run "Test_Valid_Basic_01" ./pkg/test/... # Run tests with race detection -make asm-racer +make corset-racer +make zkc-racer-test ``` -When iterating on ZkC changes (e.g. `pkg/zkc/...`), `make zkc-test` is the -relevant target — `make asm-unit` will not exercise ZkC code and is too slow -for a quick check. Combining `Test_ZkcUnit|Test_AsmUnit` in a single -`go test -run` invocation will time out at the default 2-minute limit. +When iterating on ZkC changes (e.g. `pkg/zkc/...`), `make zkc-unit-test` is the +relevant target — `make corset-test` will not exercise ZkC code. Note the +`zkc-*` targets depend on `zkc-lint`, which builds `bin/zkc` and checks the +formatting of the `.zkc` sources. ### CLI usage @@ -71,12 +70,13 @@ for a quick check. Combining `Test_ZkcUnit|Test_AsmUnit` in a single ./bin/go-corset compile -o out.bin constraints.lisp # Debug / inspect constraints -./bin/go-corset debug --stats --air constraints.lisp +./bin/go-corset debug --air constraints.lisp ./bin/go-corset debug --mir constraints.lisp -# Trace inspection / conversion +# Trace inspection / conversion (output format follows the file extension) ./bin/go-corset trace --print trace.lt -./bin/go-corset trace --out json trace.lt > trace.json +./bin/go-corset trace --stats trace.lt +./bin/go-corset trace -o trace.json trace.lt # Interactive trace visualisation ./bin/go-corset inspect trace.lt constraints.lisp @@ -85,7 +85,7 @@ for a quick check. Combining `Test_ZkcUnit|Test_AsmUnit` in a single Key CLI flags (available globally): - `--field `: prime field to use (default `BLS12_377`; others: `KOALABEAR_16`, `GF_8209`, `GF_251`) -- `--air / --mir / --asm / --uasm / --nasm`: select constraint representation level +- `--air / --mir`: select constraint representation level - `--debug`: enable debug constraints - `-S `: set externalised constant values - `-O `: optimisation level for MIR→AIR lowering @@ -108,56 +108,45 @@ The central pipeline transforms `.lisp` (Corset source) into an Arithmetic Inter ``` .lisp source → Corset compiler (pkg/corset/) - → MacroHirProgram (asm macro instructions + HIR modules) - → Macro ASM → Micro ASM → Nano ASM (pkg/asm/) - → MIR modules (pkg/ir/mir/) - → AIR schema (pkg/ir/air/) + → HIR schema (pkg/ir/hir/) + → MIR modules (pkg/ir/mir/) + → AIR schema (pkg/ir/air/) ``` Alternatively, pre-compiled `.bin` binary files can feed in at the top (read via `pkg/binfile/`). -The `SchemaStacker` in `pkg/cmd/corset/util/schema_stacker.go` orchestrates which layers are built and held in memory, controlled by the `--asm/uasm/nasm/mir/air` CLI flags. +The `SchemaStacker` in `pkg/cmd/corset/util/schema_stacker.go` orchestrates which layers are built and held in memory, controlled by the `--mir/air` CLI flags. Layer constants (defined in `schema_stacker.go`): -- `MACRO_ASM_LAYER = 0` – highest-level; Corset output -- `MICRO_ASM_LAYER = 1` – vectorised, field-specific -- `NANO_ASM_LAYER = 2` – after register splitting -- `MIR_LAYER = 3` – true constraints, higher-level view -- `AIR_LAYER = 4` – lowest level, passed to prover +- `MIR_LAYER = 3` – true constraints, higher-level view +- `AIR_LAYER = 4` – lowest level, passed to prover ### Key packages -| Package | Role | -| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| `pkg/corset/` | Corset DSL compiler: parses `.lisp`, resolves symbols, type-checks, and emits a `MacroHirProgram`. Standard library embedded as `stdlib.lisp`. | -| `pkg/corset/ast/` | AST nodes for Corset: declarations, expressions, types, bindings | -| `pkg/corset/compiler/` | Compiler internals: parser, resolver, type-checker, preprocessor, translator, register allocator | -| `pkg/asm/` | Assembly layer: `MacroProgram` / `MicroProgram` types, lowering (macro→micro), vectorisation, concretisation to MIR | -| `pkg/asm/io/` | Core abstractions: `Instruction`, `Function`, `Component`, `Program`, bus interface (Map) | -| `pkg/asm/io/macro/` | Macro instruction set (high-level: assign, call, cast, divide, if/goto, …) | -| `pkg/asm/io/micro/` | Micro instruction set (low-level: polynomial, skip_if, jmp, …); includes DFA for analysis | -| `pkg/asm/assembler/` | Parser/linker for `.zkasm` assembly text format | -| `pkg/ir/hir/` | High-level IR: `LowerToMir()` — HIR modules → MIR modules | -| `pkg/ir/mir/` | Mid-level IR: `LowerToAir()` — MIR modules → AIR schema, optimiser | -| `pkg/ir/air/` | AIR schema: final vanishing polynomials + gadgets | -| `pkg/schema/` | Core schema interfaces (`Schema`, `Module`, `Assignment`, `Constraint`) parameterised over field element type `F` | -| `pkg/schema/constraint/` | Constraint types: vanishing, lookup, permutation, range | -| `pkg/trace/` | Trace representation; `json/` and `lt/` (binary) format readers/writers | -| `pkg/binfile/` | Binary `.bin` file serialisation (gob-encoded) | -| `pkg/zkc/` | ZK compiler / VM: a separate compiler+virtual machine (`pkg/zkc/vm/`) with ROM, RAM, WOM memories and a call stack | -| `pkg/util/field/` | Field element implementations: `bls12_377`, `koalabear`, `gf251`, `gf8209`, `mersenne31` | -| `pkg/util/` | General utilities: collections, iterators, source maps, math, word types | -| `cmd/go-corset/` | Main entry point | -| `pkg/cmd/corset/` | CLI commands: check, compile, debug, inspect, trace, generate | -| `pkg/cmd/zkc/` | CLI commands for the ZK compiler toolchain | +| Package | Role | +| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `pkg/corset/` | Corset DSL compiler: parses `.lisp`, resolves symbols, type-checks, and emits an `hir.Schema`. Standard library embedded as `stdlib.lisp`. | +| `pkg/corset/ast/` | AST nodes for Corset: declarations, expressions, types, bindings | +| `pkg/corset/compiler/` | Compiler internals: parser, resolver, type-checker, preprocessor, translator, register allocator | +| `pkg/ir/hir/` | High-level IR: `LowerToMir()` — HIR modules → MIR modules | +| `pkg/ir/mir/` | Mid-level IR: `LowerToAir()` — MIR modules → AIR schema, optimiser | +| `pkg/ir/air/` | AIR schema: final vanishing polynomials + gadgets | +| `pkg/schema/` | Core schema interfaces (`Schema`, `Module`, `Assignment`, `Constraint`) parameterised over field element type `F` | +| `pkg/schema/constraint/` | Constraint types: vanishing, lookup, range | +| `pkg/trace/` | Trace representation; `json/` and `lt/` (binary) format readers/writers | +| `pkg/binfile/` | Binary `.bin` file serialisation (gob-encoded) | +| `pkg/zkc/` | ZK compiler / VM: a separate compiler+virtual machine (`pkg/zkc/vm/`) with ROM, RAM, WOM memories and a call stack | +| `pkg/util/field/` | Field element implementations: `bls12_377`, `koalabear`, `gf251`, `gf8209`, `mersenne31` | +| `pkg/util/` | General utilities: collections, iterators, source maps, math, word types | +| `cmd/go-corset/` | Main entry point | +| `pkg/cmd/corset/` | CLI commands: check, compile, debug, inspect, trace, generate, verify | +| `pkg/cmd/zkc/` | CLI commands for the ZK compiler toolchain | ### Schema and field polymorphism All schemas, constraints, assignments and modules are parameterised on a field element type `F` (implementing `field.Element[F]`). Most internal work uses `word.BigEndian` as the concrete field type during compilation; field-specific code lives under `pkg/util/field//`. -The `MixedProgram[F, T, M]` type in `pkg/asm/program.go` composes assembly components (parameterised on instruction type `T`) with legacy external HIR/MIR modules (type `M`), bridging the assembly and constraint worlds. - ### Testing conventions Tests live in `pkg/test/` and are named following the pattern: @@ -165,17 +154,18 @@ Tests live in `pkg/test/` and are named following the pattern: - `Test_Valid_*` — traces that must be accepted by constraints - `Test_Invalid_*` — traces that must be rejected - `Test_Agnostic_*` — field-agnostic tests -- `Test_AsmUnit_*` — assembly unit tests -- `Test_AsmUtil_*` / `Test_AsmBench_*` — utility and benchmark tests +- `Test_Bench_*` — corset benchmark tests +- `Test_ZkcUnit_*` / `Test_ZkcMixed_*` / `Test_ZkcInvalid_*` — ZkC compiler/VM tests +- `Test_ZkcUtil_*` / `Test_ZkcBench_*` — ZkC utility and benchmark tests Test fixtures are in `testdata/`: -- `testdata/corset/valid/`, `testdata/corset/invalid/`, `testdata/corset/agnostic/` -- `testdata/asm/unit/`, `testdata/asm/invalid/`, `testdata/asm/bench/` +- `testdata/corset/valid/`, `testdata/corset/invalid/`, `testdata/corset/agnostic/`, `testdata/corset/bench/` +- `testdata/zkc/unit/`, `testdata/zkc/invalid/`, `testdata/zkc/mixed/`, `testdata/zkc/util/`, `testdata/zkc/bench/` -Each test case consists of a `.lisp` (or `.zkasm`) source file plus `.accepts` / `.rejects` JSON trace files. Tests run against multiple fields simultaneously (e.g. `BLS12_377`, `KOALABEAR_16`, `GF_8209`). +Each test case consists of a `.lisp` (or `.zkc`) source file plus `.accepts` / `.rejects` JSON trace files. Tests run against multiple fields simultaneously (e.g. `BLS12_377`, `KOALABEAR_16`, `GF_8209`). -The `FIELD_REGEX` environment variable (in `pkg/test/util/check_valid.go`) can restrict which fields are tested — useful in CI pipelines. +The `FIELD_REGEX` environment variable (in `pkg/test/util/check_legacy.go`) can restrict which fields are tested — useful in CI pipelines. When adding tests, always prefer end-to-end tests (a source fixture in `testdata/` plus `.accepts` / `.rejects` trace files, registered in the diff --git a/pkg/cmd/corset/verify/picus/air_to_picus.go b/pkg/cmd/corset/verify/picus/air_to_picus.go index 5c72e06eb..0922fb077 100644 --- a/pkg/cmd/corset/verify/picus/air_to_picus.go +++ b/pkg/cmd/corset/verify/picus/air_to_picus.go @@ -7,6 +7,7 @@ import ( "github.com/LFDT-Lineth/zkc/pkg/cmd/corset/verify/picus/pcl" "github.com/LFDT-Lineth/zkc/pkg/ir/air" "github.com/LFDT-Lineth/zkc/pkg/schema" + "github.com/LFDT-Lineth/zkc/pkg/schema/register" "github.com/LFDT-Lineth/zkc/pkg/util/field" ) @@ -129,7 +130,7 @@ func (p *AirPicusTranslator[F]) translateLookup(v air.LookupConstraint[F], picus source := v.Unwrap().Sources[0] sourceModule := p.airSchema.Module(source.Module) - sourceTerm := p.lowerTerm(source.Ith(0), sourceModule) + sourceTerm := p.lowerRegister(source.Ith(0), 0, sourceModule) upperBound := pcl.C(field.BigInt[F](*MaxValueBig(128))) picusModule.AddLeqConstraint(sourceTerm, upperBound) } @@ -153,16 +154,7 @@ func (p *AirPicusTranslator[F]) lowerTerm(t air.Term[F], module schema.Module[F] case *air.Constant[F]: return pcl.C(e.Value) case *air.ColumnAccess[F]: - name := module.Register(e.Register()).Name() - if strings.Contains(name, " ") { - name = fmt.Sprintf("\"%s\"", name) - } - - if e.RelativeShift() != 0 { - name = fmt.Sprintf("%s_%d", name, e.RelativeShift()) - } - - return pcl.V[F](name) + return p.lowerRegister(e.Register(), e.RelativeShift(), module) case *air.Mul[F]: args := p.lowerTerms(e.Args, module) return pcl.FoldBinaryE(pcl.Mul, args) @@ -174,6 +166,21 @@ func (p *AirPicusTranslator[F]) lowerTerm(t air.Term[F], module schema.Module[F] } } +// lowerRegister converts an access of a given register (at a given relative +// shift) into a PCL variable. +func (p *AirPicusTranslator[F]) lowerRegister(rid register.Id, shift int, module schema.Module[F]) pcl.Expr[F] { + name := module.Register(rid).Name() + if strings.Contains(name, " ") { + name = fmt.Sprintf("\"%s\"", name) + } + + if shift != 0 { + name = fmt.Sprintf("%s_%d", name, shift) + } + + return pcl.V[F](name) +} + // lowerTerms lowers a set of zero or more AIR expressions. func (p *AirPicusTranslator[F]) lowerTerms(exprs []air.Term[F], airModule schema.Module[F]) []pcl.Expr[F] { nexprs := make([]pcl.Expr[F], len(exprs)) diff --git a/pkg/corset/ast/declaration.go b/pkg/corset/ast/declaration.go index 726b542d0..f5ecbcc73 100644 --- a/pkg/corset/ast/declaration.go +++ b/pkg/corset/ast/declaration.go @@ -17,6 +17,7 @@ import ( "math/big" "github.com/LFDT-Lineth/zkc/pkg/util" + "github.com/LFDT-Lineth/zkc/pkg/util/collection/array" "github.com/LFDT-Lineth/zkc/pkg/util/collection/iter" "github.com/LFDT-Lineth/zkc/pkg/util/file" "github.com/LFDT-Lineth/zkc/pkg/util/source/sexp" @@ -598,18 +599,21 @@ func (p *DefInRange) Lisp() sexp.SExp { // deflookup // ============================================================================ -// DefLookup represents a lookup constraint between a set N of source -// expressions and a set of N target expressions. The source expressions must -// have a single context (i.e. all be in the same module) and likewise for the -// target expressions (though the source and target contexts can differ). The -// constraint can be viewed as a "subset constraint". Let the set of "source -// tuples" be those obtained by evaluating the source expressions over all rows -// in the source context, and likewise the "target tuples" those for the target -// expressions in the target context. Then the lookup constraint holds if the -// set of source tuples is a subset of the target tuples. This does not need to -// be a strict subset, so the two sets can be identical. Furthermore, these are -// not treated as multi-sets, hence the number of occurrences of a given tuple -// is not relevant. +// DefLookup represents a lookup constraint between a set N of source columns +// and a set of N target columns. The source columns must have a single context +// (i.e. all be in the same module) and likewise for the target columns (though +// the source and target contexts can differ). The constraint can be viewed as +// a "subset constraint". Let the set of "source tuples" be those obtained by +// reading the source columns over all rows in the source context, and likewise +// the "target tuples" those for the target columns in the target context. Then +// the lookup constraint holds if the set of source tuples is a subset of the +// target tuples. This does not need to be a strict subset, so the two sets can +// be identical. Furthermore, these are not treated as multi-sets, hence the +// number of occurrences of a given tuple is not relevant. +// +// NOTE: sources and targets (along with their selectors) are column accesses +// rather than arbitrary expressions. This reflects what the underlying +// constraint system supports. type DefLookup struct { // Unique handle given to this constraint. This is primarily useful for // debugging (i.e. so we know which constraint failed, etc). @@ -617,23 +621,23 @@ type DefLookup struct { // Checked determines whether or not "type checking" is enabled for source / // target pairs. Checked bool - // Source selector expressions (nil entries mean no selector for corresponding source). - SourceSelectors []Expr - // Source expressions for lookup (i.e. these values must all be contained - // within the targets). - Sources [][]Expr - // Target selector expressions (nil entries mean no selector for corresponding source). - TargetSelectors []Expr - // Target expressions for lookup (i.e. these values must contain all of the + // Source selectors (nil entries mean no selector for corresponding source). + SourceSelectors []TypedSymbol + // Source columns for lookup (i.e. these values must all be contained within + // the targets). + Sources [][]TypedSymbol + // Target selectors (nil entries mean no selector for corresponding source). + TargetSelectors []TypedSymbol + // Target columns for lookup (i.e. these values must contain all of the // source values, but may contain more). - Targets [][]Expr - // Indicates whether or not target and source expressions have been resolved. + Targets [][]TypedSymbol + // Indicates whether or not target and source columns have been resolved. finalised bool } // NewDefLookup creates a new (unfinalised) lookup constraint. -func NewDefLookup(handle string, checked bool, sourceSelectors []Expr, sources [][]Expr, - targetSelectors []Expr, targets [][]Expr) *DefLookup { +func NewDefLookup(handle string, checked bool, sourceSelectors []TypedSymbol, sources [][]TypedSymbol, + targetSelectors []TypedSymbol, targets [][]TypedSymbol) *DefLookup { // return &DefLookup{handle, checked, sourceSelectors, sources, targetSelectors, targets, false} } @@ -646,29 +650,26 @@ func (p *DefLookup) Definitions() iter.Iterator[SymbolDefinition] { // Dependencies needed to signal declaration. func (p *DefLookup) Dependencies() iter.Iterator[Symbol] { - var deps []Symbol - // - for i, sources := range p.Sources { - ith_selector := p.SourceSelectors[i] - // - if ith_selector != nil { - deps = append(deps, ith_selector.Dependencies()...) - } - // - deps = append(deps, DependenciesOfExpressions(sources)...) - } + var ( + sources = dependenciesOfLookupVectors(p.SourceSelectors, p.Sources) + targets = dependenciesOfLookupVectors(p.TargetSelectors, p.Targets) + viter = iter.NewArrayIterator(append(sources, targets...)) + ) + // put it altogether + return iter.NewCastIterator[TypedSymbol, Symbol](viter) +} + +// dependenciesOfLookupVectors returns the given symbols as dependencies. That +// is, each symbol depends only upon itself. +func dependenciesOfLookupVectors(selectors []TypedSymbol, targets [][]TypedSymbol) []TypedSymbol { + // Filter out all empty selectors + selectors = array.Filter(selectors, func(t TypedSymbol) bool { return t != nil }) + // Flattern targets + flat := array.FlatMap(targets, func(f []TypedSymbol) []TypedSymbol { + return f + }) // - for i, targets := range p.Targets { - ith_selector := p.TargetSelectors[i] - // - if ith_selector != nil { - deps = append(deps, ith_selector.Dependencies()...) - } - // - deps = append(deps, DependenciesOfExpressions(targets)...) - } - // Combine deps - return iter.NewArrayIterator(deps) + return append(selectors, flat...) } // Defines checks whether this declaration defines the given symbol. The symbol diff --git a/pkg/corset/ast/symbol.go b/pkg/corset/ast/symbol.go index 11c8f4b0a..8193bf98c 100644 --- a/pkg/corset/ast/symbol.go +++ b/pkg/corset/ast/symbol.go @@ -54,6 +54,36 @@ type TypedSymbol interface { Type() Type } +// ContextOfSymbol returns the context of a given symbol. For a column access, +// this is the context of the enclosing (non-virtual) module. Anything else +// (e.g. a constant) has no context, and the void context is returned. +func ContextOfSymbol(symbol TypedSymbol) Context { + if binding, ok := symbol.Binding().(*ColumnBinding); ok { + return binding.Context() + } + // Anything else has no context. + return VoidContext() +} + +// ContextOfSymbols returns the context for a set of zero or more symbols, along +// with the index of the first symbol whose context conflicts with those seen +// before it (or the number of symbols, if there is no conflict). Observe that, +// if the symbols have no context (e.g. they are all constants) then the void +// context is returned. +func ContextOfSymbols(symbols ...TypedSymbol) (Context, uint) { + context := VoidContext() + // + for i, s := range symbols { + context = context.Join(ContextOfSymbol(s)) + // + if context.IsConflicted() { + return context, uint(i) + } + } + // + return context, uint(len(symbols)) +} + // SymbolDefinition represents a declaration (or part thereof) which defines a // particular symbol. For example, "defcolumns" will define one or more symbols // representing columns, etc. diff --git a/pkg/corset/compiler/parser.go b/pkg/corset/compiler/parser.go index 8abff7c22..6f0ccc65f 100644 --- a/pkg/corset/compiler/parser.go +++ b/pkg/corset/compiler/parser.go @@ -709,35 +709,35 @@ func (p *Parser) parseDefLookup(module file.Path, elements []sexp.SExp) (ast.Dec return nil, errors } // - targetSelectors := make([]ast.Expr, len(targets)) - sourceSelectors := make([]ast.Expr, len(sources)) + targetSelectors := make([]ast.TypedSymbol, 1) + sourceSelectors := make([]ast.TypedSymbol, 1) // Done return ast.NewDefLookup(handle, checked, - sourceSelectors, [][]ast.Expr{sources}, - targetSelectors, [][]ast.Expr{targets}), nil + sourceSelectors, [][]ast.TypedSymbol{sources}, + targetSelectors, [][]ast.TypedSymbol{targets}), nil } // Parse a conditional lookup declaration func (p *Parser) parseDefConditionalLookup(module file.Path, elements []sexp.SExp) (ast.Declaration, []SyntaxError) { // Extract items var ( - targets, sources []ast.Expr - targetSelector, sourceSelector ast.Expr + targets, sources []ast.TypedSymbol + targetSelector, sourceSelector ast.TypedSymbol errs1, errs2, errs3, errs4 []SyntaxError ) // handle, checked, errors := p.parseLookupHandle(module, elements[1]) // if len(elements) == 6 { - targetSelector, errs1 = p.translator.Translate(elements[2]) + targetSelector, errs1 = p.parseDefLookupSelector(elements[2]) targets, errs2 = p.parseDefLookupSources("target", elements[3]) - sourceSelector, errs3 = p.translator.Translate(elements[4]) + sourceSelector, errs3 = p.parseDefLookupSelector(elements[4]) sources, errs4 = p.parseDefLookupSources("source", elements[5]) } else { // Assume source selector targets, errs1 = p.parseDefLookupSources("target", elements[2]) - sourceSelector, errs2 = p.translator.Translate(elements[3]) + sourceSelector, errs2 = p.parseDefLookupSelector(elements[3]) sources, errs3 = p.parseDefLookupSources("source", elements[4]) } // Combine any and all errors @@ -757,10 +757,10 @@ func (p *Parser) parseDefConditionalLookup(module file.Path, elements []sexp.SEx // Done return ast.NewDefLookup(handle, checked, - []ast.Expr{sourceSelector}, - [][]ast.Expr{sources}, - []ast.Expr{targetSelector}, - [][]ast.Expr{targets}), nil + []ast.TypedSymbol{sourceSelector}, + [][]ast.TypedSymbol{sources}, + []ast.TypedSymbol{targetSelector}, + [][]ast.TypedSymbol{targets}), nil } func (p *Parser) parseDefMultiLookup(module file.Path, elements []sexp.SExp) (ast.Declaration, []SyntaxError) { @@ -781,8 +781,8 @@ func (p *Parser) parseDefMultiLookup(module file.Path, elements []sexp.SExp) (as return nil, errors } // - targetSelectors := make([]ast.Expr, len(targets)) - sourceSelectors := make([]ast.Expr, len(sources)) + targetSelectors := make([]ast.TypedSymbol, len(targets)) + sourceSelectors := make([]ast.TypedSymbol, len(sources)) // Done return ast.NewDefLookup(handle, checked, sourceSelectors, sources, targetSelectors, targets), nil } @@ -844,7 +844,9 @@ func (p *Parser) parseLookupAttributes(list *sexp.List) (string, bool, []SyntaxE return handle, checked, errors } -func (p *Parser) parseDefLookupMultiSources(handle string, element sexp.SExp) (int, [][]ast.Expr, []SyntaxError) { +func (p *Parser) parseDefLookupMultiSources(handle string, element sexp.SExp) (int, [][]ast.TypedSymbol, + []SyntaxError) { + // var ( sexpTargets = element.AsList() errors []SyntaxError @@ -855,7 +857,7 @@ func (p *Parser) parseDefLookupMultiSources(handle string, element sexp.SExp) (i return width, nil, p.translator.SyntaxErrors(element, "malformed target columns") } // - targets := make([][]ast.Expr, sexpTargets.Len()) + targets := make([][]ast.TypedSymbol, sexpTargets.Len()) // Translate all target expressions for i := range sexpTargets.Len() { ith := sexpTargets.Get(i).AsList() @@ -875,25 +877,28 @@ func (p *Parser) parseDefLookupMultiSources(handle string, element sexp.SExp) (i return width, targets, errors } -func (p *Parser) parseDefLookupSources(handle string, element sexp.SExp) ([]ast.Expr, []SyntaxError) { +func (p *Parser) parseDefLookupSources(handle string, element sexp.SExp) ([]ast.TypedSymbol, []SyntaxError) { var ( sexpSources = element.AsList() errors []SyntaxError - sources []ast.Expr + sources []ast.TypedSymbol ) - // Check source Expressions + // Check source columns if sexpSources == nil { msg := fmt.Sprintf("malformed %s columns", handle) return nil, p.translator.SyntaxErrors(element, msg) } // - if len(errors) == 0 { - sources = make([]ast.Expr, sexpSources.Len()) - // - for i := 0; i != sexpSources.Len(); i++ { - var errs []SyntaxError - // Translate source expressions - sources[i], errs = p.translator.Translate(sexpSources.Get(i)) + sources = make([]ast.TypedSymbol, sexpSources.Len()) + // + for i := 0; i != sexpSources.Len(); i++ { + var errs []SyntaxError + // Sources must be column accesses, rather than arbitrary expressions. + if symbol := sexpSources.Get(i).AsSymbol(); symbol == nil { + msg := fmt.Sprintf("malformed %s column", handle) + errors = append(errors, *p.translator.SyntaxError(sexpSources.Get(i), msg)) + } else { + sources[i], errs = p.parseDefLookupSource(symbol) errors = append(errors, errs...) } } @@ -901,6 +906,30 @@ func (p *Parser) parseDefLookupSources(handle string, element sexp.SExp) ([]ast. return sources, errors } +// Parse the selector of a (conditional) lookup which, as for the sources / +// targets it gates, must be a column access rather than an arbitrary +// expression. +func (p *Parser) parseDefLookupSelector(element sexp.SExp) (ast.TypedSymbol, []SyntaxError) { + symbol := element.AsSymbol() + // + if symbol == nil { + return nil, p.translator.SyntaxErrors(element, "malformed selector") + } + // + return p.parseDefLookupSource(symbol) +} + +func (p *Parser) parseDefLookupSource(source *sexp.Symbol) (ast.TypedSymbol, []SyntaxError) { + if path, err := parseQualifiableName(source.Value); err != nil { + return nil, p.translator.SyntaxErrors(source, err.Error()) + } else { + varAccess := ast.NewVariableAccess(path, ast.NON_FUNCTION, nil) + p.mapSourceNode(source, varAccess) + + return varAccess, nil + } +} + // Parse a perspective declaration func (p *Parser) parseDefPerspective(module file.Path, elements []sexp.SExp) (ast.Declaration, []SyntaxError) { var ( diff --git a/pkg/corset/compiler/preprocessor.go b/pkg/corset/compiler/preprocessor.go index 5500505cd..fa7631ad5 100644 --- a/pkg/corset/compiler/preprocessor.go +++ b/pkg/corset/compiler/preprocessor.go @@ -86,7 +86,8 @@ func (p *preprocessor) preprocessDeclaration(decl ast.Declaration) []SyntaxError case *ast.DefInRange: errors = p.preprocessDefInRange(d) case *ast.DefLookup: - errors = p.preprocessDefLookup(d) + // Sources and targets are column accesses, hence there is nothing to + // preprocess (e.g. no invocations or reductions to expand). case *ast.DefPerspective: errors = p.preprocessDefPerspective(d) default: @@ -130,38 +131,6 @@ func (p *preprocessor) preprocessDefFun(decl *ast.DefFun) []SyntaxError { return errors } -// preprocess a "deflookup" declaration. -// -//nolint:staticcheck -func (p *preprocessor) preprocessDefLookup(decl *ast.DefLookup) []SyntaxError { - var ( - errors []SyntaxError - errs1, errs2 []SyntaxError - ) - // preprocess source expressions - for i := range decl.Sources { - if decl.SourceSelectors[i] != nil { - decl.SourceSelectors[i], errs1 = p.preprocessExpressionInModule(decl.SourceSelectors[i]) - errors = append(errors, errs1...) - } - - decl.Sources[i], errs2 = p.preprocessExpressionsInModule(decl.Sources[i]) - errors = append(errors, errs2...) - } - // preprocess all target expressions - for i := range decl.Targets { - if decl.TargetSelectors[i] != nil { - decl.TargetSelectors[i], errs1 = p.preprocessExpressionInModule(decl.TargetSelectors[i]) - errors = append(errors, errs1...) - } - - decl.Targets[i], errs2 = p.preprocessExpressionsInModule(decl.Targets[i]) - errors = append(errors, errs2...) - } - // Combine errors - return errors -} - // preprocess a "definrange" declaration. func (p *preprocessor) preprocessDefInRange(decl *ast.DefInRange) []SyntaxError { var errors []SyntaxError diff --git a/pkg/corset/compiler/resolver.go b/pkg/corset/compiler/resolver.go index 63085e3d4..bee47b53b 100644 --- a/pkg/corset/compiler/resolver.go +++ b/pkg/corset/compiler/resolver.go @@ -422,31 +422,76 @@ func (r *resolver) finaliseDefFunInModule(enclosing *ModuleScope, decl *ast.DefF return errors } -// Resolve those variables appearing in the body of this lookup constraint. +// Resolve the columns accessed by this lookup constraint. Observe that each +// source (and, likewise, each target) is resolved in its own scope, since each +// determines its own context. func (r *resolver) finaliseDefLookupInModule(enclosing Scope, decl *ast.DefLookup) []SyntaxError { var errors []SyntaxError - // Resolve source expressions + // Resolve source columns for i := range decl.Sources { - var ( - scope = NewLocalScope(enclosing, true, false, false) - errs = r.finaliseExpressionsInModule(scope, decl.Sources[i]) - ) - + errs := r.finaliseLookupColumnsInModule(enclosing, decl.SourceSelectors[i], decl.Sources[i]) errors = append(errors, errs...) } - // Resolve all target expressions + // Resolve all target columns for i := range decl.Targets { - var ( - scope = NewLocalScope(enclosing, true, false, false) - errs = r.finaliseExpressionsInModule(scope, decl.Targets[i]) - ) - + errs := r.finaliseLookupColumnsInModule(enclosing, decl.TargetSelectors[i], decl.Targets[i]) errors = append(errors, errs...) } // return errors } +// Resolve one side of a lookup constraint (i.e. a set of source or target +// columns, along with their optional selector) within a single scope. Sharing +// the scope ensures the columns (and selector) all reside in the same context. +func (r *resolver) finaliseLookupColumnsInModule(enclosing Scope, selector ast.TypedSymbol, + columns []ast.TypedSymbol) []SyntaxError { + // + var ( + errors []SyntaxError + scope = NewLocalScope(enclosing, true, false, false) + ) + // Resolve each column in turn + for _, column := range columns { + if column != nil { + errors = append(errors, r.finaliseLookupColumnInModule(scope, column)...) + } + } + // Resolve selector (when present). NOTE: the selector is resolved last so + // that, when its context conflicts with that of the columns it gates, the + // selector is the access reported as conflicting. + if selector != nil { + errors = append(errors, r.finaliseLookupColumnInModule(scope, selector)...) + } + // + return errors +} + +// Resolve a single column access arising within a lookup constraint. Unlike an +// arbitrary expression, this must resolve to a column (e.g. it cannot be a +// constant or a function parameter). +func (r *resolver) finaliseLookupColumnInModule(scope LocalScope, symbol ast.TypedSymbol) []SyntaxError { + var errors []SyntaxError + // Resolve the underlying access + switch s := symbol.(type) { + case *ast.ArrayAccess: + errors = r.finaliseArrayAccessInModule(scope, s) + case *ast.VariableAccess: + errors = r.finaliseVariableInModule(scope, s) + default: + return r.srcmap.SyntaxErrors(symbol, "invalid column access") + } + // Sanity check we ended up with a column, since nothing else can be looked + // up (e.g. a constant cannot). + if len(errors) == 0 { + if _, ok := symbol.Binding().(*ast.ColumnBinding); !ok { + return r.srcmap.SyntaxErrors(symbol, "expected column") + } + } + // + return errors +} + // Resolve a sequence of zero or more expressions within a given module. This // simply resolves each of the arguments in turn, collecting any errors arising. func (r *resolver) finaliseExpressionsInModule(scope LocalScope, args []ast.Expr) []SyntaxError { diff --git a/pkg/corset/compiler/translator.go b/pkg/corset/compiler/translator.go index 15e03d2ba..49f5c6e1c 100644 --- a/pkg/corset/compiler/translator.go +++ b/pkg/corset/compiler/translator.go @@ -329,13 +329,17 @@ func (t *translator) translateDefLookup(decl *ast.DefLookup) []SyntaxError { var ( errors []SyntaxError srcContext, tgtContext ast.Context - sources []lookup.Vector[word.BigEndian, hir.Term] - targets []lookup.Vector[word.BigEndian, hir.Term] + sources []lookup.Vector + targets []lookup.Vector + // Bitwidths of the registers making up each source / target vector. + srcWidths [][]uint + tgtWidths [][]uint ) // Translate sources for i, ith := range decl.Targets { - ith_targets, ctx, errs := t.translateDefLookupSources(decl.TargetSelectors[i], ith) + ith_targets, widths, ctx, errs := t.translateDefLookupSources(decl.TargetSelectors[i], ith) targets = append(targets, ith_targets) + tgtWidths = append(tgtWidths, widths) errors = append(errors, errs...) // if i == 0 { @@ -344,8 +348,9 @@ func (t *translator) translateDefLookup(decl *ast.DefLookup) []SyntaxError { } // Translate targets for i, ith := range decl.Sources { - ith_sources, ctx, errs := t.translateDefLookupSources(decl.SourceSelectors[i], ith) + ith_sources, widths, ctx, errs := t.translateDefLookupSources(decl.SourceSelectors[i], ith) sources = append(sources, ith_sources) + srcWidths = append(srcWidths, widths) errors = append(errors, errs...) // if i == 0 { @@ -355,7 +360,7 @@ func (t *translator) translateDefLookup(decl *ast.DefLookup) []SyntaxError { // Sanity check this is not an irregular lookup (since these are not // currently supported) and, if so, provide a useful error message. if len(errors) == 0 { - errors = t.checkForIrregularLookup(targets, sources, decl.Targets, decl.Sources) + errors = t.checkForIrregularLookup(tgtWidths, srcWidths, decl.Targets, decl.Sources) } // Sanity check whether we can construct the constraint, or not. if len(errors) == 0 { @@ -372,84 +377,114 @@ func (t *translator) translateDefLookup(decl *ast.DefLookup) []SyntaxError { return errors } -func (t *translator) translateDefLookupSources(selector ast.Expr, - sources []ast.Expr) (lookup.Vector[word.BigEndian, hir.Term], ast.Context, []SyntaxError) { +// translateDefLookupSources translates one side of a lookup (i.e. either its +// sources or its targets) into a corresponding lookup vector. Since a lookup +// vector is made up of registers, this also returns the bitwidth of each +// register in the vector (as needed for detecting irregular lookups). +func (t *translator) translateDefLookupSources(selector ast.TypedSymbol, + sources []ast.TypedSymbol) (lookup.Vector, []uint, ast.Context, []SyntaxError) { // Determine context of ith set of targets var ( - context, j = ast.ContextOfExpressions(sources...) - vector lookup.Vector[word.BigEndian, hir.Term] + context, j = ast.ContextOfSymbols(sources...) + sel *hir.RegisterAccess ) // Include selector (when present) if selector != nil { - context = context.Join(selector.Context()) + context = context.Join(ast.ContextOfSymbol(selector)) } - // Translate target expressions whilst again checking for a conflicting - // context. + // Translate target columns whilst again checking for a conflicting context. if context.IsConflicted() { - var source ast.Expr - // Determine offending source expression + var source ast.TypedSymbol + // Determine offending source column if j >= uint(len(sources)) { source = selector } else { source = sources[j] } // - return lookup.Vector[word.BigEndian, hir.Term]{}, context, t.srcmap.SyntaxErrors(source, "conflicting context") + return lookup.Vector{}, nil, context, t.srcmap.SyntaxErrors(source, "conflicting context") } // Determine enclosing module module := t.moduleOf(context) - // Translate source expressions - terms, errors := t.translateUnitExpressions(sources, module, 0) + // Translate source columns + accesses, errors := t.translateLookupColumns(sources) // handle selector if selector != nil { - s, errs := t.translateExpression(selector, module, 0) + s, errs := t.registerOfRegisterAccess(selector, 0) errors = append(errors, errs...) - - vector = lookup.FilteredVector(module.Id(), s, terms...) - } else { - vector = lookup.UnfilteredVector(module.Id(), terms...) + sel = s } // Sanity check vector if len(errors) == 0 { // NOTE: don't check vector if other errors, since we could have nil // entries in the vector, etc. - errors = append(errors, t.checkLookupVector(module.IsExtern(), vector, selector, sources)...) + errors = append(errors, t.checkLookupVector(sel, selector)...) + } + // Don't attempt to construct the vector if anything went wrong, since some + // of its registers may not have been translated. + if len(errors) > 0 { + return lookup.Vector{}, nil, context, errors } // - return vector, context, errors + registers, widths := registersOfAccesses(accesses) + // Done + if sel != nil { + return lookup.FilteredVector(module.Id(), sel.Register(), registers...), widths, context, errors + } + // + return lookup.UnfilteredVector(module.Id(), registers...), widths, context, errors } -func (t *translator) checkLookupVector(extern bool, vector lookup.Vector[word.BigEndian, hir.Term], selector ast.Expr, - terms []ast.Expr) []SyntaxError { - // +// translateLookupColumns translates the column accesses making up one side of a +// lookup into their corresponding register accesses. +func (t *translator) translateLookupColumns(columns []ast.TypedSymbol) ([]*hir.RegisterAccess, []SyntaxError) { var ( - errors []SyntaxError + errors []SyntaxError + accesses = make([]*hir.RegisterAccess, len(columns)) ) - // Look for any negative terms - for i, ith := range vector.Terms { - if extern && !isConstantRegister(ith) { - errors = append(errors, *t.srcmap.SyntaxError(terms[i], - "arbitrary term not permitted here (i.e. only 0, 1, or register for external module)")) - } - // Determine value range of ith term - valrange := ith.ValueRange() - // Determine bitwidth for that range - _, signed := valrange.BitWidth() - // Sanity check signed lookups - if signed { - errors = append(errors, *t.srcmap.SyntaxError(terms[i], "signed term encountered")) + // + for i, column := range columns { + if column == nil { + continue } + // + reg, errs := t.registerOfRegisterAccess(column, 0) + errors = append(errors, errs...) + accesses[i] = reg } + // + return accesses, errors +} + +// registersOfAccesses determines the registers underlying a given set of +// register accesses, along with the bitwidth of each. +func registersOfAccesses(accesses []*hir.RegisterAccess) ([]register.Id, []uint) { + var ( + registers = make([]register.Id, len(accesses)) + widths = make([]uint, len(accesses)) + ) + // + for i, access := range accesses { + valrange := access.ValueRange() + registers[i] = access.Register() + widths[i], _ = valrange.BitWidth() + } + // + return registers, widths +} + +// checkLookupVector sanity checks one side of a lookup. Since the registers +// making up a lookup vector are unsigned by construction, all that remains is +// to check the selector (when present) is binary. +func (t *translator) checkLookupVector(sel *hir.RegisterAccess, selector ast.TypedSymbol) []SyntaxError { + // + var errors []SyntaxError // Check selector is binary - if vector.HasSelector() { - // Determine value range of ith term - valrange := vector.Selector.Unwrap().ValueRange() + if sel != nil { + // Determine value range of the selector + valrange := sel.ValueRange() // Determine bitwidth for that range - bitwidth, signed := valrange.BitWidth() - // Check for signed selector - if signed { - errors = append(errors, *t.srcmap.SyntaxError(selector, "signed selector encountered")) - } + bitwidth, _ := valrange.BitWidth() // Check for non-binary selector if bitwidth > 1 { errors = append(errors, *t.srcmap.SyntaxError(selector, "non-binary selector encountered")) @@ -459,32 +494,18 @@ func (t *translator) checkLookupVector(extern bool, vector lookup.Vector[word.Bi return errors } -func isConstantRegister(term hir.Term) bool { - switch t := term.(type) { - case *hir.Constant: - val := t.Value.BigInt() - // Check whether valid constant - return val.IsUint64() && (val.Uint64() == 0 || val.Uint64() == 1) - case *hir.RegisterAccess: - return true - } - // - return false -} - // An irregular lookup is an awkward scenario where a source/target pairing does // not align properly. This scenario is not currently supported and, hence, a // suitable error message must be returned. For example, support a pairing of // u160 (source) into u256 (target) with a maximum register size of u160. Then, // the source will decompose into a single u160 limb, whilst the target will // decompose into a two u128 limbs. -func (t *translator) checkForIrregularLookup(targets []lookup.Vector[word.BigEndian, hir.Term], - sources []lookup.Vector[word.BigEndian, hir.Term], tgtTerms [][]ast.Expr, srcTerms [][]ast.Expr) []SyntaxError { +func (t *translator) checkForIrregularLookup(tgtWidths [][]uint, srcWidths [][]uint, + tgtTerms [][]ast.TypedSymbol, srcTerms [][]ast.TypedSymbol) []SyntaxError { + // var ( - n = len(sources[0].Terms) - srcWidths = t.determineLookupBitwidths(sources) - tgtWidths = t.determineLookupBitwidths(targets) - errors []SyntaxError + n = len(srcWidths[0]) + errors []SyntaxError ) // for i, ith := range srcWidths { @@ -506,26 +527,6 @@ func (t *translator) checkForIrregularLookup(targets []lookup.Vector[word.BigEnd return errors } -func (t *translator) determineLookupBitwidths(terms []lookup.Vector[word.BigEndian, hir.Term]) [][]uint { - var ( - bitwidths = make([][]uint, len(terms)) - ) - // - for i := range terms { - ith := make([]uint, len(terms[i].Terms)) - for j, jth := range terms[i].Terms { - // Determine value range of ith term - valrange := jth.ValueRange() - // Determine bitwidth for that range - ith[j], _ = valrange.BitWidth() - } - // - bitwidths[i] = ith - } - // - return bitwidths -} - func (t *translator) isIrregularLookup(srcWidth, tgtWidth uint) int { var ( srcLimbWidths = register.LimbWidths(t.config.Field.RegisterWidth, srcWidth) @@ -573,28 +574,6 @@ func (t *translator) translateDefInRange(decl *ast.DefInRange) []SyntaxError { return errors } -// Translate an optional expression in a given context. That is an expression -// which maybe nil (i.e. doesn't exist). In such case, nil is returned (i.e. -// without any errors). -func (t *translator) translateUnitExpressions(exprs []ast.Expr, module ModuleBuilder, - shift int) ([]hir.Term, []SyntaxError) { - // - errors := []SyntaxError{} - hirExprs := make([]hir.Term, len(exprs)) - // Iterate each expression in turn - for i, e := range exprs { - if e != nil { - var errs []SyntaxError - // - expr, errs := t.translateExpression(e, module, shift) - errors = append(errors, errs...) - hirExprs[i] = expr - } - } - // Done - return hirExprs, errors -} - // Translate a sequence of zero or more expressions enclosed in a given module. func (t *translator) translateExpressions(module ModuleBuilder, shift int, exprs ...ast.Expr) ([]hir.Term, []SyntaxError) { diff --git a/pkg/corset/compiler/typing.go b/pkg/corset/compiler/typing.go index 9c5404b89..ce94d291c 100644 --- a/pkg/corset/compiler/typing.go +++ b/pkg/corset/compiler/typing.go @@ -148,25 +148,19 @@ func (p *typeChecker) typeCheckDefFunInModule(decl *ast.DefFun) []SyntaxError { } // typeCheck a "deflookup" declaration. -// -//nolint:staticcheck func (p *typeChecker) typeCheckDefLookup(decl *ast.DefLookup) []SyntaxError { var ( errors []SyntaxError srcTypes []ast.Type dstTypes []ast.Type ) - // type check source expressions + // Determine source column types for i := range decl.Sources { - ts, errs := p.typeCheckExpressionsInModule(ast.UINT_TYPE, decl.Sources[i], true) - errors = append(errors, errs...) - srcTypes = ast.LeastUpperBounds(srcTypes, ts) + srcTypes = ast.LeastUpperBounds(srcTypes, typesOfLookupColumns(decl.Sources[i])) } - // type check all target expressions + // Determine target column types for i := range decl.Targets { - ts, errs := p.typeCheckExpressionsInModule(ast.UINT_TYPE, decl.Targets[i], true) - errors = append(errors, errs...) - dstTypes = ast.LeastUpperBounds(dstTypes, ts) + dstTypes = ast.LeastUpperBounds(dstTypes, typesOfLookupColumns(decl.Targets[i])) } // Check the types (if checking is enabled and no other upstream errors) if decl.Checked && len(srcTypes) == len(dstTypes) { @@ -182,6 +176,25 @@ func (p *typeChecker) typeCheckDefLookup(decl *ast.DefLookup) []SyntaxError { return errors } +// typesOfLookupColumns determines the type of each column on one side of a +// lookup. Since these are column accesses (rather than arbitrary expressions) +// their types are already known. As with expressions, nil is returned if any +// type is unknown, which indicates an upstream error (e.g. an unresolved +// symbol) has already been reported. +func typesOfLookupColumns(columns []ast.TypedSymbol) []ast.Type { + types := make([]ast.Type, len(columns)) + // + for i, column := range columns { + if column == nil || column.Type() == nil { + return nil + } + // + types[i] = column.Type() + } + // + return types +} + // typeCheck a "definrange" declaration. func (p *typeChecker) typeCheckDefInRange(decl *ast.DefInRange) []SyntaxError { // typeCheck constraint body diff --git a/pkg/ir/air/constraint.go b/pkg/ir/air/constraint.go index 34fd91860..c008dbd9c 100644 --- a/pkg/ir/air/constraint.go +++ b/pkg/ir/air/constraint.go @@ -35,7 +35,7 @@ import ( type ConstraintBound[F field.Element[F]] interface { schema.Constraint[F] - lookup.Constraint[F, *ColumnAccess[F]] | + lookup.Constraint[F] | ranged.Constraint[F, *ColumnAccess[F]] | vanishing.Constraint[F, LogicalTerm[F]] } @@ -55,10 +55,10 @@ func newAir[F field.Element[F], C ConstraintBound[F]](constraint C) Air[F, C] { } // NewLookupConstraint constructs a new AIR lookup constraint -func NewLookupConstraint[F field.Element[F]](handle string, targets []lookup.Vector[F, *ColumnAccess[F]], - sources []lookup.Vector[F, *ColumnAccess[F]]) LookupConstraint[F] { +func NewLookupConstraint[F field.Element[F]](handle string, targets []lookup.Vector, + sources []lookup.Vector) LookupConstraint[F] { // - return newAir(lookup.NewConstraint(handle, targets, sources)) + return newAir(lookup.NewConstraint[F](handle, targets, sources)) } // NewRangeConstraint constructs a new AIR range constraint diff --git a/pkg/ir/air/gadgets/bitwidth.go b/pkg/ir/air/gadgets/bitwidth.go index 0b6a75f84..19bb08b88 100644 --- a/pkg/ir/air/gadgets/bitwidth.go +++ b/pkg/ir/air/gadgets/bitwidth.go @@ -143,22 +143,15 @@ func (p *BitwidthGadget[F]) applyRecursiveBitwidthGadget(ref register.Ref, bitwi if !ok { mid = p.constructTypeProof(proofHandle, bitwidth) } - // Add lookup constraint for register into proof - sourceAccesses := []*air.ColumnAccess[F]{ - // Source Value - term.RawRegisterAccess[F, air.Term[F]](ref.Register(), reg.Width(), 0)} - // NOTE: 0th column always assumed to hold full value, with others + // Add lookup constraint for register into proof. NOTE: 0th register of the + // type proof always assumed to hold the full value, with others // representing limbs, etc. - targetAccesses := []*air.ColumnAccess[F]{ - // Target Value - term.RawRegisterAccess[F, air.Term[F]](register.NewId(0), bitwidth, 0)} - // - targets := []lookup.Vector[F, *air.ColumnAccess[F]]{ - lookup.UnfilteredVector(mid, targetAccesses...)} - sources := []lookup.Vector[F, *air.ColumnAccess[F]]{ - lookup.UnfilteredVector(mod.Id(), sourceAccesses...)} + var ( + targets = []lookup.Vector{lookup.UnfilteredVector(mid, register.NewId(0))} + sources = []lookup.Vector{lookup.UnfilteredVector(mod.Id(), ref.Register())} + ) // - mod.AddConstraint(air.NewLookupConstraint(lookupHandle, targets, sources)) + mod.AddConstraint(air.NewLookupConstraint[F](lookupHandle, targets, sources)) // Add column to assignment so its proof is included typeModule := p.schema.Module(mid) // diff --git a/pkg/ir/air/schema.go b/pkg/ir/air/schema.go index cdd4f6e61..5ed848115 100644 --- a/pkg/ir/air/schema.go +++ b/pkg/ir/air/schema.go @@ -65,7 +65,7 @@ type ( // LookupConstraint captures the essence of a lookup constraint at the AIR // level. At the AIR level, lookup constraints are only permitted between // columns (i.e. not arbitrary expressions). - LookupConstraint[F field.Element[F]] = Air[F, lookup.Constraint[F, *ColumnAccess[F]]] + LookupConstraint[F field.Element[F]] = Air[F, lookup.Constraint[F]] // RangeConstraint captures the essence of a range constraints at the AIR level. RangeConstraint[F field.Element[F]] = Air[F, ranged.Constraint[F, *ColumnAccess[F]]] // VanishingConstraint captures the essence of a vanishing constraint at the AIR level. diff --git a/pkg/ir/hir/constraint.go b/pkg/ir/hir/constraint.go index c9e2f0f8b..90ad7da88 100644 --- a/pkg/ir/hir/constraint.go +++ b/pkg/ir/hir/constraint.go @@ -40,10 +40,9 @@ func NewVanishingConstraint(handle string, ctx schema.ModuleId, domain util.Opti } // NewLookupConstraint creates a new lookup constraint with a given handle. -func NewLookupConstraint(handle string, targets []lookup.Vector[word.BigEndian, Term], - sources []lookup.Vector[word.BigEndian, Term]) Constraint { +func NewLookupConstraint(handle string, targets []lookup.Vector, sources []lookup.Vector) Constraint { // - return Constraint{lookup.NewConstraint(handle, targets, sources)} + return Constraint{lookup.NewConstraint[word.BigEndian](handle, targets, sources)} } // NewRangeConstraint constructs a new Range constraint diff --git a/pkg/ir/hir/encoding.go b/pkg/ir/hir/encoding.go index 98351343b..3b71e0bb4 100644 --- a/pkg/ir/hir/encoding.go +++ b/pkg/ir/hir/encoding.go @@ -23,6 +23,7 @@ import ( "github.com/LFDT-Lineth/zkc/pkg/ir/term" "github.com/LFDT-Lineth/zkc/pkg/schema" "github.com/LFDT-Lineth/zkc/pkg/schema/constraint/lookup" + "github.com/LFDT-Lineth/zkc/pkg/schema/register" "github.com/LFDT-Lineth/zkc/pkg/util" "github.com/LFDT-Lineth/zkc/pkg/util/word" ) @@ -103,11 +104,16 @@ func encode_lookup(c LookupConstraint) ([]byte, error) { return buffer.Bytes(), nil } -func encode_lookup_vector(vector lookup.Vector[word.BigEndian, Term], buffer *bytes.Buffer) error { +func encode_lookup_vector(vector lookup.Vector, buffer *bytes.Buffer) error { var ( gobEncoder = gob.NewEncoder(buffer) selector = vector.HasSelector() + registers = make([]uint, len(vector.Registers)) ) + // Unwrap registers making up this vector + for i, rid := range vector.Registers { + registers[i] = rid.Unwrap() + } // Source Context if err := gobEncoder.Encode(vector.Module); err != nil { return err @@ -118,12 +124,12 @@ func encode_lookup_vector(vector lookup.Vector[word.BigEndian, Term], buffer *by } // Selector itself (if applicable) if selector { - if err := encode_term[LogicalTerm, Term](vector.Selector.Unwrap(), buffer); err != nil { + if err := gobEncoder.Encode(vector.Selector.Unwrap().Unwrap()); err != nil { return err } } - // Source terms - return encode_nary(encode_term[LogicalTerm, Term], buffer, vector.Terms) + // Source registers + return gobEncoder.Encode(registers) } func encode_vanishing(c VanishingConstraint) ([]byte, error) { @@ -214,12 +220,13 @@ func decode_lookup(data []byte) (schema.Constraint[word.BigEndian], error) { return lookup, nil } -func decode_lookup_vector(buf *bytes.Buffer) (lookup.Vector[word.BigEndian, Term], error) { +func decode_lookup_vector(buf *bytes.Buffer) (lookup.Vector, error) { var ( gobDecoder = gob.NewDecoder(buf) - vector lookup.Vector[word.BigEndian, Term] + vector lookup.Vector hasSelector bool - selector Term + selector uint + registers []uint err error ) // Context @@ -232,16 +239,22 @@ func decode_lookup_vector(buf *bytes.Buffer) (lookup.Vector[word.BigEndian, Term } // Selector (if applicable) if hasSelector { - if selector, err = decode_term(buf); err != nil { + if err = gobDecoder.Decode(&selector); err != nil { return vector, err } // Wrap selector - vector.Selector = util.Some(selector) + vector.Selector = util.Some(register.NewId(selector)) } // Contents - if vector.Terms, err = decode_nary(decode_term, buf); err != nil { + if err = gobDecoder.Decode(®isters); err != nil { return vector, err } + // + vector.Registers = make([]register.Id, len(registers)) + // Wrap registers making up this vector + for i, rid := range registers { + vector.Registers[i] = register.NewId(rid) + } // Done return vector, nil } diff --git a/pkg/ir/hir/lower.go b/pkg/ir/hir/lower.go index c1ac1312e..041a84045 100644 --- a/pkg/ir/hir/lower.go +++ b/pkg/ir/hir/lower.go @@ -21,7 +21,6 @@ import ( "github.com/LFDT-Lineth/zkc/pkg/ir/assignment" "github.com/LFDT-Lineth/zkc/pkg/ir/mir" "github.com/LFDT-Lineth/zkc/pkg/ir/term" - "github.com/LFDT-Lineth/zkc/pkg/schema/constraint/lookup" "github.com/LFDT-Lineth/zkc/pkg/schema/register" "github.com/LFDT-Lineth/zkc/pkg/util" "github.com/LFDT-Lineth/zkc/pkg/util/field" @@ -154,54 +153,11 @@ func (p *MirLowering) lowerRangeConstraint(v RangeConstraint, module mirModuleBu mir.NewRangeConstraint(v.Handle, v.Context, term, v.Bitwidths)) } -// Lower a lookup constraint to the MIR level. Since lookup constraints at the -// MIR level can only access columns directly, we must expand the source -// expressions into computed columns with corresponding constraints. +// Lower a lookup constraint to the MIR level. Since lookup constraints are +// made up of registers (rather than arbitrary expressions) at both levels, the +// source and target vectors carry over unchanged. func (p *MirLowering) lowerLookupConstraint(c LookupConstraint, mirModule mirModuleBuilder) { - var ( - sources = make([]lookup.Vector[word.BigEndian, *mirRegisterAccess], len(c.Sources)) - targets = make([]lookup.Vector[word.BigEndian, *mirRegisterAccess], len(c.Targets)) - ) - // Lower sources - for i, ith := range c.Sources { - sources[i] = p.lowerLookupVector(ith) - } - // Lower targets - for i, ith := range c.Targets { - targets[i] = p.lowerLookupVector(ith) - } - // Add constraint - mirModule.AddConstraint(mir.NewLookupConstraint(c.Handle, targets, sources)) -} - -func (p *MirLowering) lowerLookupVector(vec lookup.Vector[word.BigEndian, Term], -) lookup.Vector[word.BigEndian, *mirRegisterAccess] { - var ( - module = p.mirSchema.Module(vec.Module) - terms = make([]*mirRegisterAccess, len(vec.Terms)) - selector util.Option[*mirRegisterAccess] - ) - // - if vec.HasSelector() { - sel := p.expandTerm(vec.Selector.Unwrap(), module) - selector = util.Some(sel) - } - // - for i, e := range vec.Terms { - // Check for unsafe operation (e.g. cast) - var ( - unsafe = selector.HasValue() && term.IsUnsafeExpr[word.BigEndian, LogicalTerm, Term](e) - expr = e - ) - // - if unsafe { - expr = term.Product(vec.Selector.Unwrap(), expr) - } - // - terms[i] = p.expandTerm(expr, module) - } - // - return lookup.NewVector(vec.Module, selector, terms...) + mirModule.AddConstraint(mir.NewLookupConstraint[word.BigEndian](c.Handle, c.Targets, c.Sources)) } func (p *MirLowering) lowerLogical(e LogicalTerm, module mirModuleBuilder) mirLogicalTerm { diff --git a/pkg/ir/hir/schema.go b/pkg/ir/hir/schema.go index fa612abc1..650cf179a 100644 --- a/pkg/ir/hir/schema.go +++ b/pkg/ir/hir/schema.go @@ -47,7 +47,7 @@ type ( type ( // LookupConstraint captures the essence of a lookup constraint at the HIR // level. - LookupConstraint = lookup.Constraint[word.BigEndian, Term] + LookupConstraint = lookup.Constraint[word.BigEndian] // RangeConstraint captures the essence of a range constraints at the HIR level. RangeConstraint = ranged.Constraint[word.BigEndian, Term] // VanishingConstraint captures the essence of a vanishing constraint at the HIR diff --git a/pkg/ir/mir/concretize.go b/pkg/ir/mir/concretize.go index 2f8baadc5..40e07a17a 100644 --- a/pkg/ir/mir/concretize.go +++ b/pkg/ir/mir/concretize.go @@ -19,9 +19,7 @@ import ( "github.com/LFDT-Lineth/zkc/pkg/ir/assignment" "github.com/LFDT-Lineth/zkc/pkg/ir/term" "github.com/LFDT-Lineth/zkc/pkg/schema" - "github.com/LFDT-Lineth/zkc/pkg/schema/constraint/lookup" "github.com/LFDT-Lineth/zkc/pkg/schema/module" - "github.com/LFDT-Lineth/zkc/pkg/util" "github.com/LFDT-Lineth/zkc/pkg/util/field" ) @@ -118,10 +116,9 @@ func concretizeConstraint[F1 Element[F1], F2 Element[F2]](constraint Constraint[ // switch c := constraint.Unwrap().(type) { case LookupConstraint[F1]: - targets := concretizeLookupVectors[F1, F2](c.Targets) - sources := concretizeLookupVectors[F1, F2](c.Sources) - // - return NewLookupConstraint(c.Handle, targets, sources) + // NOTE: lookup vectors are made up of registers and, hence, are + // independent of the underlying field. + return NewLookupConstraint[F2](c.Handle, c.Targets, c.Sources) case RangeConstraint[F1]: var terms = concretizeRegisterAccesses[F1, F2](c.Sources) // @@ -135,29 +132,6 @@ func concretizeConstraint[F1 Element[F1], F2 Element[F2]](constraint Constraint[ } } -func concretizeLookupVectors[F1 Element[F1], F2 Element[F2]](vecs []LookupVector[F1]) []LookupVector[F2] { - var nvecs = make([]LookupVector[F2], len(vecs)) - // - for i, vec := range vecs { - nvecs[i] = concretizeLookupVector[F1, F2](vec) - } - // - return nvecs -} - -func concretizeLookupVector[F1 Element[F1], F2 Element[F2]](vec LookupVector[F1]) LookupVector[F2] { - var ( - sources = concretizeRegisterAccesses[F1, F2](vec.Terms) - selector util.Option[*RegisterAccess[F2]] = util.None[*RegisterAccess[F2]]() - ) - // - if vec.Selector.HasValue() { - selector = util.Some(concretizeRegisterAccess[F1, F2](vec.Selector.Unwrap())) - } - // - return lookup.NewVector(vec.Module, selector, sources...) -} - // ============================================================================ // LogicalTerms // ============================================================================ diff --git a/pkg/ir/mir/constraint.go b/pkg/ir/mir/constraint.go index 854572559..6c2d09f71 100644 --- a/pkg/ir/mir/constraint.go +++ b/pkg/ir/mir/constraint.go @@ -40,10 +40,10 @@ func NewVanishingConstraint[F field.Element[F]](handle string, ctx schema.Module } // NewLookupConstraint creates a new lookup constraint with a given handle. -func NewLookupConstraint[F field.Element[F]](handle string, targets []LookupVector[F], - sources []LookupVector[F]) Constraint[F] { +func NewLookupConstraint[F field.Element[F]](handle string, targets []LookupVector, + sources []LookupVector) Constraint[F] { // - return Constraint[F]{lookup.NewConstraint(handle, targets, sources)} + return Constraint[F]{lookup.NewConstraint[F](handle, targets, sources)} } // NewRangeConstraint constructs a new Range constraint diff --git a/pkg/ir/mir/lower.go b/pkg/ir/mir/lower.go index a3b8770b2..de6a3f798 100644 --- a/pkg/ir/mir/lower.go +++ b/pkg/ir/mir/lower.go @@ -23,7 +23,6 @@ import ( air_gadgets "github.com/LFDT-Lineth/zkc/pkg/ir/air/gadgets" "github.com/LFDT-Lineth/zkc/pkg/ir/term" "github.com/LFDT-Lineth/zkc/pkg/schema" - "github.com/LFDT-Lineth/zkc/pkg/schema/constraint/lookup" "github.com/LFDT-Lineth/zkc/pkg/schema/register" "github.com/LFDT-Lineth/zkc/pkg/util" "github.com/LFDT-Lineth/zkc/pkg/util/collection/array" @@ -192,54 +191,11 @@ func (p *AirLowering[F]) lowerRangeConstraintToAir(v RangeConstraint[F], airModu } } -// Lower a lookup constraint to the AIR level. The challenge here is that -// lookup constraints at the AIR level cannot use arbitrary expressions; rather, -// they can only access columns directly. Therefore, whenever a general -// expression is encountered, we must generate a computed column to hold the -// value of that expression, along with appropriate constraints to enforce the -// expected value. +// Lower a lookup constraint to the AIR level. Since lookup constraints are +// made up of registers (rather than arbitrary expressions) at both levels, the +// source and target vectors carry over unchanged. func (p *AirLowering[F]) lowerLookupConstraintToAir(c LookupConstraint[F], airModule air.ModuleBuilder[F]) { - var ( - sources = make([]lookup.Vector[F, *air.ColumnAccess[F]], len(c.Sources)) - targets = make([]lookup.Vector[F, *air.ColumnAccess[F]], len(c.Targets)) - ) - // Lower sources - for i, ith := range c.Sources { - sources[i] = p.expandLookupVectorToAir(ith) - } - // Lower targets - for i, ith := range c.Targets { - targets[i] = p.expandLookupVectorToAir(ith) - } - // Add constraint - airModule.AddConstraint(air.NewLookupConstraint(c.Handle, targets, sources)) -} - -func (p *AirLowering[F]) expandLookupVectorToAir(vector LookupVector[F], -) lookup.Vector[F, *air.ColumnAccess[F]] { - var ( - terms = p.lowerRegisterAccesses(vector.Terms...) - selector util.Option[*air.ColumnAccess[F]] - ) - // - if vector.HasSelector() { - sel := p.lowerRegisterAccesses(vector.Selector.Unwrap())[0] - selector = util.Some(sel) - } - // - return lookup.NewVector(vector.Module, selector, terms...) -} - -func (p *AirLowering[F]) lowerRegisterAccesses(terms ...*RegisterAccess[F]) []*air.ColumnAccess[F] { - var nterms = make([]*air.ColumnAccess[F], len(terms)) - // - for i, ith := range terms { - ith_term := term.RawRegisterAccess[F, air.Term[F]](ith.Register(), ith.BitWidth(), ith.RelativeShift()) - // Apply any mask - nterms[i] = ith_term.Mask(ith.MaskWidth()) - } - // - return nterms + airModule.AddConstraint(air.NewLookupConstraint[F](c.Handle, c.Targets, c.Sources)) } func (p *AirLowering[F]) lowerAndSimplifyLogicalTo(term LogicalTerm[F], diff --git a/pkg/ir/mir/schema.go b/pkg/ir/mir/schema.go index 463e924ef..f130d39a4 100644 --- a/pkg/ir/mir/schema.go +++ b/pkg/ir/mir/schema.go @@ -55,9 +55,9 @@ type ( type ( // LookupConstraint captures the essence of a lookup constraint at the MIR // level. - LookupConstraint[F field.Element[F]] = lookup.Constraint[F, *RegisterAccess[F]] + LookupConstraint[F field.Element[F]] = lookup.Constraint[F] // LookupVector provides a convenient shorthand - LookupVector[F field.Element[F]] = lookup.Vector[F, *RegisterAccess[F]] + LookupVector = lookup.Vector // RangeConstraint captures the essence of a range constraints at the MIR level. RangeConstraint[F field.Element[F]] = ranged.Constraint[F, *RegisterAccess[F]] // VanishingConstraint captures the essence of a vanishing constraint at the MIR diff --git a/pkg/ir/mir/subdivide.go b/pkg/ir/mir/subdivide.go index bc7c557e8..d9c2e4c87 100644 --- a/pkg/ir/mir/subdivide.go +++ b/pkg/ir/mir/subdivide.go @@ -314,21 +314,6 @@ func subdivideVectorAccess[F field.Element[F]](expr *VectorAccess[F], mapping re return term.RawVectorAccess(terms) } -func subdivideRawRegisterAccesses[F field.Element[F]](terms []*RegisterAccess[F], mapping register.LimbsMap, -) []*VectorAccess[F] { - // - var ( - vecs = make([]*VectorAccess[F], len(terms)) - ) - // - for i, t := range terms { - ith := subdivideRawRegisterAccess(t, mapping) - vecs[i] = term.RawVectorAccess(ith) - } - // - return vecs -} - func subdivideRawRegisterAccess[F field.Element[F]](expr *RegisterAccess[F], mapping register.LimbsMap, ) []*RegisterAccess[F] { // diff --git a/pkg/ir/mir/subdivide_lookup.go b/pkg/ir/mir/subdivide_lookup.go index 5c295ce30..b6ac44389 100644 --- a/pkg/ir/mir/subdivide_lookup.go +++ b/pkg/ir/mir/subdivide_lookup.go @@ -15,12 +15,25 @@ package mir import ( "fmt" - "github.com/LFDT-Lineth/zkc/pkg/ir/term" "github.com/LFDT-Lineth/zkc/pkg/schema/constraint/lookup" "github.com/LFDT-Lineth/zkc/pkg/schema/module" + "github.com/LFDT-Lineth/zkc/pkg/schema/register" "github.com/LFDT-Lineth/zkc/pkg/util" ) +// mappedVector is an intermediate form of a lookup vector, where every register +// has been mapped into the limbs it was divided into (but where those limbs +// have not yet been split out into individual source/target pairings). +type mappedVector struct { + // Module in which all limbs are located. + module module.Id + // Selector for this vector (optional). Observe that a selector is never + // divided into more than one limb. + selector util.Option[register.Id] + // Limbs making up each register of the original vector. + limbs [][]register.LimbId +} + // Subdivide implementation for the FieldAgnostic interface. func (p *Subdivider[F]) subdivideLookup(c LookupConstraint[F]) LookupConstraint[F] { var ( @@ -35,7 +48,7 @@ func (p *Subdivider[F]) subdivideLookup(c LookupConstraint[F]) LookupConstraint[ targets := p.splitLookupVectors(geometry, vTargets) sources := p.splitLookupVectors(geometry, vSources) // - return lookup.NewConstraint(c.Handle, targets, sources) + return lookup.NewConstraint[F](c.Handle, targets, sources) } // Mapping lookup vectors essentially means applying the limb mapping to all @@ -45,73 +58,66 @@ func (p *Subdivider[F]) subdivideLookup(c LookupConstraint[F]) LookupConstraint[ // create more source/target pairings. Rather, it splits registers within the // existing pairings only. Later stages will subdivide and pad the // source/target pairings as necessary. -func (p *Subdivider[F]) mapLookupVectors(vectors []lookup.Vector[F, *RegisterAccess[F]], -) []lookup.Vector[F, *VectorAccess[F]] { +func (p *Subdivider[F]) mapLookupVectors(vectors []lookup.Vector) []mappedVector { // - var nterms = make([]lookup.Vector[F, *VectorAccess[F]], len(vectors)) + var nvectors = make([]mappedVector, len(vectors)) // for i, vector := range vectors { var ( modmap = p.mapping.Module(vector.Module) - terms = subdivideRawRegisterAccesses(vector.Terms, modmap) - selector = util.None[*VectorAccess[F]]() + limbs = make([][]register.LimbId, len(vector.Registers)) + selector = util.None[register.Id]() ) + // Split registers + for j, rid := range vector.Registers { + limbs[j] = limbsOfRegister(rid, modmap) + } // Split selector if vector.Selector.HasValue() { - split := subdivideRawRegisterAccess(vector.Selector.Unwrap(), modmap) - selector = util.Some(term.RawVectorAccess(split)) + split := limbsOfRegister(vector.Selector.Unwrap(), modmap) + // Sanity check + if len(split) != 1 { + panic("non-atomic selector encountered") + } + // + selector = util.Some(split[0]) } // Done - nterms[i] = lookup.NewVector(vector.Module, selector, terms...) + nvectors[i] = mappedVector{vector.Module, selector, limbs} } // - return nterms + return nvectors } // Splitting lookup vectors means splitting source/target pairings into one or -// more terms. For example, consider the lookup "lookup (X'1::X'0) (Y)" where -// X'1, X'0, and Y are all u16. The geometry of this lookup is [u32]. Assume a -// field bandwidth which cannot hold a u32 without overflow. Then, after -// splitting, we would expect "lookup (X'0, X'1) (Y, 0)". Here, the geometry has -// now changed to [u16,u16] to accommodate the field bandwidth. Furthermore, -// notice padding has been applied to ensure we have a matching number of -// columns on the left- and right-hand sides. -func (p *Subdivider[F]) splitLookupVectors(geometry lookup.Geometry, vectors []lookup.Vector[F, *VectorAccess[F]], -) []lookup.Vector[F, *RegisterAccess[F]] { +// more registers. For example, consider the lookup "lookup (X'1::X'0) (Y)" +// where X'1, X'0, and Y are all u16. The geometry of this lookup is [u32]. +// Assume a field bandwidth which cannot hold a u32 without overflow. Then, +// after splitting, we would expect "lookup (X'0, X'1) (Y, 0)". Here, the +// geometry has now changed to [u16,u16] to accommodate the field bandwidth. +// Furthermore, notice padding has been applied to ensure we have a matching +// number of columns on the left- and right-hand sides. +func (p *Subdivider[F]) splitLookupVectors(geometry lookup.Geometry, vectors []mappedVector) []lookup.Vector { // - var nterms = make([]lookup.Vector[F, *RegisterAccess[F]], len(vectors)) + var nvectors = make([]lookup.Vector, len(vectors)) // for i, vector := range vectors { - nterms[i] = p.splitLookupVector(geometry, vector) + nvectors[i] = p.splitLookupVector(geometry, vector) } // - return nterms + return nvectors } -func (p *Subdivider[F]) splitLookupVector(geometry lookup.Geometry, vector lookup.Vector[F, *VectorAccess[F]], -) lookup.Vector[F, *RegisterAccess[F]] { +func (p *Subdivider[F]) splitLookupVector(geometry lookup.Geometry, vector mappedVector) lookup.Vector { // - var ( - limbs []*RegisterAccess[F] - selector util.Option[*RegisterAccess[F]] - ) - // Translate selector - if vector.Selector.HasValue() { - sel := vector.Selector.Unwrap() - // Sanity check - if len(sel.Vars) != 1 { - panic("non-atomic selector encountered") - } - // Easy - selector = util.Some(sel.Vars[0]) - } + var limbs []register.LimbId // Check alignment - for i, ith := range vector.Terms { + for i, ith := range vector.limbs { // Pad & flatten - limbs = append(limbs, p.padLookupLimb(uint(i), ith, geometry, vector.Module)...) + limbs = append(limbs, p.padLookupLimb(uint(i), ith, geometry, vector.module)...) } // Done - return lookup.NewVector(vector.Module, selector, limbs...) + return lookup.NewVector(vector.module, vector.selector, limbs...) } // Padding is about ensuring a matching number of columns for each source/target @@ -160,21 +166,22 @@ func (p *Subdivider[F]) splitLookupVector(geometry lookup.Geometry, vector looku // // NOTE: For now, this function only checks that limbs are aligned and panics // otherwise. -func (p *Subdivider[F]) padLookupLimb(i uint, vec *VectorAccess[F], geometry lookup.Geometry, - mid module.Id) []*RegisterAccess[F] { +func (p *Subdivider[F]) padLookupLimb(i uint, limbs []register.LimbId, geometry lookup.Geometry, + mid module.Id) []register.LimbId { // var ( + modmap = p.mapping.Module(mid) widths = geometry.LimbWidths(i) // Determine expected geometry (i.e. number of columns) at this // position. n = len(widths) - m = len(vec.Vars) - 1 - // Append available terms - nterms = vec.Vars + m = len(limbs) - 1 + // Append available limbs + nlimbs = limbs ) // Sanity check - for i, t := range vec.Vars { - bitwidth := t.MaskWidth() + for i, limb := range limbs { + bitwidth := modmap.Limb(limb).Width() // Sanity check for irregular lookups if i != n && bitwidth > widths[i] { panic(fmt.Sprintf("irregular lookup detected (u%d v u%d)", bitwidth, widths[i])) @@ -184,12 +191,35 @@ func (p *Subdivider[F]) padLookupLimb(i uint, vec *VectorAccess[F], geometry loo } // Pad out with zeros to match geometry //nolint - for m := n - len(vec.Vars); m > 0; m-- { + for m := n - len(limbs); m > 0; m-- { // Get access to a constant zero register zero := p.ZeroRegister(mid) // Pad out the vector - nterms = append(nterms, term.RawRegisterAccess[F, Term[F]](zero, 0, 0)) + nlimbs = append(nlimbs, zero) + } + // + return nlimbs +} + +// limbsOfRegister determines the limbs into which a given register was divided. +// Observe that any limbs which lie beyond the register's bitwidth are dropped, +// though at least one limb is always retained (as needed for registers whose +// bitwidth is zero, such as constant registers). +func limbsOfRegister(rid register.Id, mapping register.LimbsMap) []register.LimbId { + var ( + bitwidth = mapping.Register(rid).Width() + limbs []register.LimbId + ) + // + for i, limbId := range mapping.LimbIds(rid) { + limbWidth := min(bitwidth, mapping.Limb(limbId).Width()) + // + if limbWidth > 0 || i == 0 { + limbs = append(limbs, limbId) + } + // + bitwidth -= limbWidth } // - return nterms + return limbs } diff --git a/pkg/schema/constraint/lookup/constraint.go b/pkg/schema/constraint/lookup/constraint.go index d8c79544e..03ce5a5f6 100644 --- a/pkg/schema/constraint/lookup/constraint.go +++ b/pkg/schema/constraint/lookup/constraint.go @@ -16,9 +16,7 @@ import ( "fmt" "slices" - "github.com/LFDT-Lineth/zkc/pkg/ir/term" "github.com/LFDT-Lineth/zkc/pkg/schema" - "github.com/LFDT-Lineth/zkc/pkg/schema/constraint" "github.com/LFDT-Lineth/zkc/pkg/trace" "github.com/LFDT-Lineth/zkc/pkg/util" "github.com/LFDT-Lineth/zkc/pkg/util/collection/bit" @@ -42,23 +40,20 @@ import ( // pairs (and perhaps other constraints to ensure the required relationship) and // the source module is just checking that a given set of input/output pairs // makes sense. -type Constraint[F field.Element[F], E term.Evaluable[F]] struct { +type Constraint[F field.Element[F]] struct { // Handle returns the handle for this lookup constraint which is simply an // identifier useful when debugging (i.e. to know which lookup failed, etc). Handle string - // Targets returns the target expressions which are used to lookup into the - // target expressions. NOTE: the first element here is *always* the target - // selector. - Targets []Vector[F, E] - // Sources returns the source expressions which are used to lookup into the - // target expressions. NOTE: the first element here is *always* the source - // selector. - Sources []Vector[F, E] + // Targets returns the target registers which are used to lookup into the + // target registers. + Targets []Vector + // Sources returns the source registers which are used to lookup into the + // target registers. + Sources []Vector } // NewConstraint creates a new lookup constraint with a given handle. -func NewConstraint[F field.Element[F], E term.Evaluable[F]](handle string, targets []Vector[F, E], - sources []Vector[F, E]) Constraint[F, E] { +func NewConstraint[F field.Element[F]](handle string, targets []Vector, sources []Vector) Constraint[F] { var width uint // Check sources for i, ith := range sources { @@ -75,7 +70,7 @@ func NewConstraint[F field.Element[F], E term.Evaluable[F]](handle string, targe } } - return Constraint[F, E]{Handle: handle, + return Constraint[F]{Handle: handle, Targets: targets, Sources: sources, } @@ -84,13 +79,13 @@ func NewConstraint[F field.Element[F], E term.Evaluable[F]](handle string, targe // Consistent applies a number of internal consistency checks. Whilst not // strictly necessary, these can highlight otherwise hidden problems as an aid // to debugging. -func (p Constraint[F, E]) Consistent(_ schema.AnySchema[F]) []error { +func (p Constraint[F]) Consistent(_ schema.AnySchema[F]) []error { return nil } // Name returns a unique name for a given constraint. This is useful // purely for identifying constraints in reports, etc. -func (p Constraint[F, E]) Name() string { +func (p Constraint[F]) Name() string { return p.Handle } @@ -99,7 +94,7 @@ func (p Constraint[F, E]) Name() string { // evaluation context, though some (e.g. lookups) have more. Note that all // constraints have at least one context (which we can call the "primary" // context). -func (p Constraint[F, E]) Contexts() []schema.ModuleId { +func (p Constraint[F]) Contexts() []schema.ModuleId { var contexts []schema.ModuleId // source contexts for _, source := range p.Sources { @@ -114,44 +109,27 @@ func (p Constraint[F, E]) Contexts() []schema.ModuleId { } // Bounds determines the well-definedness bounds for this constraint for both -// the negative (left) or positive (right) directions. For example, consider an -// expression such as "(shift X -1)". This is technically undefined for the -// first row of any trace and, by association, any constraint evaluating this -// expression on that first row is also undefined (and hence must pass). +// the negative (left) or positive (right) directions. Since a lookup is made +// up of registers (rather than arbitrary expressions), it is always well +// defined on every row. // //nolint:revive -func (p Constraint[F, E]) Bounds(module uint) util.Bounds { - var bound util.Bounds - // sources - for _, ith := range p.Sources { - eth := ith.Bounds(module) - bound.Union(ð) - } - // targets - for _, ith := range p.Targets { - eth := ith.Bounds(module) - bound.Union(ð) - } - // - return bound +func (p Constraint[F]) Bounds(module uint) util.Bounds { + return util.EMPTY_BOUND } // Accepts checks whether a lookup constraint into the target columns holds for // all rows of the source columns. // //nolint:revive -func (p Constraint[F, E]) Accepts(tr trace.Trace[F], sc schema.AnySchema[F]) (bit.Set, schema.Failure) { +func (p Constraint[F]) Accepts(tr trace.Trace[F], sc schema.AnySchema[F]) (bit.Set, schema.Failure) { var ( coverage bit.Set - st State[F, E] - err schema.Failure + // Insert all active target vectors + st = p.insertTargetVectors(tr, sc) ) - // Insert all active target vectors - if st, err = p.insertTargetVectors(tr, sc); err != nil { - return coverage, err - } // Check against all active source vectors - if err = st.checkSourceVectors(p.Sources, tr, sc); err != nil { + if err := st.checkSourceVectors(p.Sources, tr); err != nil { return coverage, err } // @@ -162,18 +140,18 @@ func (p Constraint[F, E]) Accepts(tr trace.Trace[F], sc schema.AnySchema[F]) (bi // so it can be printed. // //nolint:revive -func (p Constraint[F, E]) Lisp(mapping schema.AnySchema[F]) sexp.SExp { +func (p Constraint[F]) Lisp(mapping schema.AnySchema[F]) sexp.SExp { var ( sources = sexp.EmptyList() targets = sexp.EmptyList() ) - // Iterate source expressions + // Iterate source registers for _, ith := range p.Sources { - sources.Append(ith.Lisp(mapping)) + sources.Append(ith.Lisp(mapping.Module(ith.Module))) } - // Iterate target expressions + // Iterate target registers for _, ith := range p.Targets { - targets.Append(ith.Lisp(mapping)) + targets.Append(ith.Lisp(mapping.Module(ith.Module))) } // Done return sexp.NewList([]sexp.SExp{ @@ -184,23 +162,16 @@ func (p Constraint[F, E]) Lisp(mapping schema.AnySchema[F]) sexp.SExp { }) } -// Substitute any matchined labelled constants within this constraint -func (p Constraint[F, E]) Substitute(mapping map[string]F) { - // Sources - for _, ith := range p.Sources { - ith.Substitute(mapping) - } - // Targets - for _, ith := range p.Targets { - ith.Substitute(mapping) - } +// Substitute any matchined labelled constants within this constraint. Since a +// lookup is made up of registers (rather than arbitrary expressions), there is +// nothing to substitute. +func (p Constraint[F]) Substitute(mapping map[string]F) { + } -func (p *Constraint[F, E]) insertTargetVectors(tr trace.Trace[F], sc schema.AnySchema[F]) ( - State[F, E], schema.Failure) { - // +func (p *Constraint[F]) insertTargetVectors(tr trace.Trace[F], sc schema.AnySchema[F]) State[F] { var ( - st State[F, E] + st State[F] // Determine width (in columns) of this lookup width uint = p.Sources[0].Len() ) @@ -219,27 +190,23 @@ func (p *Constraint[F, E]) insertTargetVectors(tr trace.Trace[F], sc schema.AnyS if scModule.IsStatic() { st.insertStaticTarget(scModule) } else if target.HasSelector() { - // unfiltered + // filtered for i := range int(height) { - if err := st.insertFilteredVector(i, target, trModule, scModule); err != nil { - return st, err - } + st.insertFilteredVector(i, target, trModule) } } else { // unfiltered for i := range int(height) { - if err := st.insertTargetVector(i, target, trModule, scModule); err != nil { - return st, err - } + st.insertTargetVector(i, target, trModule) } } } // - return st, nil + return st } // State is just bringing somethings together to make life simpler -type State[F field.Element[F], E term.Evaluable[F]] struct { +type State[F field.Element[F]] struct { handle string // Set of target rows rows *hash.Set[hash.Array[F]] @@ -247,27 +214,25 @@ type State[F field.Element[F], E term.Evaluable[F]] struct { buffer []F } -func (p *State[F, E]) checkSourceVectors(sources []Vector[F, E], tr trace.Trace[F], sc schema.AnySchema[F], -) schema.Failure { +func (p *State[F]) checkSourceVectors(sources []Vector, tr trace.Trace[F]) schema.Failure { // Choose optimised loop for _, source := range sources { var ( trModule = tr.Module(source.Module) - scModule = sc.Module(source.Module) height = trModule.Height() ) // if source.HasSelector() { // filtered for i := range int(height) { - if err := p.checkFilteredSourceVector(i, source, trModule, scModule); err != nil { + if err := p.checkFilteredSourceVector(i, source, trModule); err != nil { return err } } } else { // unfiltered for i := range int(height) { - if err := p.checkSourceVector(i, source, trModule, scModule); err != nil { + if err := p.checkSourceVector(i, source, trModule); err != nil { return err } } @@ -277,49 +242,25 @@ func (p *State[F, E]) checkSourceVectors(sources []Vector[F, E], tr trace.Trace[ return nil } -func (p *State[F, E]) insertFilteredVector(k int, vec Vector[F, E], trMod trace.Module[F], scMod schema.Module[F], -) schema.Failure { - // If no selector, then always selected - var selected bool = !vec.HasSelector() - // - if vec.HasSelector() { - // Otherwise, check whether selector enabled (or not). - var ( - selector = vec.Selector.Unwrap() - ith, err = selector.EvalAt(k, trMod, scMod) - ) - // - if err != nil { - return constraint.NewInternalFailure[F](p.handle, vec.Module, uint(k), vec.Selector.Unwrap(), err.Error()) - } - // Selected when non-zero - selected = !ith.IsZero() - } +func (p *State[F]) insertFilteredVector(k int, vec Vector, trMod trace.Module[F]) { // If row selected, then insert contents! - if selected { - return p.insertTargetVector(k, vec, trMod, scMod) + if isSelected(k, vec, trMod) { + p.insertTargetVector(k, vec, trMod) } - // - return nil } -func (p *State[F, E]) insertTargetVector(k int, vec Vector[F, E], trModule trace.Module[F], - scModule schema.Module[F]) schema.Failure { - // Check each source is included - if err := p.evalExprsArray(k, vec, trModule, scModule); err != nil { - return err - } +func (p *State[F]) insertTargetVector(k int, vec Vector, trModule trace.Module[F]) { + // Read each register of this vector + p.readRegisters(k, vec, trModule) // Insert item whilst checking whether the buffer was consumed or not if !p.rows.Insert(hash.NewArray(p.buffer)) { // Yes, buffer consumed. Therefore, construct fresh buffer to avoid // aliasing the value now stored in the hash set. p.buffer = slices.Clone(p.buffer) } - // - return nil } -func (p *State[F, E]) insertStaticTarget(scModule schema.Module[F]) { +func (p *State[F]) insertStaticTarget(scModule schema.Module[F]) { var ( contents = scModule.StaticContents() ) @@ -329,63 +270,43 @@ func (p *State[F, E]) insertStaticTarget(scModule schema.Module[F]) { } } -func (p *State[F, E]) checkFilteredSourceVector(k int, vec Vector[F, E], trModule trace.Module[F], - scModule schema.Module[F]) schema.Failure { - // If no selector, then always selected - var selected bool = !vec.HasSelector() - // - if vec.HasSelector() { - // Otherwise, check whether selector enabled (or not). - var ( - selector = vec.Selector.Unwrap() - ith, err = selector.EvalAt(k, trModule, scModule) - ) - // - if err != nil { - return constraint.NewInternalFailure[F](p.handle, vec.Module, uint(k), vec.Selector.Unwrap(), err.Error()) - } - // Selected when non-zero - selected = !ith.IsZero() - } +func (p *State[F]) checkFilteredSourceVector(k int, vec Vector, trModule trace.Module[F]) schema.Failure { // If row selected, then check contents! - if selected { - return p.checkSourceVector(k, vec, trModule, scModule) + if isSelected(k, vec, trModule) { + return p.checkSourceVector(k, vec, trModule) } // return nil } -func (p *State[F, E]) checkSourceVector(k int, vec Vector[F, E], trModule trace.Module[F], scModule schema.Module[F], -) schema.Failure { - // Check each source is included - if err := p.evalExprsArray(k, vec, trModule, scModule); err != nil { - return err - } +func (p *State[F]) checkSourceVector(k int, vec Vector, trModule trace.Module[F]) schema.Failure { + // Read each register of this vector + p.readRegisters(k, vec, trModule) // Check whether contained. if !p.rows.Contains(hash.NewArray(p.buffer)) { - sources := make([]term.Evaluable[F], vec.Len()) - for i, e := range vec.Terms { - sources[i] = e - } - // Construct failures - return &Failure[F]{p.handle, vec.Module, sources, uint(k)} + // Construct failure + return &Failure[F]{p.handle, vec.Module, slices.Clone(vec.Registers), uint(k)} } // success return nil } -func (p *State[F, E]) evalExprsArray(k int, vec Vector[F, E], trModule trace.Module[F], scModule schema.Module[F], -) schema.Failure { - var err error - // Evaluate each expression in turn (remembering that the first element is - // the selector) - for i := uint(0); i < vec.Len(); i++ { - p.buffer[i], err = vec.Ith(i).EvalAt(k, trModule, scModule) - // error check - if err != nil { - return constraint.NewInternalFailure[F](p.handle, vec.Module, uint(k), vec.Ith(i), err.Error()) - } +// readRegisters reads the value held in each register of the given vector on +// the given row into the temporary buffer. +func (p *State[F]) readRegisters(k int, vec Vector, trModule trace.Module[F]) { + for i, rid := range vec.Registers { + p.buffer[i] = trModule.Column(rid.Unwrap()).Get(k) } - // Done - return nil +} + +// isSelected determines whether or not the given row of the given vector is +// selected. A row without a selector is always selected; otherwise, it is +// selected when its selector is non-zero. +func isSelected[F field.Element[F]](k int, vec Vector, trModule trace.Module[F]) bool { + // If no selector, then always selected + if !vec.HasSelector() { + return true + } + // Otherwise, selected when selector non-zero. + return !trModule.Column(vec.Selector.Unwrap().Unwrap()).Get(k).IsZero() } diff --git a/pkg/schema/constraint/lookup/failure.go b/pkg/schema/constraint/lookup/failure.go index 55265a365..a07fe3f71 100644 --- a/pkg/schema/constraint/lookup/failure.go +++ b/pkg/schema/constraint/lookup/failure.go @@ -15,8 +15,8 @@ package lookup import ( "fmt" - "github.com/LFDT-Lineth/zkc/pkg/ir/term" "github.com/LFDT-Lineth/zkc/pkg/schema" + "github.com/LFDT-Lineth/zkc/pkg/schema/register" "github.com/LFDT-Lineth/zkc/pkg/trace" "github.com/LFDT-Lineth/zkc/pkg/util/collection/set" ) @@ -25,10 +25,10 @@ import ( type Failure[F any] struct { // Handle of the failing constraint Handle string - // Relevant context for source expressions. + // Relevant context for source registers. Context schema.ModuleId - // Source expressions which were missing - Sources []term.Evaluable[F] + // Source registers whose values were missing + Sources []register.Id // Row on which the constraint failed Row uint } @@ -45,9 +45,10 @@ func (p *Failure[F]) String() string { // RequiredCells identifies the cells required to evaluate the failing constraint at the failing row. func (p *Failure[F]) RequiredCells(_ trace.Trace[F]) *set.AnySortedSet[trace.CellRef] { res := set.NewAnySortedSet[trace.CellRef]() - // Handle terms - for _, e := range p.Sources { - res.InsertSorted(e.RequiredCells(int(p.Row), p.Context)) + // Handle registers + for _, rid := range p.Sources { + ref := trace.NewColumnRef(p.Context, rid) + res.Insert(trace.NewCellRef(ref, int(p.Row))) } // return res diff --git a/pkg/schema/constraint/lookup/geometry.go b/pkg/schema/constraint/lookup/geometry.go index bb346bc2d..fc60236a2 100644 --- a/pkg/schema/constraint/lookup/geometry.go +++ b/pkg/schema/constraint/lookup/geometry.go @@ -13,9 +13,6 @@ package lookup import ( - "fmt" - - "github.com/LFDT-Lineth/zkc/pkg/ir/term" "github.com/LFDT-Lineth/zkc/pkg/schema/module" "github.com/LFDT-Lineth/zkc/pkg/schema/register" "github.com/LFDT-Lineth/zkc/pkg/util/field" @@ -34,8 +31,7 @@ type Geometry struct { // NewGeometry returns the calculated "geometry" for this lookup. That // is, for each source/target pair, the maximum bitwidth of any source or target // value. -func NewGeometry[F field.Element[F], E term.Evaluable[F], T register.Map](c Constraint[F, E], - mapping module.Map[T]) Geometry { +func NewGeometry[F field.Element[F], T register.Map](c Constraint[F], mapping module.Map[T]) Geometry { // var geometry []uint = make([]uint, c.Sources[0].Len()) // Include sources @@ -70,8 +66,7 @@ func (p *Geometry) LimbWidths(i uint) []uint { return register.LimbWidths(p.config.RegisterWidth, p.geometry[i]) } -func updateGeometry[F field.Element[F], E term.Evaluable[F], T register.Map](geometry []uint, source Vector[F, E], - mapping module.Map[T]) { +func updateGeometry[T register.Map](geometry []uint, source Vector, mapping module.Map[T]) { // var ( regmap = mapping.Module(source.Module) @@ -82,14 +77,7 @@ func updateGeometry[F field.Element[F], E term.Evaluable[F], T register.Map](geo panic("misaligned lookup") } // - for i, ith := range source.Terms { - ithRange := ith.ValueRange() - bitwidth, signed := ithRange.BitWidth() - // Sanity check - if signed { - panic(fmt.Sprintf("signed lookup encountered (%s)", ith.Lisp(true, regmap).String(true))) - } - // - geometry[i] = max(geometry[i], bitwidth) + for i, ith := range source.Registers { + geometry[i] = max(geometry[i], regmap.Register(ith).Width()) } } diff --git a/pkg/schema/constraint/lookup/vector.go b/pkg/schema/constraint/lookup/vector.go index 866937d62..5a6899670 100644 --- a/pkg/schema/constraint/lookup/vector.go +++ b/pkg/schema/constraint/lookup/vector.go @@ -13,122 +13,94 @@ package lookup import ( - "github.com/LFDT-Lineth/zkc/pkg/ir/term" "github.com/LFDT-Lineth/zkc/pkg/schema" + "github.com/LFDT-Lineth/zkc/pkg/schema/register" "github.com/LFDT-Lineth/zkc/pkg/util" "github.com/LFDT-Lineth/zkc/pkg/util/source/sexp" ) -// Vector encapsulates all columns on one side of a lookup (i.e. it -// represents all source columns or all target columns). -type Vector[F any, E term.Evaluable[F]] struct { - // Module in which all terms are evaluated. +// Vector encapsulates all registers on one side of a lookup (i.e. it +// represents all source registers or all target registers). Observe that a +// vector can only be made up of registers (rather than arbitrary expressions). +// Thus, anything else must be expanded into a register beforehand. +type Vector struct { + // Module in which all registers are located. Module schema.ModuleId // Selector for this vector (optional) - Selector util.Option[E] - // Terms making up this vector. - Terms []E + Selector util.Option[register.Id] + // Registers making up this vector. + Registers []register.Id } // NewVector constructs a new vector in a given context with an optional selector. -func NewVector[F any, E term.Evaluable[F]](mid schema.ModuleId, selector util.Option[E], terms ...E) Vector[F, E] { +func NewVector(mid schema.ModuleId, selector util.Option[register.Id], registers ...register.Id) Vector { if selector.HasValue() { - return FilteredVector(mid, selector.Unwrap(), terms...) + return FilteredVector(mid, selector.Unwrap(), registers...) } // - return UnfilteredVector(mid, terms...) + return UnfilteredVector(mid, registers...) } // UnfilteredVector constructs a new vector in a given context which has no selector. -func UnfilteredVector[F any, E term.Evaluable[F]](mid schema.ModuleId, terms ...E) Vector[F, E] { - return Vector[F, E]{ +func UnfilteredVector(mid schema.ModuleId, registers ...register.Id) Vector { + return Vector{ mid, - util.None[E](), - terms, + util.None[register.Id](), + registers, } } // FilteredVector constructs a new vector in a given context which has a selector. -func FilteredVector[F any, E term.Evaluable[F]](mid schema.ModuleId, selector E, terms ...E) Vector[F, E] { - return Vector[F, E]{ +func FilteredVector(mid schema.ModuleId, selector register.Id, registers ...register.Id) Vector { + return Vector{ mid, util.Some(selector), - terms, + registers, } } -// Bounds determines the well-definedness bounds for all terms within this vector. -// -//nolint:revive -func (p *Vector[F, E]) Bounds(module uint) util.Bounds { - var bound util.Bounds - // - if module == p.Module { - // Include bounds for selector (if applicable) - if p.HasSelector() { - sel := p.Selector.Unwrap().Bounds() - bound.Union(&sel) - } - // Include bounds for all terms - for _, e := range p.Terms { - eth := e.Bounds() - bound.Union(ð) - } - } - // - return bound -} - -// Context returns the conterxt in which all terms of this vector must be -// evaluated. -func (p *Vector[F, E]) Context() schema.ModuleId { +// Context returns the conterxt in which all registers of this vector are +// located. +func (p *Vector) Context() schema.ModuleId { return p.Module } // HasSelector determines whether or not this lookup vector has a selector or // not. -func (p *Vector[F, E]) HasSelector() bool { +func (p *Vector) HasSelector() bool { return p.Selector.HasValue() } -// Ith returns the ith term in this vector. -func (p *Vector[F, E]) Ith(index uint) E { - return p.Terms[index] +// Ith returns the ith register in this vector. +func (p *Vector) Ith(index uint) register.Id { + return p.Registers[index] } // Len returns the number of items in this lookup vector. Note this doesn't // include the selector (since this is optional anyway). -func (p *Vector[F, E]) Len() uint { - return uint(len(p.Terms)) +func (p *Vector) Len() uint { + return uint(len(p.Registers)) } // Lisp returns a textual representation of this vector. -func (p *Vector[F, E]) Lisp(mapping schema.AnySchema[F]) sexp.SExp { - var ( - module = mapping.Module(p.Module) - terms = sexp.EmptyList() - ) +func (p *Vector) Lisp(mapping register.Map) sexp.SExp { + var terms = sexp.EmptyList() // if p.HasSelector() { - terms.Append(p.Selector.Unwrap().Lisp(true, module)) + terms.Append(lispOfRegister(p.Selector.Unwrap(), mapping)) } else { terms.Append(sexp.NewSymbol("_")) } - // Iterate source expressions + // Iterate source registers for i := range p.Len() { - terms.Append(p.Ith(i).Lisp(true, module)) + terms.Append(lispOfRegister(p.Ith(i), mapping)) } // Done return terms } -// Substitute any matchined labelled constants within this vector -func (p *Vector[F, E]) Substitute(mapping map[string]F) { - for _, ith := range p.Terms { - ith.Substitute(mapping) - } - // Substitute through selector (if applicable) - if p.HasSelector() { - p.Selector.Unwrap().Substitute(mapping) - } +// lispOfRegister returns a textual representation of a given register in a +// given module. +func lispOfRegister(rid register.Id, mapping register.Map) sexp.SExp { + return sexp.NewSymbol(mapping.Register(rid).QualifiedName(mapping)) } diff --git a/pkg/test/corset_invalid_test.go b/pkg/test/corset_invalid_test.go index be261d5f6..b9b4f5196 100644 --- a/pkg/test/corset_invalid_test.go +++ b/pkg/test/corset_invalid_test.go @@ -377,41 +377,12 @@ func Test_Invalid_Lookup_05(t *testing.T) { func Test_Invalid_Lookup_06(t *testing.T) { checkCorsetInvalid(t, "corset/invalid/lookup_invalid_06") } -func Test_Invalid_Lookup_07(t *testing.T) { - checkCorsetInvalid(t, "corset/invalid/lookup_invalid_07") -} -func Test_Invalid_Lookup_08(t *testing.T) { - checkCorsetInvalid(t, "corset/invalid/lookup_invalid_08") -} -func Test_Invalid_Lookup_09(t *testing.T) { - checkCorsetInvalid(t, "corset/invalid/lookup_invalid_09") -} - -func Test_Invalid_Lookup_10(t *testing.T) { - checkCorsetInvalid(t, "corset/invalid/lookup_invalid_10") -} - -func Test_Invalid_Lookup_11(t *testing.T) { - checkCorsetInvalid(t, "corset/invalid/lookup_invalid_11") -} -func Test_Invalid_Lookup_12(t *testing.T) { - checkCorsetInvalid(t, "corset/invalid/lookup_invalid_12") -} -func Test_Invalid_Lookup_13(t *testing.T) { - checkCorsetInvalid(t, "corset/invalid/lookup_invalid_13") -} func Test_Invalid_Lookup_14(t *testing.T) { checkCorsetInvalid(t, "corset/invalid/lookup_invalid_14") } func Test_Invalid_Lookup_15(t *testing.T) { checkCorsetInvalid(t, "corset/invalid/lookup_invalid_15") } -func Test_Invalid_Lookup_16(t *testing.T) { - checkCorsetInvalid(t, "corset/invalid/lookup_invalid_16") -} -func Test_Invalid_Lookup_17(t *testing.T) { - checkCorsetInvalid(t, "corset/invalid/lookup_invalid_17") -} func Test_Invalid_Lookup_18(t *testing.T) { checkCorsetInvalid(t, "corset/invalid/lookup_invalid_18") } diff --git a/pkg/zkc/constraints/call_and_memory_lookup.go b/pkg/zkc/constraints/call_and_memory_lookup.go index 19df3e247..821978d04 100644 --- a/pkg/zkc/constraints/call_and_memory_lookup.go +++ b/pkg/zkc/constraints/call_and_memory_lookup.go @@ -282,35 +282,25 @@ func emitCallLookup[W vm.Word[W], F field.Element[F]](mod *schema.Table[F, mir.C tgtIds[i] = register.NewId(uint(i)) } // Build the source (caller) vector. - var ( - sel = term.RawRegisterAccess[F, mir.Term[F]](srcSelector, 1, 0) - source = lookup.FilteredVector(ctx, sel, registerAccesses[F](callerRegs, srcIds)...) - ) - + var source = lookup.FilteredVector(ctx, srcSelector, srcIds...) // Build the target (callee) vector. - var ( - target mir.LookupVector[F] - tgtTerms = registerAccesses[F](calleeRegs, tgtIds) - ) + var target mir.LookupVector // Native module don't have a $ret function // (do we need one ? see https://github.com/LFDT-Lineth/zkc/issues/2025) if callee.IsNative() { - target = lookup.UnfilteredVector(calleeId, tgtTerms...) + target = lookup.UnfilteredVector(calleeId, tgtIds...) } else { // Both multi-line and atomic (one-line) callees expose a $ret line which is 1 // on active rows; use it as the lookup selector. // TODO: see https://github.com/LFDT-Lineth/zkc/issues/1975 // Atomic callees have $ret line as well. Only OLI that touches memmory should have one. - var ( - retId = register.NewId(uint(len(calleeRegs))) - ret = term.RawRegisterAccess[F, mir.Term[F]](retId, 1, 0) - ) + var retId = register.NewId(uint(len(calleeRegs))) // - target = lookup.FilteredVector(calleeId, ret, tgtTerms...) + target = lookup.FilteredVector(calleeId, retId, tgtIds...) } // - mod.AddConstraints(mir.NewLookupConstraint(handle, []mir.LookupVector[F]{target}, []mir.LookupVector[F]{source})) + mod.AddConstraints(mir.NewLookupConstraint[F](handle, []mir.LookupVector{target}, []mir.LookupVector{source})) } // emitMemoryLookup constructs and adds a single lookup constraint mapping an @@ -350,44 +340,22 @@ func emitMemoryLookup[W vm.Word[W], F field.Element[F]](mod *schema.Table[F, mir tgtIds[i] = register.NewId(uint(i)) } // Build the source (accessor) vector. - var ( - sel = term.RawRegisterAccess[F, mir.Term[F]](srcSelector, 1, 0) - source = lookup.FilteredVector(ctx, sel, registerAccesses[F](accessorRegs, srcIds)...) - ) - + var source = lookup.FilteredVector(ctx, srcSelector, srcIds...) // Build the target (memory) vector. - var ( - target mir.LookupVector[F] - tgtTerms = registerAccesses[F](memRegs, tgtIds) - ) + var target mir.LookupVector // if mem.IsStatic() { // Static tables enumerate their full contents, so every row is a valid // table entry and the target side is unfiltered. - target = lookup.UnfilteredVector(memId, tgtTerms...) + target = lookup.UnfilteredVector(memId, tgtIds...) } else { // ROM / WOM tables expose a $access_bit column which is 1 on active // rows; use it as the lookup selector. It is allocated immediately // after the address/data registers (see translateAccessOnceMemory). - var ( - accessId = register.NewId(uint(len(memRegs))) - access = term.RawRegisterAccess[F, mir.Term[F]](accessId, 1, 0) - ) + var accessId = register.NewId(uint(len(memRegs))) // - target = lookup.FilteredVector(memId, access, tgtTerms...) - } - // - mod.AddConstraints(mir.NewLookupConstraint(handle, []mir.LookupVector[F]{target}, []mir.LookupVector[F]{source})) -} - -// registerAccesses builds MIR register accesses (at row offset 0) for the given -// register ids, looking up each register's width in the supplied layout. -func registerAccesses[F field.Element[F]](regs []register.Register, ids []register.Id) []*mir.RegisterAccess[F] { - terms := make([]*mir.RegisterAccess[F], len(ids)) - // - for i, id := range ids { - terms[i] = term.RawRegisterAccess[F, mir.Term[F]](id, regs[id.Unwrap()].WidthOrNative(), 0) + target = lookup.FilteredVector(memId, accessId, tgtIds...) } // - return terms + mod.AddConstraints(mir.NewLookupConstraint[F](handle, []mir.LookupVector{target}, []mir.LookupVector{source})) } diff --git a/pkg/zkc/constraints/mirc/mir.go b/pkg/zkc/constraints/mirc/mir.go index 5f74bf8c4..94553fc2b 100644 --- a/pkg/zkc/constraints/mirc/mir.go +++ b/pkg/zkc/constraints/mirc/mir.go @@ -87,26 +87,20 @@ func (p MirModule[F]) NewLookup(name string, from []register.Id, target MirModul enable util.Option[register.Id]) { // var ( - sources = wrapMirRegisterAccesses[F](p.Module, from...) - targets = wrapMirRegisterAccesses[F](target.Module, to...) - targetVectors []lookup.Vector[F, *mir.RegisterAccess[F]] - sourceVectors []lookup.Vector[F, *mir.RegisterAccess[F]] + targetVectors []lookup.Vector + sourceVectors []lookup.Vector ) // if enable.IsEmpty() { - targetVectors = append(targetVectors, lookup.UnfilteredVector(target.Module.Id(), targets...)) + targetVectors = append(targetVectors, lookup.UnfilteredVector(target.Module.Id(), to...)) } else { - var ( - enReg = target.Module.Register(enable.Unwrap()) - en = term.RawRegisterAccess[F, mir.Term[F]](enable.Unwrap(), enReg.Width(), 0) - ) - // - targetVectors = append(targetVectors, lookup.FilteredVector(target.Module.Id(), en, targets...)) + targetVectors = append(targetVectors, + lookup.FilteredVector(target.Module.Id(), enable.Unwrap(), to...)) } // - sourceVectors = append(sourceVectors, lookup.UnfilteredVector(p.Module.Id(), sources...)) + sourceVectors = append(sourceVectors, lookup.UnfilteredVector(p.Module.Id(), from...)) // - p.Module.AddConstraint(mir.NewLookupConstraint(name, targetVectors, sourceVectors)) + p.Module.AddConstraint(mir.NewLookupConstraint[F](name, targetVectors, sourceVectors)) } // String returns an appropriately formatted representation of the module. @@ -275,15 +269,3 @@ func unwrapSplitMirLogicals[F field.Element[F]](head MirExpr[F], tail ...MirExpr // return cexprs } - -func wrapMirRegisterAccesses[F field.Element[F]](mapping register.Map, regs ...register.Id) []*mir.RegisterAccess[F] { - var vars = make([]*mir.RegisterAccess[F], len(regs)) - // - for i, rid := range regs { - var reg = mapping.Register(rid) - // - vars[i] = term.RawRegisterAccess[F, mir.Term[F]](rid, reg.Width(), 0) - } - // - return vars -} diff --git a/pkg/zkc/constraints/range_lookup.go b/pkg/zkc/constraints/range_lookup.go index 3dfadc597..171ab2534 100644 --- a/pkg/zkc/constraints/range_lookup.go +++ b/pkg/zkc/constraints/range_lookup.go @@ -17,7 +17,6 @@ import ( "strings" "github.com/LFDT-Lineth/zkc/pkg/ir/mir" - "github.com/LFDT-Lineth/zkc/pkg/ir/term" "github.com/LFDT-Lineth/zkc/pkg/schema" "github.com/LFDT-Lineth/zkc/pkg/schema/constraint/lookup" "github.com/LFDT-Lineth/zkc/pkg/schema/register" @@ -120,14 +119,12 @@ func addRangeProofConstraints[F field.Element[F]](mod *schema.Table[F, mir.Const regId = register.NewId(uint(i)) handle = fmt.Sprintf("range_u%d_%d", reg.Width(), regId.Unwrap()) // Source: the register's value on the current row. - source = lookup.UnfilteredVector(ctx, - term.RawRegisterAccess[F, mir.Term[F]](regId, reg.Width(), 0)) + source = lookup.UnfilteredVector(ctx, regId) // Target: the enumerated value column of the matching $range_un table. - target = lookup.UnfilteredVector(table.module, - term.RawRegisterAccess[F, mir.Term[F]](table.value, reg.Width(), 0)) + target = lookup.UnfilteredVector(table.module, table.value) ) // - mod.AddConstraints(mir.NewLookupConstraint(handle, - []mir.LookupVector[F]{target}, []mir.LookupVector[F]{source})) + mod.AddConstraints(mir.NewLookupConstraint[F](handle, + []mir.LookupVector{target}, []mir.LookupVector{source})) } } diff --git a/pkg/zkc/constraints/validate.go b/pkg/zkc/constraints/validate.go index 33fd5f8cd..0ced92b0e 100644 --- a/pkg/zkc/constraints/validate.go +++ b/pkg/zkc/constraints/validate.go @@ -86,26 +86,21 @@ func validateVanishingConstraint[F field.Element[F], T term.Testable[F]](c vanis } } -func validateLookupConstraint[F field.Element[F], T term.Evaluable[F]](c lookup.Constraint[F, T], - validations []bit.Set) { +func validateLookupConstraint[F field.Element[F]](c lookup.Constraint[F], validations []bit.Set) { // validateLookupVectors(c.Targets, validations) validateLookupVectors(c.Sources, validations) } -func validateLookupVectors[F field.Element[F], T term.Evaluable[F]](vs []lookup.Vector[F, T], - validations []bit.Set) { +func validateLookupVectors(vs []lookup.Vector, validations []bit.Set) { for _, v := range vs { validateLookupVector(v, validations) } } -func validateLookupVector[F field.Element[F], T term.Evaluable[F]](v lookup.Vector[F, T], - validations []bit.Set) { - for _, e := range v.Terms { - for _, rid := range *e.RequiredRegisters() { - validations[v.Context()].Insert(rid) - } +func validateLookupVector(v lookup.Vector, validations []bit.Set) { + for _, rid := range v.Registers { + validations[v.Context()].Insert(rid.Unwrap()) } } diff --git a/testdata/corset/agnostic/lookup_02.accepts b/testdata/corset/agnostic/lookup_02.accepts index 222e16e1d..f98f1efce 100644 --- a/testdata/corset/agnostic/lookup_02.accepts +++ b/testdata/corset/agnostic/lookup_02.accepts @@ -1,91 +1,91 @@ ;; 2^128=340282366920938463463374607431768211456 ;; 2^160=1461501637330902918203684832716283019655932542976 ;; 2^256=11579208923731619542357098500868790785326998466564056403945758400791312963993 -{"m1.X_HI": [0], "m1.X_LO": [0], "m2.Y": [0] } -{"m1.X_HI": [0], "m1.X_LO": [1], "m2.Y": [1] } -{"m1.X_HI": [0], "m1.X_LO": [2], "m2.Y": [2] } -{"m1.X_HI": [0], "m1.X_LO": [3], "m2.Y": [3] } +{"m1.X_HI": [0], "m1.X_LO": [0], "m2.Y": [0], "m1.X": [0]} +{"m1.X_HI": [0], "m1.X_LO": [1], "m2.Y": [1], "m1.X": [1]} +{"m1.X_HI": [0], "m1.X_LO": [2], "m2.Y": [2], "m1.X": [2]} +{"m1.X_HI": [0], "m1.X_LO": [3], "m2.Y": [3], "m1.X": [3]} ;;============================================================================== ;;u8 ;;============================================================================== -{"m1.X_HI": [0], "m1.X_LO": [252], "m2.Y": [252] } -{"m1.X_HI": [0], "m1.X_LO": [253], "m2.Y": [253] } -{"m1.X_HI": [0], "m1.X_LO": [254], "m2.Y": [254] } -{"m1.X_HI": [0], "m1.X_LO": [255], "m2.Y": [255] } -{"m1.X_HI": [0], "m1.X_LO": [256], "m2.Y": [256] } -{"m1.X_HI": [0], "m1.X_LO": [257], "m2.Y": [257] } +{"m1.X_HI": [0], "m1.X_LO": [252], "m2.Y": [252], "m1.X": [252]} +{"m1.X_HI": [0], "m1.X_LO": [253], "m2.Y": [253], "m1.X": [253]} +{"m1.X_HI": [0], "m1.X_LO": [254], "m2.Y": [254], "m1.X": [254]} +{"m1.X_HI": [0], "m1.X_LO": [255], "m2.Y": [255], "m1.X": [255]} +{"m1.X_HI": [0], "m1.X_LO": [256], "m2.Y": [256], "m1.X": [256]} +{"m1.X_HI": [0], "m1.X_LO": [257], "m2.Y": [257], "m1.X": [257]} ;; -{"m1.X_HI": [0,0], "m1.X_LO": [0,256], "m2.Y": [256,257] } -{"m1.X_HI": [0,0], "m1.X_LO": [0,257], "m2.Y": [256,257] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,0,256], "m2.Y": [256,257,258] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,0,257], "m2.Y": [256,257,258] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,0,258], "m2.Y": [256,257,258] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,256,256], "m2.Y": [256,257,258] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,256,257], "m2.Y": [256,257,258] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,256,258], "m2.Y": [256,257,258] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,257,258], "m2.Y": [256,257,258] } +{"m1.X_HI": [0, 0], "m1.X_LO": [0, 256], "m2.Y": [256, 257], "m1.X": [0, 256]} +{"m1.X_HI": [0, 0], "m1.X_LO": [0, 257], "m2.Y": [256, 257], "m1.X": [0, 257]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 0, 256], "m2.Y": [256, 257, 258], "m1.X": [0, 0, 256]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 0, 257], "m2.Y": [256, 257, 258], "m1.X": [0, 0, 257]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 0, 258], "m2.Y": [256, 257, 258], "m1.X": [0, 0, 258]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 256, 256], "m2.Y": [256, 257, 258], "m1.X": [0, 256, 256]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 256, 257], "m2.Y": [256, 257, 258], "m1.X": [0, 256, 257]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 256, 258], "m2.Y": [256, 257, 258], "m1.X": [0, 256, 258]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 257, 258], "m2.Y": [256, 257, 258], "m1.X": [0, 257, 258]} ;;============================================================================== ;;u16 ;;============================================================================== -{"m1.X_HI": [0], "m1.X_LO": [65531], "m2.Y": [65531] } -{"m1.X_HI": [0], "m1.X_LO": [65532], "m2.Y": [65532] } -{"m1.X_HI": [0], "m1.X_LO": [65533], "m2.Y": [65533] } -{"m1.X_HI": [0], "m1.X_LO": [65534], "m2.Y": [65534] } -{"m1.X_HI": [0], "m1.X_LO": [65535], "m2.Y": [65535] } -{"m1.X_HI": [0], "m1.X_LO": [65536], "m2.Y": [65536] } +{"m1.X_HI": [0], "m1.X_LO": [65531], "m2.Y": [65531], "m1.X": [65531]} +{"m1.X_HI": [0], "m1.X_LO": [65532], "m2.Y": [65532], "m1.X": [65532]} +{"m1.X_HI": [0], "m1.X_LO": [65533], "m2.Y": [65533], "m1.X": [65533]} +{"m1.X_HI": [0], "m1.X_LO": [65534], "m2.Y": [65534], "m1.X": [65534]} +{"m1.X_HI": [0], "m1.X_LO": [65535], "m2.Y": [65535], "m1.X": [65535]} +{"m1.X_HI": [0], "m1.X_LO": [65536], "m2.Y": [65536], "m1.X": [65536]} ;; -{"m1.X_HI": [0,0], "m1.X_LO": [0,65535], "m2.Y": [65535,65536] } -{"m1.X_HI": [0,0], "m1.X_LO": [0,65536], "m2.Y": [65535,65536] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,0,65535], "m2.Y": [65535,65536,65537] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,0,65536], "m2.Y": [65535,65536,65537] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,0,65537], "m2.Y": [65535,65536,65537] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,65535,65535], "m2.Y": [65535,65536,65537] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,65535,65536], "m2.Y": [65535,65536,65537] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,65535,65537], "m2.Y": [65535,65536,65537] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,65536,65537], "m2.Y": [65535,65536,65537] } +{"m1.X_HI": [0, 0], "m1.X_LO": [0, 65535], "m2.Y": [65535, 65536], "m1.X": [0, 65535]} +{"m1.X_HI": [0, 0], "m1.X_LO": [0, 65536], "m2.Y": [65535, 65536], "m1.X": [0, 65536]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 0, 65535], "m2.Y": [65535, 65536, 65537], "m1.X": [0, 0, 65535]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 0, 65536], "m2.Y": [65535, 65536, 65537], "m1.X": [0, 0, 65536]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 0, 65537], "m2.Y": [65535, 65536, 65537], "m1.X": [0, 0, 65537]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 65535, 65535], "m2.Y": [65535, 65536, 65537], "m1.X": [0, 65535, 65535]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 65535, 65536], "m2.Y": [65535, 65536, 65537], "m1.X": [0, 65535, 65536]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 65535, 65537], "m2.Y": [65535, 65536, 65537], "m1.X": [0, 65535, 65537]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 65536, 65537], "m2.Y": [65535, 65536, 65537], "m1.X": [0, 65536, 65537]} ;;============================================================================== ;;u128 ;;============================================================================== -{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211450], "m2.Y": [340282366920938463463374607431768211450] } -{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211451], "m2.Y": [340282366920938463463374607431768211451] } -{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211452], "m2.Y": [340282366920938463463374607431768211452] } -{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211453], "m2.Y": [340282366920938463463374607431768211453] } -{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211454], "m2.Y": [340282366920938463463374607431768211454] } -{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455] } -{"m1.X_HI": [1], "m1.X_LO": [0], "m2.Y": [340282366920938463463374607431768211456] } +{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211450], "m2.Y": [340282366920938463463374607431768211450], "m1.X": [340282366920938463463374607431768211450]} +{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211451], "m2.Y": [340282366920938463463374607431768211451], "m1.X": [340282366920938463463374607431768211451]} +{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211452], "m2.Y": [340282366920938463463374607431768211452], "m1.X": [340282366920938463463374607431768211452]} +{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211453], "m2.Y": [340282366920938463463374607431768211453], "m1.X": [340282366920938463463374607431768211453]} +{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211454], "m2.Y": [340282366920938463463374607431768211454], "m1.X": [340282366920938463463374607431768211454]} +{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455], "m1.X": [340282366920938463463374607431768211455]} +{"m1.X_HI": [1], "m1.X_LO": [0], "m2.Y": [340282366920938463463374607431768211456], "m1.X": [340282366920938463463374607431768211456]} ;; -{"m1.X_HI": [0,0], "m1.X_LO": [0,340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456] } -{"m1.X_HI": [0,1], "m1.X_LO": [0,0], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,0,340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457] } -{"m1.X_HI": [0,0,1], "m1.X_LO": [0,0,0], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457] } -{"m1.X_HI": [0,0,1], "m1.X_LO": [0,0,1], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,340282366920938463463374607431768211455,340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457] } -{"m1.X_HI": [0,0,1], "m1.X_LO": [0,340282366920938463463374607431768211455,0], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457] } -{"m1.X_HI": [0,0,1], "m1.X_LO": [0,340282366920938463463374607431768211455,2], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457,340282366920938463463374607431768211458] } -{"m1.X_HI": [0,1,1], "m1.X_LO": [0,1,2], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457,340282366920938463463374607431768211458] } +{"m1.X_HI": [0, 0], "m1.X_LO": [0, 340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456], "m1.X": [0, 340282366920938463463374607431768211455]} +{"m1.X_HI": [0, 1], "m1.X_LO": [0, 0], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456], "m1.X": [0, 340282366920938463463374607431768211456]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 0, 340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457], "m1.X": [0, 0, 340282366920938463463374607431768211455]} +{"m1.X_HI": [0, 0, 1], "m1.X_LO": [0, 0, 0], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457], "m1.X": [0, 0, 340282366920938463463374607431768211456]} +{"m1.X_HI": [0, 0, 1], "m1.X_LO": [0, 0, 1], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457], "m1.X": [0, 0, 340282366920938463463374607431768211457]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457], "m1.X": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211455]} +{"m1.X_HI": [0, 0, 1], "m1.X_LO": [0, 340282366920938463463374607431768211455, 0], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457], "m1.X": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211456]} +{"m1.X_HI": [0, 0, 1], "m1.X_LO": [0, 340282366920938463463374607431768211455, 2], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457, 340282366920938463463374607431768211458], "m1.X": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211458]} +{"m1.X_HI": [0, 1, 1], "m1.X_LO": [0, 1, 2], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457, 340282366920938463463374607431768211458], "m1.X": [0, 340282366920938463463374607431768211457, 340282366920938463463374607431768211458]} ;;============================================================================== ;;u160 ;;============================================================================== -{"m1.X_HI": [4294967295], "m1.X_LO": [340282366920938463463374607431768211451], "m2.Y": [1461501637330902918203684832716283019655932542971] } -{"m1.X_HI": [4294967295], "m1.X_LO": [340282366920938463463374607431768211452], "m2.Y": [1461501637330902918203684832716283019655932542972] } -{"m1.X_HI": [4294967295], "m1.X_LO": [340282366920938463463374607431768211453], "m2.Y": [1461501637330902918203684832716283019655932542973] } -{"m1.X_HI": [4294967295], "m1.X_LO": [340282366920938463463374607431768211454], "m2.Y": [1461501637330902918203684832716283019655932542974] } -{"m1.X_HI": [4294967295], "m1.X_LO": [340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975] } -{"m1.X_HI": [4294967296], "m1.X_LO": [0], "m2.Y": [1461501637330902918203684832716283019655932542976] } -{"m1.X_HI": [4294967296], "m1.X_LO": [1], "m2.Y": [1461501637330902918203684832716283019655932542977] } +{"m1.X_HI": [4294967295], "m1.X_LO": [340282366920938463463374607431768211451], "m2.Y": [1461501637330902918203684832716283019655932542971], "m1.X": [1461501637330902918203684832716283019655932542971]} +{"m1.X_HI": [4294967295], "m1.X_LO": [340282366920938463463374607431768211452], "m2.Y": [1461501637330902918203684832716283019655932542972], "m1.X": [1461501637330902918203684832716283019655932542972]} +{"m1.X_HI": [4294967295], "m1.X_LO": [340282366920938463463374607431768211453], "m2.Y": [1461501637330902918203684832716283019655932542973], "m1.X": [1461501637330902918203684832716283019655932542973]} +{"m1.X_HI": [4294967295], "m1.X_LO": [340282366920938463463374607431768211454], "m2.Y": [1461501637330902918203684832716283019655932542974], "m1.X": [1461501637330902918203684832716283019655932542974]} +{"m1.X_HI": [4294967295], "m1.X_LO": [340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975], "m1.X": [1461501637330902918203684832716283019655932542975]} +{"m1.X_HI": [4294967296], "m1.X_LO": [0], "m2.Y": [1461501637330902918203684832716283019655932542976], "m1.X": [1461501637330902918203684832716283019655932542976]} +{"m1.X_HI": [4294967296], "m1.X_LO": [1], "m2.Y": [1461501637330902918203684832716283019655932542977], "m1.X": [1461501637330902918203684832716283019655932542977]} ;; -{"m1.X_HI": [0,4294967295], "m1.X_LO": [0,340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976] } -{"m1.X_HI": [0,4294967296], "m1.X_LO": [0,0], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976] } -{"m1.X_HI": [0,4294967295], "m1.X_LO": [0,340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } -{"m1.X_HI": [0,4294967296], "m1.X_LO": [0,0], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } -{"m1.X_HI": [0,4294967296], "m1.X_LO": [0,1], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } +{"m1.X_HI": [0, 4294967295], "m1.X_LO": [0, 340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976], "m1.X": [0, 1461501637330902918203684832716283019655932542975]} +{"m1.X_HI": [0, 4294967296], "m1.X_LO": [0, 0], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976], "m1.X": [0, 1461501637330902918203684832716283019655932542976]} +{"m1.X_HI": [0, 4294967295], "m1.X_LO": [0, 340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.X": [0, 1461501637330902918203684832716283019655932542975]} +{"m1.X_HI": [0, 4294967296], "m1.X_LO": [0, 0], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.X": [0, 1461501637330902918203684832716283019655932542976]} +{"m1.X_HI": [0, 4294967296], "m1.X_LO": [0, 1], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.X": [0, 1461501637330902918203684832716283019655932542977]} -{"m1.X_HI": [0,4294967295,4294967295], "m1.X_LO": [0,340282366920938463463374607431768211455,340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } -{"m1.X_HI": [0,4294967295,4294967296], "m1.X_LO": [0,340282366920938463463374607431768211455,0], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } -{"m1.X_HI": [0,4294967295,4294967296], "m1.X_LO": [0,340282366920938463463374607431768211455,1], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } -{"m1.X_HI": [0,4294967296,4294967296], "m1.X_LO": [0,0,1], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } -{"m1.X_HI": [0,4294967296,4294967296], "m1.X_LO": [0,1,1], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } +{"m1.X_HI": [0, 4294967295, 4294967295], "m1.X_LO": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.X": [0, 1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542975]} +{"m1.X_HI": [0, 4294967295, 4294967296], "m1.X_LO": [0, 340282366920938463463374607431768211455, 0], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.X": [0, 1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976]} +{"m1.X_HI": [0, 4294967295, 4294967296], "m1.X_LO": [0, 340282366920938463463374607431768211455, 1], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.X": [0, 1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542977]} +{"m1.X_HI": [0, 4294967296, 4294967296], "m1.X_LO": [0, 0, 1], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.X": [0, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977]} +{"m1.X_HI": [0, 4294967296, 4294967296], "m1.X_LO": [0, 1, 1], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.X": [0, 1461501637330902918203684832716283019655932542977, 1461501637330902918203684832716283019655932542977]} diff --git a/testdata/corset/agnostic/lookup_02.lisp b/testdata/corset/agnostic/lookup_02.lisp index b4a8e9808..9cc81d553 100644 --- a/testdata/corset/agnostic/lookup_02.lisp +++ b/testdata/corset/agnostic/lookup_02.lisp @@ -1,8 +1,10 @@ (module m1) ;; -(defcolumns (X_LO :i128) (X_HI :i128)) +(defcolumns (X_LO :i128) (X_HI :i128) (X :i256)) +;; X holds the value of the expression (:: X_HI X_LO) +(defconstraint x_def () (== X (:: X_HI X_LO))) ;; -(deflookup l1 (m2.Y) ((:: X_HI X_LO))) +(deflookup l1 (m2.Y) (X)) (module m2) (defcolumns (Y :i256)) diff --git a/testdata/corset/agnostic/lookup_02.rejects b/testdata/corset/agnostic/lookup_02.rejects index bdc9959f3..ccb5fe61d 100644 --- a/testdata/corset/agnostic/lookup_02.rejects +++ b/testdata/corset/agnostic/lookup_02.rejects @@ -1,79 +1,79 @@ ;; 2^128=340282366920938463463374607431768211456 ;; 2^160=1461501637330902918203684832716283019655932542976 ;; 2^256=11579208923731619542357098500868790785326998466564056403945758400791312963993 -{"m1.X_HI": [0], "m1.X_LO": [1], "m2.Y": [0] } -{"m1.X_HI": [1], "m1.X_LO": [0], "m2.Y": [0] } -{"m1.X_HI": [1], "m1.X_LO": [0], "m2.Y": [1] } -{"m1.X_HI": [1], "m1.X_LO": [1], "m2.Y": [0] } -{"m1.X_HI": [1], "m1.X_LO": [1], "m2.Y": [1] } +{"m1.X_HI": [0], "m1.X_LO": [1], "m2.Y": [0], "m1.X": [1]} +{"m1.X_HI": [1], "m1.X_LO": [0], "m2.Y": [0], "m1.X": [340282366920938463463374607431768211456]} +{"m1.X_HI": [1], "m1.X_LO": [0], "m2.Y": [1], "m1.X": [340282366920938463463374607431768211456]} +{"m1.X_HI": [1], "m1.X_LO": [1], "m2.Y": [0], "m1.X": [340282366920938463463374607431768211457]} +{"m1.X_HI": [1], "m1.X_LO": [1], "m2.Y": [1], "m1.X": [340282366920938463463374607431768211457]} ;; ;;============================================================================== ;;u8 ;;============================================================================== -{"m1.X_HI": [0], "m1.X_LO": [252], "m2.Y": [253] } -{"m1.X_HI": [0], "m1.X_LO": [253], "m2.Y": [254] } -{"m1.X_HI": [0], "m1.X_LO": [254], "m2.Y": [255] } -{"m1.X_HI": [0], "m1.X_LO": [255], "m2.Y": [256] } -{"m1.X_HI": [0], "m1.X_LO": [256], "m2.Y": [257] } -{"m1.X_HI": [0], "m1.X_LO": [257], "m2.Y": [258] } +{"m1.X_HI": [0], "m1.X_LO": [252], "m2.Y": [253], "m1.X": [252]} +{"m1.X_HI": [0], "m1.X_LO": [253], "m2.Y": [254], "m1.X": [253]} +{"m1.X_HI": [0], "m1.X_LO": [254], "m2.Y": [255], "m1.X": [254]} +{"m1.X_HI": [0], "m1.X_LO": [255], "m2.Y": [256], "m1.X": [255]} +{"m1.X_HI": [0], "m1.X_LO": [256], "m2.Y": [257], "m1.X": [256]} +{"m1.X_HI": [0], "m1.X_LO": [257], "m2.Y": [258], "m1.X": [257]} ;; -{"m1.X_HI": [0,0], "m1.X_LO": [0,256], "m2.Y": [255,257] } -{"m1.X_HI": [0,0], "m1.X_LO": [0,257], "m2.Y": [256,258] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,0,256], "m2.Y": [255,257,258] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,0,257], "m2.Y": [256,258,259] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,0,258], "m2.Y": [256,257,259] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,256,256], "m2.Y": [255,257,258] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,256,257], "m2.Y": [254,257,258] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,256,257], "m2.Y": [256,258,259] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,256,258], "m2.Y": [255,257,258] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,256,258], "m2.Y": [256,257,259] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,257,258], "m2.Y": [255,256,258] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,257,258], "m2.Y": [256,258,259] } +{"m1.X_HI": [0, 0], "m1.X_LO": [0, 256], "m2.Y": [255, 257], "m1.X": [0, 256]} +{"m1.X_HI": [0, 0], "m1.X_LO": [0, 257], "m2.Y": [256, 258], "m1.X": [0, 257]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 0, 256], "m2.Y": [255, 257, 258], "m1.X": [0, 0, 256]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 0, 257], "m2.Y": [256, 258, 259], "m1.X": [0, 0, 257]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 0, 258], "m2.Y": [256, 257, 259], "m1.X": [0, 0, 258]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 256, 256], "m2.Y": [255, 257, 258], "m1.X": [0, 256, 256]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 256, 257], "m2.Y": [254, 257, 258], "m1.X": [0, 256, 257]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 256, 257], "m2.Y": [256, 258, 259], "m1.X": [0, 256, 257]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 256, 258], "m2.Y": [255, 257, 258], "m1.X": [0, 256, 258]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 256, 258], "m2.Y": [256, 257, 259], "m1.X": [0, 256, 258]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 257, 258], "m2.Y": [255, 256, 258], "m1.X": [0, 257, 258]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 257, 258], "m2.Y": [256, 258, 259], "m1.X": [0, 257, 258]} ;;============================================================================== ;;u16 ;;============================================================================== -{"m1.X_HI": [0], "m1.X_LO": [65531], "m2.Y": [65532] } -{"m1.X_HI": [0], "m1.X_LO": [65532], "m2.Y": [65533] } -{"m1.X_HI": [0], "m1.X_LO": [65533], "m2.Y": [65534] } -{"m1.X_HI": [0], "m1.X_LO": [65534], "m2.Y": [65535] } -{"m1.X_HI": [0], "m1.X_LO": [65535], "m2.Y": [65536] } -{"m1.X_HI": [0], "m1.X_LO": [65536], "m2.Y": [65537] } +{"m1.X_HI": [0], "m1.X_LO": [65531], "m2.Y": [65532], "m1.X": [65531]} +{"m1.X_HI": [0], "m1.X_LO": [65532], "m2.Y": [65533], "m1.X": [65532]} +{"m1.X_HI": [0], "m1.X_LO": [65533], "m2.Y": [65534], "m1.X": [65533]} +{"m1.X_HI": [0], "m1.X_LO": [65534], "m2.Y": [65535], "m1.X": [65534]} +{"m1.X_HI": [0], "m1.X_LO": [65535], "m2.Y": [65536], "m1.X": [65535]} +{"m1.X_HI": [0], "m1.X_LO": [65536], "m2.Y": [65537], "m1.X": [65536]} ;; -{"m1.X_HI": [0,0], "m1.X_LO": [0,65535], "m2.Y": [65534,65536] } -{"m1.X_HI": [0,0], "m1.X_LO": [0,65536], "m2.Y": [65535,65537] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,0,65535], "m2.Y": [65534,65536,65537] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,0,65536], "m2.Y": [65535,65537,65538] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,0,65537], "m2.Y": [65535,65536,65538] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,65535,65535], "m2.Y": [65534,65536,65537] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,65535,65536], "m2.Y": [65534,65536,65537] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,65535,65536], "m2.Y": [65535,65537,65538] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,65535,65537], "m2.Y": [65534,65536,65537] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,65535,65537], "m2.Y": [65535,65536,65538] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,65536,65537], "m2.Y": [65535,65537,65538] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,65536,65537], "m2.Y": [65535,65536,65538] } +{"m1.X_HI": [0, 0], "m1.X_LO": [0, 65535], "m2.Y": [65534, 65536], "m1.X": [0, 65535]} +{"m1.X_HI": [0, 0], "m1.X_LO": [0, 65536], "m2.Y": [65535, 65537], "m1.X": [0, 65536]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 0, 65535], "m2.Y": [65534, 65536, 65537], "m1.X": [0, 0, 65535]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 0, 65536], "m2.Y": [65535, 65537, 65538], "m1.X": [0, 0, 65536]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 0, 65537], "m2.Y": [65535, 65536, 65538], "m1.X": [0, 0, 65537]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 65535, 65535], "m2.Y": [65534, 65536, 65537], "m1.X": [0, 65535, 65535]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 65535, 65536], "m2.Y": [65534, 65536, 65537], "m1.X": [0, 65535, 65536]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 65535, 65536], "m2.Y": [65535, 65537, 65538], "m1.X": [0, 65535, 65536]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 65535, 65537], "m2.Y": [65534, 65536, 65537], "m1.X": [0, 65535, 65537]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 65535, 65537], "m2.Y": [65535, 65536, 65538], "m1.X": [0, 65535, 65537]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 65536, 65537], "m2.Y": [65535, 65537, 65538], "m1.X": [0, 65536, 65537]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 65536, 65537], "m2.Y": [65535, 65536, 65538], "m1.X": [0, 65536, 65537]} ;;============================================================================== ;;u128 ;;============================================================================== -{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211450], "m2.Y": [340282366920938463463374607431768211451] } -{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211451], "m2.Y": [340282366920938463463374607431768211452] } -{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211452], "m2.Y": [340282366920938463463374607431768211453] } -{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211453], "m2.Y": [340282366920938463463374607431768211454] } -{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211454], "m2.Y": [340282366920938463463374607431768211455] } -{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211456] } -{"m1.X_HI": [1], "m1.X_LO": [0], "m2.Y": [340282366920938463463374607431768211457] } +{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211450], "m2.Y": [340282366920938463463374607431768211451], "m1.X": [340282366920938463463374607431768211450]} +{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211451], "m2.Y": [340282366920938463463374607431768211452], "m1.X": [340282366920938463463374607431768211451]} +{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211452], "m2.Y": [340282366920938463463374607431768211453], "m1.X": [340282366920938463463374607431768211452]} +{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211453], "m2.Y": [340282366920938463463374607431768211454], "m1.X": [340282366920938463463374607431768211453]} +{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211454], "m2.Y": [340282366920938463463374607431768211455], "m1.X": [340282366920938463463374607431768211454]} +{"m1.X_HI": [0], "m1.X_LO": [340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211456], "m1.X": [340282366920938463463374607431768211455]} +{"m1.X_HI": [1], "m1.X_LO": [0], "m2.Y": [340282366920938463463374607431768211457], "m1.X": [340282366920938463463374607431768211456]} ;; -{"m1.X_HI": [0,0], "m1.X_LO": [0,340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211454,340282366920938463463374607431768211456] } -{"m1.X_HI": [0,1], "m1.X_LO": [0,0], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211457] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,0,340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211454,340282366920938463463374607431768211456,340282366920938463463374607431768211457] } -{"m1.X_HI": [0,0,1], "m1.X_LO": [0,0,0], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211457,340282366920938463463374607431768211458] } -{"m1.X_HI": [0,0,1], "m1.X_LO": [0,0,1], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211458] } -{"m1.X_HI": [0,0,0], "m1.X_LO": [0,340282366920938463463374607431768211455,340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211454,340282366920938463463374607431768211456,340282366920938463463374607431768211457] } +{"m1.X_HI": [0, 0], "m1.X_LO": [0, 340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211454, 340282366920938463463374607431768211456], "m1.X": [0, 340282366920938463463374607431768211455]} +{"m1.X_HI": [0, 1], "m1.X_LO": [0, 0], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211457], "m1.X": [0, 340282366920938463463374607431768211456]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 0, 340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211454, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457], "m1.X": [0, 0, 340282366920938463463374607431768211455]} +{"m1.X_HI": [0, 0, 1], "m1.X_LO": [0, 0, 0], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211457, 340282366920938463463374607431768211458], "m1.X": [0, 0, 340282366920938463463374607431768211456]} +{"m1.X_HI": [0, 0, 1], "m1.X_LO": [0, 0, 1], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211458], "m1.X": [0, 0, 340282366920938463463374607431768211457]} +{"m1.X_HI": [0, 0, 0], "m1.X_LO": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211454, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457], "m1.X": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211455]} -{"m1.X_HI": [0,0,1], "m1.X_LO": [0,340282366920938463463374607431768211455,0], "m2.Y": [340282366920938463463374607431768211454,340282366920938463463374607431768211456,340282366920938463463374607431768211457] } -{"m1.X_HI": [0,0,1], "m1.X_LO": [0,340282366920938463463374607431768211455,0], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211457,340282366920938463463374607431768211458] } -{"m1.X_HI": [0,0,1], "m1.X_LO": [0,340282366920938463463374607431768211455,2], "m2.Y": [340282366920938463463374607431768211454,340282366920938463463374607431768211456,340282366920938463463374607431768211457,340282366920938463463374607431768211458] } -{"m1.X_HI": [0,0,1], "m1.X_LO": [0,340282366920938463463374607431768211455,2], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457,340282366920938463463374607431768211459] } -{"m1.X_HI": [0,1,1], "m1.X_LO": [0,1,2], "m2.Y": [340282366920938463463374607431768211454,340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211458] } -{"m1.X_HI": [0,1,1], "m1.X_LO": [0,1,2], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457,340282366920938463463374607431768211459] } +{"m1.X_HI": [0, 0, 1], "m1.X_LO": [0, 340282366920938463463374607431768211455, 0], "m2.Y": [340282366920938463463374607431768211454, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457], "m1.X": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211456]} +{"m1.X_HI": [0, 0, 1], "m1.X_LO": [0, 340282366920938463463374607431768211455, 0], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211457, 340282366920938463463374607431768211458], "m1.X": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211456]} +{"m1.X_HI": [0, 0, 1], "m1.X_LO": [0, 340282366920938463463374607431768211455, 2], "m2.Y": [340282366920938463463374607431768211454, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457, 340282366920938463463374607431768211458], "m1.X": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211458]} +{"m1.X_HI": [0, 0, 1], "m1.X_LO": [0, 340282366920938463463374607431768211455, 2], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457, 340282366920938463463374607431768211459], "m1.X": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211458]} +{"m1.X_HI": [0, 1, 1], "m1.X_LO": [0, 1, 2], "m2.Y": [340282366920938463463374607431768211454, 340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211458], "m1.X": [0, 340282366920938463463374607431768211457, 340282366920938463463374607431768211458]} +{"m1.X_HI": [0, 1, 1], "m1.X_LO": [0, 1, 2], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457, 340282366920938463463374607431768211459], "m1.X": [0, 340282366920938463463374607431768211457, 340282366920938463463374607431768211458]} diff --git a/testdata/corset/agnostic/lookup_06.accepts b/testdata/corset/agnostic/lookup_06.accepts index 29565cfc6..bd19f07b8 100644 --- a/testdata/corset/agnostic/lookup_06.accepts +++ b/testdata/corset/agnostic/lookup_06.accepts @@ -1,177 +1,177 @@ ;; 2^128=340282366920938463463374607431768211456 ;; 2^160=1461501637330902918203684832716283019655932542976 ;; 2^256=11579208923731619542357098500868790785326998466564056403945758400791312963993 -{"m1.P": [1], "m1.X": [0], "m2.Q": [1], "m2.Y": [0] } -{"m1.P": [1], "m1.X": [1], "m2.Q": [1], "m2.Y": [1] } -{"m1.P": [1], "m1.X": [2], "m2.Q": [1], "m2.Y": [2] } -{"m1.P": [1], "m1.X": [3], "m2.Q": [1], "m2.Y": [3] } +{"m1.P": [1], "m1.X": [0], "m2.Q": [1], "m2.Y": [0], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [1], "m2.Q": [1], "m2.Y": [1], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [2], "m2.Q": [1], "m2.Y": [2], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [3], "m2.Q": [1], "m2.Y": [3], "m1.ONE": [1]} ;;============================================================================== ;;u8 ;;============================================================================== -{"m1.P": [1], "m1.X": [252], "m2.Q": [1], "m2.Y": [252] } -{"m1.P": [1], "m1.X": [253], "m2.Q": [1], "m2.Y": [253] } -{"m1.P": [1], "m1.X": [254], "m2.Q": [1], "m2.Y": [254] } -{"m1.P": [1], "m1.X": [255], "m2.Q": [1], "m2.Y": [255] } -{"m1.P": [1], "m1.X": [256], "m2.Q": [1], "m2.Y": [256] } -{"m1.P": [1], "m1.X": [257], "m2.Q": [1], "m2.Y": [257] } +{"m1.P": [1], "m1.X": [252], "m2.Q": [1], "m2.Y": [252], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [253], "m2.Q": [1], "m2.Y": [253], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [254], "m2.Q": [1], "m2.Y": [254], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [255], "m2.Q": [1], "m2.Y": [255], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [256], "m2.Q": [1], "m2.Y": [256], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [257], "m2.Q": [1], "m2.Y": [257], "m1.ONE": [1]} ;; -{"m1.P": [1], "m1.X": [257], "m2.Q": [1,1], "m2.Y": [256,257] } -{"m1.P": [1], "m1.X": [257], "m2.Q": [0,1], "m2.Y": [256,257] } -{"m1.P": [1], "m1.X": [257], "m2.Q": [1,1,1], "m2.Y": [256,257,258] } -{"m1.P": [1], "m1.X": [257], "m2.Q": [0,1,1], "m2.Y": [256,257,258] } -{"m1.P": [1], "m1.X": [257], "m2.Q": [1,1,0], "m2.Y": [256,257,258] } -{"m1.P": [1], "m1.X": [257], "m2.Q": [0,1,0], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,257], "m2.Q": [1,1,1], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,258], "m2.Q": [1,1,1], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,257], "m2.Q": [0,1,1], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,257], "m2.Q": [0,1,0], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,258], "m2.Q": [0,1,1], "m2.Y": [256,257,258] } +{"m1.P": [1], "m1.X": [257], "m2.Q": [1, 1], "m2.Y": [256, 257], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [257], "m2.Q": [0, 1], "m2.Y": [256, 257], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [257], "m2.Q": [1, 1, 1], "m2.Y": [256, 257, 258], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [257], "m2.Q": [0, 1, 1], "m2.Y": [256, 257, 258], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [257], "m2.Q": [1, 1, 0], "m2.Y": [256, 257, 258], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [257], "m2.Q": [0, 1, 0], "m2.Y": [256, 257, 258], "m1.ONE": [1]} +{"m1.P": [1, 1], "m1.X": [257, 257], "m2.Q": [1, 1, 1], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [257, 258], "m2.Q": [1, 1, 1], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [257, 257], "m2.Q": [0, 1, 1], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [257, 257], "m2.Q": [0, 1, 0], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [257, 258], "m2.Q": [0, 1, 1], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} ;;============================================================================== ;;u16 ;;============================================================================== -{"m1.P": [1], "m1.X": [65530], "m2.Q": [1], "m2.Y": [65530] } -{"m1.P": [1], "m1.X": [65531], "m2.Q": [1], "m2.Y": [65531] } -{"m1.P": [1], "m1.X": [65532], "m2.Q": [1], "m2.Y": [65532] } -{"m1.P": [1], "m1.X": [65533], "m2.Q": [1], "m2.Y": [65533] } -{"m1.P": [1], "m1.X": [65534], "m2.Q": [1], "m2.Y": [65534] } -{"m1.P": [1], "m1.X": [65535], "m2.Q": [1], "m2.Y": [65535] } -{"m1.P": [1], "m1.X": [65536], "m2.Q": [1], "m2.Y": [65536] } -{"m1.P": [1], "m1.X": [65537], "m2.Q": [1], "m2.Y": [65537] } -{"m1.P": [1], "m1.X": [65538], "m2.Q": [1], "m2.Y": [65538] } -{"m1.P": [1], "m1.X": [65539], "m2.Q": [1], "m2.Y": [65539] } -{"m1.P": [1], "m1.X": [65540], "m2.Q": [1], "m2.Y": [65540] } +{"m1.P": [1], "m1.X": [65530], "m2.Q": [1], "m2.Y": [65530], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65531], "m2.Q": [1], "m2.Y": [65531], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65532], "m2.Q": [1], "m2.Y": [65532], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65533], "m2.Q": [1], "m2.Y": [65533], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65534], "m2.Q": [1], "m2.Y": [65534], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65535], "m2.Q": [1], "m2.Y": [65535], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65536], "m2.Q": [1], "m2.Y": [65536], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65537], "m2.Q": [1], "m2.Y": [65537], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65538], "m2.Q": [1], "m2.Y": [65538], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65539], "m2.Q": [1], "m2.Y": [65539], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65540], "m2.Q": [1], "m2.Y": [65540], "m1.ONE": [1]} ;; -{"m1.P": [1,1], "m1.X": [65534,65534], "m2.Q": [1,0], "m2.Y": [65534,65535] } -{"m1.P": [1,1], "m1.X": [65534,65534], "m2.Q": [1,1], "m2.Y": [65534,65535] } -{"m1.P": [1,1], "m1.X": [65535,65535], "m2.Q": [1,0], "m2.Y": [65535,65536] } -{"m1.P": [1,1], "m1.X": [65535,65535], "m2.Q": [1,1], "m2.Y": [65535,65536] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [1,1], "m2.Y": [65534,65535] } -{"m1.P": [1,1], "m1.X": [65533,65536], "m2.Q": [1,1], "m2.Y": [65533,65536] } -{"m1.P": [1,1], "m1.X": [65533,65536], "m2.Q": [1,1,0], "m2.Y": [65533,65536,65537] } -{"m1.P": [1,1], "m1.X": [65533,65536], "m2.Q": [1,1,1], "m2.Y": [65533,65536,65537] } +{"m1.P": [1, 1], "m1.X": [65534, 65534], "m2.Q": [1, 0], "m2.Y": [65534, 65535], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65534], "m2.Q": [1, 1], "m2.Y": [65534, 65535], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65535, 65535], "m2.Q": [1, 0], "m2.Y": [65535, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65535, 65535], "m2.Q": [1, 1], "m2.Y": [65535, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [1, 1], "m2.Y": [65534, 65535], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65533, 65536], "m2.Q": [1, 1], "m2.Y": [65533, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65533, 65536], "m2.Q": [1, 1, 0], "m2.Y": [65533, 65536, 65537], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65533, 65536], "m2.Q": [1, 1, 1], "m2.Y": [65533, 65536, 65537], "m1.ONE": [1, 1]} -{"m1.P": [1,1], "m1.X": [65533,65536], "m2.Q": [0,1,1,0], "m2.Y": [201,65533,65536,65537] } -{"m1.P": [1,1], "m1.X": [65533,65536], "m2.Q": [0,1,1,1], "m2.Y": [201,65533,65536,65537] } -{"m1.P": [1,1], "m1.X": [65533,65536], "m2.Q": [1,1,1,0], "m2.Y": [201,65533,65536,65537] } -{"m1.P": [1,1], "m1.X": [65533,65536], "m2.Q": [1,1,1,1], "m2.Y": [201,65533,65536,65537] } +{"m1.P": [1, 1], "m1.X": [65533, 65536], "m2.Q": [0, 1, 1, 0], "m2.Y": [201, 65533, 65536, 65537], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65533, 65536], "m2.Q": [0, 1, 1, 1], "m2.Y": [201, 65533, 65536, 65537], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65533, 65536], "m2.Q": [1, 1, 1, 0], "m2.Y": [201, 65533, 65536, 65537], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65533, 65536], "m2.Q": [1, 1, 1, 1], "m2.Y": [201, 65533, 65536, 65537], "m1.ONE": [1, 1]} ;;============================================================================== ;;u17 ;;============================================================================== -{"m1.P": [1], "m1.X": [131070], "m2.Q": [1], "m2.Y": [131070] } -{"m1.P": [1], "m1.X": [131071], "m2.Q": [1], "m2.Y": [131071] } -{"m1.P": [1], "m1.X": [131072], "m2.Q": [1], "m2.Y": [131072] } -{"m1.P": [1], "m1.X": [131073], "m2.Q": [1], "m2.Y": [131073] } -{"m1.P": [1], "m1.X": [131074], "m2.Q": [1], "m2.Y": [131074] } -{"m1.P": [1], "m1.X": [131075], "m2.Q": [1], "m2.Y": [131075] } +{"m1.P": [1], "m1.X": [131070], "m2.Q": [1], "m2.Y": [131070], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [131071], "m2.Q": [1], "m2.Y": [131071], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [131072], "m2.Q": [1], "m2.Y": [131072], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [131073], "m2.Q": [1], "m2.Y": [131073], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [131074], "m2.Q": [1], "m2.Y": [131074], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [131075], "m2.Q": [1], "m2.Y": [131075], "m1.ONE": [1]} ;; -{"m1.P": [0,0], "m1.X": [131071,131071], "m2.Q": [1,0], "m2.Y": [131071,131072] } -{"m1.P": [0,0], "m1.X": [131071,131071], "m2.Q": [1,1], "m2.Y": [131071,131072] } -{"m1.P": [0,0], "m1.X": [131072,131072], "m2.Q": [1,0], "m2.Y": [131072,131073] } -{"m1.P": [0,0], "m1.X": [131072,131072], "m2.Q": [1,1], "m2.Y": [131072,131073] } -{"m1.P": [0,0], "m1.X": [131072,131073], "m2.Q": [1,1], "m2.Y": [131072,131073] } -{"m1.P": [0,0], "m1.X": [131072,131074], "m2.Q": [1,1], "m2.Y": [131072,131074] } -{"m1.P": [0,0], "m1.X": [131072,131074], "m2.Q": [1,0,1], "m2.Y": [131072,131073,131074] } -{"m1.P": [0,0], "m1.X": [131072,131074], "m2.Q": [1,1,1], "m2.Y": [131072,131073,131074] } -{"m1.P": [0,0], "m1.X": [131072,131074], "m2.Q": [0,1,0,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [0,0], "m1.X": [131072,131074], "m2.Q": [1,1,0,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [0,0], "m1.X": [131072,131074], "m2.Q": [0,1,1,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [0,0], "m1.X": [131072,131074], "m2.Q": [1,1,1,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [0,0], "m1.X": [131072,131074], "m2.Q": [0,0,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [0,0], "m1.X": [131072,131074], "m2.Q": [1,0,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [0,0], "m1.X": [131072,131074], "m2.Q": [0,1,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [0,0], "m1.X": [131072,131074], "m2.Q": [0,0,1,1,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [0,0], "m1.X": [131072,131074], "m2.Q": [1,0,1,1,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [0,0], "m1.X": [131072,131074], "m2.Q": [1,1,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [0,0], "m1.X": [131072,131074], "m2.Q": [1,1,1,1,1], "m2.Y": [223,131071,131072,131073,131074] } +{"m1.P": [0, 0], "m1.X": [131071, 131071], "m2.Q": [1, 0], "m2.Y": [131071, 131072], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131071, 131071], "m2.Q": [1, 1], "m2.Y": [131071, 131072], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131072], "m2.Q": [1, 0], "m2.Y": [131072, 131073], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131072], "m2.Q": [1, 1], "m2.Y": [131072, 131073], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131073], "m2.Q": [1, 1], "m2.Y": [131072, 131073], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131074], "m2.Q": [1, 1], "m2.Y": [131072, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131074], "m2.Q": [1, 0, 1], "m2.Y": [131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1], "m2.Y": [131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131074], "m2.Q": [0, 1, 0, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131074], "m2.Q": [1, 1, 0, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131074], "m2.Q": [0, 1, 1, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131074], "m2.Q": [0, 0, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131074], "m2.Q": [1, 0, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131074], "m2.Q": [0, 1, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131074], "m2.Q": [0, 0, 1, 1, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131074], "m2.Q": [1, 0, 1, 1, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 0], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1, 1, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} -{"m1.P": [0,1], "m1.X": [131071,131071], "m2.Q": [1,0], "m2.Y": [131071,131072] } -{"m1.P": [0,1], "m1.X": [131071,131071], "m2.Q": [1,1], "m2.Y": [131071,131072] } -{"m1.P": [0,1], "m1.X": [131072,131072], "m2.Q": [1,0], "m2.Y": [131072,131073] } -{"m1.P": [0,1], "m1.X": [131072,131072], "m2.Q": [1,1], "m2.Y": [131072,131073] } -{"m1.P": [0,1], "m1.X": [131072,131073], "m2.Q": [1,1], "m2.Y": [131072,131073] } -{"m1.P": [0,1], "m1.X": [131072,131074], "m2.Q": [1,1], "m2.Y": [131072,131074] } -{"m1.P": [0,1], "m1.X": [131072,131074], "m2.Q": [1,0,1], "m2.Y": [131072,131073,131074] } -{"m1.P": [0,1], "m1.X": [131072,131074], "m2.Q": [1,1,1], "m2.Y": [131072,131073,131074] } -{"m1.P": [0,1], "m1.X": [131072,131074], "m2.Q": [0,1,0,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [0,1], "m1.X": [131072,131074], "m2.Q": [1,1,0,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [0,1], "m1.X": [131072,131074], "m2.Q": [0,1,1,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [0,1], "m1.X": [131072,131074], "m2.Q": [1,1,1,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [0,1], "m1.X": [131072,131074], "m2.Q": [0,0,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [0,1], "m1.X": [131072,131074], "m2.Q": [1,0,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [0,1], "m1.X": [131072,131074], "m2.Q": [0,1,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [0,1], "m1.X": [131072,131074], "m2.Q": [0,0,1,1,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [0,1], "m1.X": [131072,131074], "m2.Q": [1,0,1,1,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [0,1], "m1.X": [131072,131074], "m2.Q": [1,1,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [0,1], "m1.X": [131072,131074], "m2.Q": [1,1,1,1,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [1,0], "m1.X": [131071,131071], "m2.Q": [1,0], "m2.Y": [131071,131072] } -{"m1.P": [1,0], "m1.X": [131071,131071], "m2.Q": [1,1], "m2.Y": [131071,131072] } -{"m1.P": [1,0], "m1.X": [131072,131072], "m2.Q": [1,0], "m2.Y": [131072,131073] } -{"m1.P": [1,0], "m1.X": [131072,131072], "m2.Q": [1,1], "m2.Y": [131072,131073] } -{"m1.P": [1,0], "m1.X": [131072,131073], "m2.Q": [1,1], "m2.Y": [131072,131073] } -{"m1.P": [1,0], "m1.X": [131072,131074], "m2.Q": [1,1], "m2.Y": [131072,131074] } -{"m1.P": [1,0], "m1.X": [131072,131074], "m2.Q": [1,0,1], "m2.Y": [131072,131073,131074] } -{"m1.P": [1,0], "m1.X": [131072,131074], "m2.Q": [1,1,1], "m2.Y": [131072,131073,131074] } -{"m1.P": [1,0], "m1.X": [131072,131074], "m2.Q": [0,1,0,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [1,0], "m1.X": [131072,131074], "m2.Q": [1,1,0,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [1,0], "m1.X": [131072,131074], "m2.Q": [0,1,1,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [1,0], "m1.X": [131072,131074], "m2.Q": [1,1,1,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [1,0], "m1.X": [131072,131074], "m2.Q": [0,0,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [1,0], "m1.X": [131072,131074], "m2.Q": [1,0,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [1,0], "m1.X": [131072,131074], "m2.Q": [0,1,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [1,0], "m1.X": [131072,131074], "m2.Q": [0,0,1,1,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [1,0], "m1.X": [131072,131074], "m2.Q": [1,0,1,1,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [1,0], "m1.X": [131072,131074], "m2.Q": [1,1,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [1,0], "m1.X": [131072,131074], "m2.Q": [1,1,1,1,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131071,131071], "m2.Q": [1,0], "m2.Y": [131071,131072] } -{"m1.P": [1,1], "m1.X": [131071,131071], "m2.Q": [1,1], "m2.Y": [131071,131072] } -{"m1.P": [1,1], "m1.X": [131072,131072], "m2.Q": [1,0], "m2.Y": [131072,131073] } -{"m1.P": [1,1], "m1.X": [131072,131072], "m2.Q": [1,1], "m2.Y": [131072,131073] } -{"m1.P": [1,1], "m1.X": [131072,131073], "m2.Q": [1,1], "m2.Y": [131072,131073] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [1,1], "m2.Y": [131072,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [1,0,1], "m2.Y": [131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [1,1,1], "m2.Y": [131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [0,1,0,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [1,1,0,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [0,1,1,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [1,1,1,1], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [0,0,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [1,0,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [0,1,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [0,0,1,1,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [1,0,1,1,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [1,1,1,0,1], "m2.Y": [223,131071,131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [1,1,1,1,1], "m2.Y": [223,131071,131072,131073,131074] } +{"m1.P": [0, 1], "m1.X": [131071, 131071], "m2.Q": [1, 0], "m2.Y": [131071, 131072], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131071, 131071], "m2.Q": [1, 1], "m2.Y": [131071, 131072], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131072], "m2.Q": [1, 0], "m2.Y": [131072, 131073], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131072], "m2.Q": [1, 1], "m2.Y": [131072, 131073], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131073], "m2.Q": [1, 1], "m2.Y": [131072, 131073], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131074], "m2.Q": [1, 1], "m2.Y": [131072, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131074], "m2.Q": [1, 0, 1], "m2.Y": [131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1], "m2.Y": [131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131074], "m2.Q": [0, 1, 0, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131074], "m2.Q": [1, 1, 0, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131074], "m2.Q": [0, 1, 1, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131074], "m2.Q": [0, 0, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131074], "m2.Q": [1, 0, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131074], "m2.Q": [0, 1, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131074], "m2.Q": [0, 0, 1, 1, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131074], "m2.Q": [1, 0, 1, 1, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1, 1, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131071, 131071], "m2.Q": [1, 0], "m2.Y": [131071, 131072], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131071, 131071], "m2.Q": [1, 1], "m2.Y": [131071, 131072], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131072], "m2.Q": [1, 0], "m2.Y": [131072, 131073], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131072], "m2.Q": [1, 1], "m2.Y": [131072, 131073], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131073], "m2.Q": [1, 1], "m2.Y": [131072, 131073], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131074], "m2.Q": [1, 1], "m2.Y": [131072, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131074], "m2.Q": [1, 0, 1], "m2.Y": [131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1], "m2.Y": [131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131074], "m2.Q": [0, 1, 0, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131074], "m2.Q": [1, 1, 0, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131074], "m2.Q": [0, 1, 1, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131074], "m2.Q": [0, 0, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131074], "m2.Q": [1, 0, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131074], "m2.Q": [0, 1, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131074], "m2.Q": [0, 0, 1, 1, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131074], "m2.Q": [1, 0, 1, 1, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1, 1, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131071, 131071], "m2.Q": [1, 0], "m2.Y": [131071, 131072], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131071, 131071], "m2.Q": [1, 1], "m2.Y": [131071, 131072], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131072], "m2.Q": [1, 0], "m2.Y": [131072, 131073], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131072], "m2.Q": [1, 1], "m2.Y": [131072, 131073], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131073], "m2.Q": [1, 1], "m2.Y": [131072, 131073], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [1, 1], "m2.Y": [131072, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [1, 0, 1], "m2.Y": [131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1], "m2.Y": [131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [0, 1, 0, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [1, 1, 0, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [0, 1, 1, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1, 1], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [0, 0, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [1, 0, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [0, 1, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [0, 0, 1, 1, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [1, 0, 1, 1, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1, 0, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [1, 1, 1, 1, 1], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} ;;============================================================================== ;;u128 ;;============================================================================== -{"m1.P": [1], "m1.X": [7431768211449], "m2.Q": [1], "m2.Y": [7431768211449] } -{"m1.P": [1], "m1.X": [63374607431768211449], "m2.Q": [1], "m2.Y": [63374607431768211449] } -{"m1.P": [1], "m1.X": [38463463374607431768211449], "m2.Q": [1], "m2.Y": [38463463374607431768211449] } -{"m1.P": [1], "m1.X": [66920938463463374607431768211449], "m2.Q": [1], "m2.Y": [66920938463463374607431768211449] } -{"m1.P": [1], "m1.X": [366920938463463374607431768211449], "m2.Q": [1], "m2.Y": [366920938463463374607431768211449] } -{"m1.P": [1], "m1.X": [2366920938463463374607431768211449], "m2.Q": [1], "m2.Y": [2366920938463463374607431768211449] } -{"m1.P": [1], "m1.X": [82366920938463463374607431768211449], "m2.Q": [1], "m2.Y": [82366920938463463374607431768211449] } -{"m1.P": [1], "m1.X": [282366920938463463374607431768211449], "m2.Q": [1], "m2.Y": [282366920938463463374607431768211449] } -{"m1.P": [1], "m1.X": [40282366920938463463374607431768211449], "m2.Q": [1], "m2.Y": [40282366920938463463374607431768211449] } -{"m1.P": [1], "m1.X": [340282366920938012012012012012012012012], "m2.Q": [1], "m2.Y": [340282366920938012012012012012012012012] } -{"m1.P": [1], "m1.X": [340282366920938463463370101010101010101], "m2.Q": [1], "m2.Y": [340282366920938463463370101010101010101] } -{"m1.P": [1], "m1.X": [340282366920938463463374607401010101010], "m2.Q": [1], "m2.Y": [340282366920938463463374607401010101010] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431760000001], "m2.Q": [1], "m2.Y": [340282366920938463463374607431760000001] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211300], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211300] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211400], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211400] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211448], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211448] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211449], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211449] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211450], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211450] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211451], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211451] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211452], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211452] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211453], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211453] } +{"m1.P": [1], "m1.X": [7431768211449], "m2.Q": [1], "m2.Y": [7431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [63374607431768211449], "m2.Q": [1], "m2.Y": [63374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [38463463374607431768211449], "m2.Q": [1], "m2.Y": [38463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [66920938463463374607431768211449], "m2.Q": [1], "m2.Y": [66920938463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [366920938463463374607431768211449], "m2.Q": [1], "m2.Y": [366920938463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [2366920938463463374607431768211449], "m2.Q": [1], "m2.Y": [2366920938463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [82366920938463463374607431768211449], "m2.Q": [1], "m2.Y": [82366920938463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [282366920938463463374607431768211449], "m2.Q": [1], "m2.Y": [282366920938463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [40282366920938463463374607431768211449], "m2.Q": [1], "m2.Y": [40282366920938463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938012012012012012012012012], "m2.Q": [1], "m2.Y": [340282366920938012012012012012012012012], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463370101010101010101], "m2.Q": [1], "m2.Y": [340282366920938463463370101010101010101], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607401010101010], "m2.Q": [1], "m2.Y": [340282366920938463463374607401010101010], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431760000001], "m2.Q": [1], "m2.Y": [340282366920938463463374607431760000001], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211300], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211300], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211400], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211400], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211448], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211448], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211449], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211450], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211450], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211451], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211451], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211452], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211452], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211453], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211453], "m1.ONE": [1]} ;; -{"m1.P": [1,1], "m1.X": [340282366920938463463374607431768211453,340282366920938463463374607431768211453], "m2.Q": [1,1], "m2.Y": [340282366920938463463374607431768211453,340282366920938463463374607431768211453] } -{"m1.P": [1,1], "m1.X": [340282366920938463463374607431768211452,340282366920938463463374607431768211452], "m2.Q": [1,1], "m2.Y": [340282366920938463463374607431768211452,340282366920938463463374607431768211453] } -{"m1.P": [1,1], "m1.X": [340282366920938463463374607431768211453,340282366920938463463374607431768211453], "m2.Q": [1,1], "m2.Y": [340282366920938463463374607431768211452,340282366920938463463374607431768211453] } -{"m1.P": [1,1], "m1.X": [340282366920938463463374607431768211453,340282366920938463463374607431768211453], "m2.Q": [1,1], "m2.Y": [340282366920938463463374607431768211453,340282366920938463463374607431768211452] } -{"m1.P": [1,1], "m1.X": [340282366920938463463374607431768211452,340282366920938463463374607431768211453], "m2.Q": [1,1], "m2.Y": [340282366920938463463374607431768211452,340282366920938463463374607431768211453] } -{"m1.P": [1,1], "m1.X": [340282366920938463463374607431768211452,340282366920938463463374607431768211453], "m2.Q": [1,1,1], "m2.Y": [340282366920938463463374607431768211452,340282366920938463463374607431768211453,340282366920938463463374607431768211454] } +{"m1.P": [1, 1], "m1.X": [340282366920938463463374607431768211453, 340282366920938463463374607431768211453], "m2.Q": [1, 1], "m2.Y": [340282366920938463463374607431768211453, 340282366920938463463374607431768211453], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [340282366920938463463374607431768211452, 340282366920938463463374607431768211452], "m2.Q": [1, 1], "m2.Y": [340282366920938463463374607431768211452, 340282366920938463463374607431768211453], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [340282366920938463463374607431768211453, 340282366920938463463374607431768211453], "m2.Q": [1, 1], "m2.Y": [340282366920938463463374607431768211452, 340282366920938463463374607431768211453], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [340282366920938463463374607431768211453, 340282366920938463463374607431768211453], "m2.Q": [1, 1], "m2.Y": [340282366920938463463374607431768211453, 340282366920938463463374607431768211452], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [340282366920938463463374607431768211452, 340282366920938463463374607431768211453], "m2.Q": [1, 1], "m2.Y": [340282366920938463463374607431768211452, 340282366920938463463374607431768211453], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [340282366920938463463374607431768211452, 340282366920938463463374607431768211453], "m2.Q": [1, 1, 1], "m2.Y": [340282366920938463463374607431768211452, 340282366920938463463374607431768211453, 340282366920938463463374607431768211454], "m1.ONE": [1, 1]} diff --git a/testdata/corset/agnostic/lookup_06.bls12_377.rejects b/testdata/corset/agnostic/lookup_06.bls12_377.rejects index 060c5b7e5..566219a35 100644 --- a/testdata/corset/agnostic/lookup_06.bls12_377.rejects +++ b/testdata/corset/agnostic/lookup_06.bls12_377.rejects @@ -1,15 +1,15 @@ -{"m1.P": [1,1], "m1.X": [1461501637330902918203684832716283019655932542979,1461501637330902918203684832716283019655932542980], "m2.Q": [1,1], "m2.Y": [1461501637330902918203684832716283019655932542980,1461501637330902918203684832716283019655932542980] } -{"m1.P": [1,1], "m1.X": [1461501637330902918203684832716283019655932542980,1461501637330902918203684832716283019655932542981], "m2.Q": [1,1], "m2.Y": [1461501637330902918203684832716283019655932542980,1461501637330902918203684832716283019655932542980] } -{"m1.P": [1,1], "m1.X": [1461501637330902918203684832716283019655932542979,1461501637330902918203684832716283019655932542981], "m2.Q": [1,1], "m2.Y": [1461501637330902918203684832716283019655932542980,1461501637330902918203684832716283019655932542980] } +{"m1.P": [1, 1], "m1.X": [1461501637330902918203684832716283019655932542979, 1461501637330902918203684832716283019655932542980], "m2.Q": [1, 1], "m2.Y": [1461501637330902918203684832716283019655932542980, 1461501637330902918203684832716283019655932542980], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [1461501637330902918203684832716283019655932542980, 1461501637330902918203684832716283019655932542981], "m2.Q": [1, 1], "m2.Y": [1461501637330902918203684832716283019655932542980, 1461501637330902918203684832716283019655932542980], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [1461501637330902918203684832716283019655932542979, 1461501637330902918203684832716283019655932542981], "m2.Q": [1, 1], "m2.Y": [1461501637330902918203684832716283019655932542980, 1461501637330902918203684832716283019655932542980], "m1.ONE": [1, 1]} ;; -{"m1.P": [1,1], "m1.X": [1461501637330902918203684832716283019655932542979,1461501637330902918203684832716283019655932542980], "m2.Q": [1,1], "m2.Y": [1461501637330902918203684832716283019655932542980,1461501637330902918203684832716283019655932542981] } -{"m1.P": [1,1], "m1.X": [1461501637330902918203684832716283019655932542980,1461501637330902918203684832716283019655932542981], "m2.Q": [1,1], "m2.Y": [1461501637330902918203684832716283019655932542979,1461501637330902918203684832716283019655932542980] } -{"m1.P": [1,1], "m1.X": [1461501637330902918203684832716283019655932542979,1461501637330902918203684832716283019655932542981], "m2.Q": [1,1], "m2.Y": [1461501637330902918203684832716283019655932542979,1461501637330902918203684832716283019655932542980] } -{"m1.P": [1,1], "m1.X": [1461501637330902918203684832716283019655932542979,1461501637330902918203684832716283019655932542981], "m2.Q": [1,1], "m2.Y": [1461501637330902918203684832716283019655932542980,1461501637330902918203684832716283019655932542981] } +{"m1.P": [1, 1], "m1.X": [1461501637330902918203684832716283019655932542979, 1461501637330902918203684832716283019655932542980], "m2.Q": [1, 1], "m2.Y": [1461501637330902918203684832716283019655932542980, 1461501637330902918203684832716283019655932542981], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [1461501637330902918203684832716283019655932542980, 1461501637330902918203684832716283019655932542981], "m2.Q": [1, 1], "m2.Y": [1461501637330902918203684832716283019655932542979, 1461501637330902918203684832716283019655932542980], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [1461501637330902918203684832716283019655932542979, 1461501637330902918203684832716283019655932542981], "m2.Q": [1, 1], "m2.Y": [1461501637330902918203684832716283019655932542979, 1461501637330902918203684832716283019655932542980], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [1461501637330902918203684832716283019655932542979, 1461501637330902918203684832716283019655932542981], "m2.Q": [1, 1], "m2.Y": [1461501637330902918203684832716283019655932542980, 1461501637330902918203684832716283019655932542981], "m1.ONE": [1, 1]} ;; -{"m1.P": [1], "m1.X": [1461501637330902918203684832716283019655932542970], "m2.Q": [0], "m2.Y": [1461501637330902918203684832716283019655932542970] } -{"m1.P": [1], "m1.X": [1461501637330902918203684832716283019655932542971], "m2.Q": [0], "m2.Y": [1461501637330902918203684832716283019655932542971] } -{"m1.P": [1], "m1.X": [1461501637330902918203684832716283019655932542972], "m2.Q": [0], "m2.Y": [1461501637330902918203684832716283019655932542972] } -{"m1.P": [1], "m1.X": [1461501637330902918203684832716283019655932542973], "m2.Q": [0], "m2.Y": [1461501637330902918203684832716283019655932542973] } -{"m1.P": [1], "m1.X": [1461501637330902918203684832716283019655932542974], "m2.Q": [0], "m2.Y": [1461501637330902918203684832716283019655932542974] } -{"m1.P": [1], "m1.X": [1461501637330902918203684832716283019655932542975], "m2.Q": [0], "m2.Y": [1461501637330902918203684832716283019655932542975] } +{"m1.P": [1], "m1.X": [1461501637330902918203684832716283019655932542970], "m2.Q": [0], "m2.Y": [1461501637330902918203684832716283019655932542970], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [1461501637330902918203684832716283019655932542971], "m2.Q": [0], "m2.Y": [1461501637330902918203684832716283019655932542971], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [1461501637330902918203684832716283019655932542972], "m2.Q": [0], "m2.Y": [1461501637330902918203684832716283019655932542972], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [1461501637330902918203684832716283019655932542973], "m2.Q": [0], "m2.Y": [1461501637330902918203684832716283019655932542973], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [1461501637330902918203684832716283019655932542974], "m2.Q": [0], "m2.Y": [1461501637330902918203684832716283019655932542974], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [1461501637330902918203684832716283019655932542975], "m2.Q": [0], "m2.Y": [1461501637330902918203684832716283019655932542975], "m1.ONE": [1]} diff --git a/testdata/corset/agnostic/lookup_06.lisp b/testdata/corset/agnostic/lookup_06.lisp index 7262f2155..b23b586b8 100644 --- a/testdata/corset/agnostic/lookup_06.lisp +++ b/testdata/corset/agnostic/lookup_06.lisp @@ -1,7 +1,9 @@ (module m1) ;; -(defcolumns (P :i1) (X :i128)) -(defclookup l1 (m2.Q m2.Y) P (1 X)) +(defcolumns (P :i1) (X :i128) (ONE :i1 :padding 1)) +;; ONE holds the value of the constant source 1 +(defconstraint one_def () (== ONE 1)) +(defclookup l1 (m2.Q m2.Y) P (ONE X)) (module m2) (defcolumns (Q :i256) (Y :i128)) diff --git a/testdata/corset/agnostic/lookup_06.rejects b/testdata/corset/agnostic/lookup_06.rejects index 765402534..77218a11c 100644 --- a/testdata/corset/agnostic/lookup_06.rejects +++ b/testdata/corset/agnostic/lookup_06.rejects @@ -1,159 +1,159 @@ ;; 2^128=340282366920938463463374607431768211456 ;; 2^160=1461501637330902918203684832716283019655932542976 ;; 2^256=11579208923731619542357098500868790785326998466564056403945758400791312963993 -{"m1.P": [1], "m1.X": [1], "m2.Q": [], "m2.Y": [] } -{"m1.P": [0,1], "m1.X": [1,2], "m2.Q": [0], "m2.Y": [1] } -{"m1.P": [1,1], "m1.X": [1,2], "m2.Q": [0], "m2.Y": [1] } -{"m1.P": [1,0], "m1.X": [1,2], "m2.Q": [0], "m2.Y": [2] } -{"m1.P": [1,1], "m1.X": [1,2], "m2.Q": [0], "m2.Y": [2] } -{"m1.P": [0,1], "m1.X": [1,2], "m2.Q": [1], "m2.Y": [1] } -{"m1.P": [1,1], "m1.X": [1,2], "m2.Q": [1], "m2.Y": [1] } -{"m1.P": [1,1], "m1.X": [1,2], "m2.Q": [1], "m2.Y": [2] } -{"m1.P": [1,0], "m1.X": [1,2], "m2.Q": [1], "m2.Y": [2] } +{"m1.P": [1], "m1.X": [1], "m2.Q": [], "m2.Y": [], "m1.ONE": [1]} +{"m1.P": [0, 1], "m1.X": [1, 2], "m2.Q": [0], "m2.Y": [1], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [1, 2], "m2.Q": [0], "m2.Y": [1], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [1, 2], "m2.Q": [0], "m2.Y": [2], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [1, 2], "m2.Q": [0], "m2.Y": [2], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [1, 2], "m2.Q": [1], "m2.Y": [1], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [1, 2], "m2.Q": [1], "m2.Y": [1], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [1, 2], "m2.Q": [1], "m2.Y": [2], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [1, 2], "m2.Q": [1], "m2.Y": [2], "m1.ONE": [1, 1]} ;; -{"m1.P": [1,1], "m1.X": [254,255], "m2.Q": [0], "m2.Y": [254] } -{"m1.P": [1,1], "m1.X": [254,255], "m2.Q": [0], "m2.Y": [255] } -{"m1.P": [1,1], "m1.X": [254,255], "m2.Q": [0], "m2.Y": [256] } -{"m1.P": [1,1], "m1.X": [254,255], "m2.Q": [1], "m2.Y": [254] } -{"m1.P": [1,1], "m1.X": [254,255], "m2.Q": [1], "m2.Y": [255] } -{"m1.P": [1,1], "m1.X": [254,255], "m2.Q": [1], "m2.Y": [256] } -{"m1.P": [0,1], "m1.X": [254,255], "m2.Q": [0,0], "m2.Y": [255,255] } -{"m1.P": [1,1], "m1.X": [254,255], "m2.Q": [0,0], "m2.Y": [255,255] } -{"m1.P": [1,0], "m1.X": [254,255], "m2.Q": [1,0], "m2.Y": [255,255] } -{"m1.P": [1,1], "m1.X": [254,255], "m2.Q": [1,0], "m2.Y": [255,255] } -{"m1.P": [1,0], "m1.X": [254,255], "m2.Q": [0,1], "m2.Y": [255,255] } -{"m1.P": [1,1], "m1.X": [254,255], "m2.Q": [0,1], "m2.Y": [255,255] } -{"m1.P": [1,0], "m1.X": [254,255], "m2.Q": [1,1], "m2.Y": [255,255] } -{"m1.P": [1,1], "m1.X": [254,255], "m2.Q": [1,1], "m2.Y": [255,255] } +{"m1.P": [1, 1], "m1.X": [254, 255], "m2.Q": [0], "m2.Y": [254], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [254, 255], "m2.Q": [0], "m2.Y": [255], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [254, 255], "m2.Q": [0], "m2.Y": [256], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [254, 255], "m2.Q": [1], "m2.Y": [254], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [254, 255], "m2.Q": [1], "m2.Y": [255], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [254, 255], "m2.Q": [1], "m2.Y": [256], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [254, 255], "m2.Q": [0, 0], "m2.Y": [255, 255], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [254, 255], "m2.Q": [0, 0], "m2.Y": [255, 255], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [254, 255], "m2.Q": [1, 0], "m2.Y": [255, 255], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [254, 255], "m2.Q": [1, 0], "m2.Y": [255, 255], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [254, 255], "m2.Q": [0, 1], "m2.Y": [255, 255], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [254, 255], "m2.Q": [0, 1], "m2.Y": [255, 255], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [254, 255], "m2.Q": [1, 1], "m2.Y": [255, 255], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [254, 255], "m2.Q": [1, 1], "m2.Y": [255, 255], "m1.ONE": [1, 1]} ;; -{"m1.P": [1,0], "m1.X": [65534,65535], "m2.Q": [0], "m2.Y": [65534] } -{"m1.P": [0,1], "m1.X": [65534,65535], "m2.Q": [0], "m2.Y": [65534] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [0], "m2.Y": [65534] } -{"m1.P": [1,0], "m1.X": [65534,65535], "m2.Q": [0], "m2.Y": [65535] } -{"m1.P": [0,1], "m1.X": [65534,65535], "m2.Q": [0], "m2.Y": [65535] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [0], "m2.Y": [65535] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [0], "m2.Y": [65536] } -{"m1.P": [0,1], "m1.X": [65534,65535], "m2.Q": [1], "m2.Y": [65534] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [1], "m2.Y": [65534] } -{"m1.P": [1,0], "m1.X": [65534,65535], "m2.Q": [1], "m2.Y": [65535] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [1], "m2.Y": [65535] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [1], "m2.Y": [65536] } -{"m1.P": [0,1], "m1.X": [65534,65535], "m2.Q": [0,0], "m2.Y": [65534,65536] } -{"m1.P": [1,0], "m1.X": [65534,65535], "m2.Q": [0,0], "m2.Y": [65534,65536] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [0,0], "m2.Y": [65534,65536] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [1,0], "m2.Y": [65534,65536] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [0,1], "m2.Y": [65534,65536] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [1,1], "m2.Y": [65534,65536] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [0,0], "m2.Y": [65535,65536] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [0,1], "m2.Y": [65535,65536] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [1,0], "m2.Y": [65535,65536] } -{"m1.P": [1,0], "m1.X": [65534,65535], "m2.Q": [1,1], "m2.Y": [65535,65536] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [1,1], "m2.Y": [65535,65536] } +{"m1.P": [1, 0], "m1.X": [65534, 65535], "m2.Q": [0], "m2.Y": [65534], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [65534, 65535], "m2.Q": [0], "m2.Y": [65534], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [0], "m2.Y": [65534], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [65534, 65535], "m2.Q": [0], "m2.Y": [65535], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [65534, 65535], "m2.Q": [0], "m2.Y": [65535], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [0], "m2.Y": [65535], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [0], "m2.Y": [65536], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [65534, 65535], "m2.Q": [1], "m2.Y": [65534], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [1], "m2.Y": [65534], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [65534, 65535], "m2.Q": [1], "m2.Y": [65535], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [1], "m2.Y": [65535], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [1], "m2.Y": [65536], "m1.ONE": [1, 1]} +{"m1.P": [0, 1], "m1.X": [65534, 65535], "m2.Q": [0, 0], "m2.Y": [65534, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [65534, 65535], "m2.Q": [0, 0], "m2.Y": [65534, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [0, 0], "m2.Y": [65534, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [1, 0], "m2.Y": [65534, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [0, 1], "m2.Y": [65534, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [1, 1], "m2.Y": [65534, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [0, 0], "m2.Y": [65535, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [0, 1], "m2.Y": [65535, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [1, 0], "m2.Y": [65535, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 0], "m1.X": [65534, 65535], "m2.Q": [1, 1], "m2.Y": [65535, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [1, 1], "m2.Y": [65535, 65536], "m1.ONE": [1, 1]} ;; -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211448], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211450] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211449], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211450] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211451], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211450] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211452], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211450] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211453], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211452] } +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211448], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211450], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211449], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211450], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211451], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211450], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211452], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211450], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211453], "m2.Q": [1], "m2.Y": [340282366920938463463374607431768211452], "m1.ONE": [1]} ;; ;; Disabled selector tests -{"m1.P": [1], "m1.X": [0], "m2.Q": [0], "m2.Y": [0] } -{"m1.P": [1], "m1.X": [1], "m2.Q": [0], "m2.Y": [1] } -{"m1.P": [1], "m1.X": [2], "m2.Q": [0], "m2.Y": [2] } -{"m1.P": [1], "m1.X": [3], "m2.Q": [0], "m2.Y": [3] } -{"m1.P": [1], "m1.X": [0], "m2.Q": [2], "m2.Y": [0] } -{"m1.P": [1], "m1.X": [1], "m2.Q": [2], "m2.Y": [1] } -{"m1.P": [1], "m1.X": [2], "m2.Q": [2], "m2.Y": [2] } -{"m1.P": [1], "m1.X": [3], "m2.Q": [2], "m2.Y": [3] } -{"m1.P": [1], "m1.X": [0], "m2.Q": [3], "m2.Y": [0] } -{"m1.P": [1], "m1.X": [1], "m2.Q": [3], "m2.Y": [1] } -{"m1.P": [1], "m1.X": [2], "m2.Q": [3], "m2.Y": [2] } -{"m1.P": [1], "m1.X": [3], "m2.Q": [3], "m2.Y": [3] } +{"m1.P": [1], "m1.X": [0], "m2.Q": [0], "m2.Y": [0], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [1], "m2.Q": [0], "m2.Y": [1], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [2], "m2.Q": [0], "m2.Y": [2], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [3], "m2.Q": [0], "m2.Y": [3], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [0], "m2.Q": [2], "m2.Y": [0], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [1], "m2.Q": [2], "m2.Y": [1], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [2], "m2.Q": [2], "m2.Y": [2], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [3], "m2.Q": [2], "m2.Y": [3], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [0], "m2.Q": [3], "m2.Y": [0], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [1], "m2.Q": [3], "m2.Y": [1], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [2], "m2.Q": [3], "m2.Y": [2], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [3], "m2.Q": [3], "m2.Y": [3], "m1.ONE": [1]} ;; -{"m1.P": [1], "m1.X": [252], "m2.Q": [0], "m2.Y": [252] } -{"m1.P": [1], "m1.X": [253], "m2.Q": [0], "m2.Y": [253] } -{"m1.P": [1], "m1.X": [254], "m2.Q": [0], "m2.Y": [254] } -{"m1.P": [1], "m1.X": [255], "m2.Q": [0], "m2.Y": [255] } -{"m1.P": [1], "m1.X": [256], "m2.Q": [0], "m2.Y": [256] } -{"m1.P": [1], "m1.X": [257], "m2.Q": [0], "m2.Y": [257] } +{"m1.P": [1], "m1.X": [252], "m2.Q": [0], "m2.Y": [252], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [253], "m2.Q": [0], "m2.Y": [253], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [254], "m2.Q": [0], "m2.Y": [254], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [255], "m2.Q": [0], "m2.Y": [255], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [256], "m2.Q": [0], "m2.Y": [256], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [257], "m2.Q": [0], "m2.Y": [257], "m1.ONE": [1]} ;; -{"m1.P": [1], "m1.X": [257], "m2.Q": [0,0], "m2.Y": [256,257] } -{"m1.P": [1], "m1.X": [257], "m2.Q": [1,0], "m2.Y": [256,257] } -{"m1.P": [1], "m1.X": [257], "m2.Q": [0,0,0], "m2.Y": [256,257,258] } -{"m1.P": [1], "m1.X": [257], "m2.Q": [1,0,0], "m2.Y": [256,257,258] } -{"m1.P": [1], "m1.X": [257], "m2.Q": [0,0,1], "m2.Y": [256,257,258] } -{"m1.P": [1], "m1.X": [257], "m2.Q": [1,0,1], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,257], "m2.Q": [0,0,0], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,257], "m2.Q": [1,0,0], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,257], "m2.Q": [0,0,1], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,257], "m2.Q": [1,0,1], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,258], "m2.Q": [0,0,0], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,258], "m2.Q": [1,0,0], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,258], "m2.Q": [0,1,0], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,258], "m2.Q": [0,0,1], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,258], "m2.Q": [1,0,1], "m2.Y": [256,257,258] } -{"m1.P": [1,1], "m1.X": [257,258], "m2.Q": [1,1,0], "m2.Y": [256,257,258] } +{"m1.P": [1], "m1.X": [257], "m2.Q": [0, 0], "m2.Y": [256, 257], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [257], "m2.Q": [1, 0], "m2.Y": [256, 257], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [257], "m2.Q": [0, 0, 0], "m2.Y": [256, 257, 258], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [257], "m2.Q": [1, 0, 0], "m2.Y": [256, 257, 258], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [257], "m2.Q": [0, 0, 1], "m2.Y": [256, 257, 258], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [257], "m2.Q": [1, 0, 1], "m2.Y": [256, 257, 258], "m1.ONE": [1]} +{"m1.P": [1, 1], "m1.X": [257, 257], "m2.Q": [0, 0, 0], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [257, 257], "m2.Q": [1, 0, 0], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [257, 257], "m2.Q": [0, 0, 1], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [257, 257], "m2.Q": [1, 0, 1], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [257, 258], "m2.Q": [0, 0, 0], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [257, 258], "m2.Q": [1, 0, 0], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [257, 258], "m2.Q": [0, 1, 0], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [257, 258], "m2.Q": [0, 0, 1], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [257, 258], "m2.Q": [1, 0, 1], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [257, 258], "m2.Q": [1, 1, 0], "m2.Y": [256, 257, 258], "m1.ONE": [1, 1]} ;; -{"m1.P": [1], "m1.X": [65530], "m2.Q": [0], "m2.Y": [65530] } -{"m1.P": [1], "m1.X": [65531], "m2.Q": [0], "m2.Y": [65531] } -{"m1.P": [1], "m1.X": [65532], "m2.Q": [0], "m2.Y": [65532] } -{"m1.P": [1], "m1.X": [65533], "m2.Q": [0], "m2.Y": [65533] } -{"m1.P": [1], "m1.X": [65534], "m2.Q": [0], "m2.Y": [65534] } -{"m1.P": [1], "m1.X": [65535], "m2.Q": [0], "m2.Y": [65535] } -{"m1.P": [1], "m1.X": [65536], "m2.Q": [0], "m2.Y": [65536] } -{"m1.P": [1], "m1.X": [65537], "m2.Q": [0], "m2.Y": [65537] } -{"m1.P": [1], "m1.X": [65538], "m2.Q": [0], "m2.Y": [65538] } -{"m1.P": [1], "m1.X": [65539], "m2.Q": [0], "m2.Y": [65539] } -{"m1.P": [1], "m1.X": [65540], "m2.Q": [0], "m2.Y": [65540] } +{"m1.P": [1], "m1.X": [65530], "m2.Q": [0], "m2.Y": [65530], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65531], "m2.Q": [0], "m2.Y": [65531], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65532], "m2.Q": [0], "m2.Y": [65532], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65533], "m2.Q": [0], "m2.Y": [65533], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65534], "m2.Q": [0], "m2.Y": [65534], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65535], "m2.Q": [0], "m2.Y": [65535], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65536], "m2.Q": [0], "m2.Y": [65536], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65537], "m2.Q": [0], "m2.Y": [65537], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65538], "m2.Q": [0], "m2.Y": [65538], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65539], "m2.Q": [0], "m2.Y": [65539], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [65540], "m2.Q": [0], "m2.Y": [65540], "m1.ONE": [1]} ;; -{"m1.P": [1,1], "m1.X": [65534,65534], "m2.Q": [0,0], "m2.Y": [65534,65535] } -{"m1.P": [1,1], "m1.X": [65535,65535], "m2.Q": [0,0], "m2.Y": [65535,65536] } -{"m1.P": [1,1], "m1.X": [65534,65535], "m2.Q": [0,0], "m2.Y": [65534,65535] } -{"m1.P": [1,1], "m1.X": [65533,65536], "m2.Q": [0,0], "m2.Y": [65533,65536] } -{"m1.P": [1,1], "m1.X": [65533,65536], "m2.Q": [0,0,0], "m2.Y": [65533,65536,65537] } -{"m1.P": [1,1], "m1.X": [65533,65536], "m2.Q": [0,0,0,0], "m2.Y": [201,65533,65536,65537] } +{"m1.P": [1, 1], "m1.X": [65534, 65534], "m2.Q": [0, 0], "m2.Y": [65534, 65535], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65535, 65535], "m2.Q": [0, 0], "m2.Y": [65535, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65534, 65535], "m2.Q": [0, 0], "m2.Y": [65534, 65535], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65533, 65536], "m2.Q": [0, 0], "m2.Y": [65533, 65536], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65533, 65536], "m2.Q": [0, 0, 0], "m2.Y": [65533, 65536, 65537], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [65533, 65536], "m2.Q": [0, 0, 0, 0], "m2.Y": [201, 65533, 65536, 65537], "m1.ONE": [1, 1]} ;; -{"m1.P": [1], "m1.X": [131070], "m2.Q": [0], "m2.Y": [131070] } -{"m1.P": [1], "m1.X": [131071], "m2.Q": [0], "m2.Y": [131071] } -{"m1.P": [1], "m1.X": [131072], "m2.Q": [0], "m2.Y": [131072] } -{"m1.P": [1], "m1.X": [131073], "m2.Q": [0], "m2.Y": [131073] } -{"m1.P": [1], "m1.X": [131074], "m2.Q": [0], "m2.Y": [131074] } -{"m1.P": [1], "m1.X": [131075], "m2.Q": [0], "m2.Y": [131075] } +{"m1.P": [1], "m1.X": [131070], "m2.Q": [0], "m2.Y": [131070], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [131071], "m2.Q": [0], "m2.Y": [131071], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [131072], "m2.Q": [0], "m2.Y": [131072], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [131073], "m2.Q": [0], "m2.Y": [131073], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [131074], "m2.Q": [0], "m2.Y": [131074], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [131075], "m2.Q": [0], "m2.Y": [131075], "m1.ONE": [1]} ;; -{"m1.P": [1,1], "m1.X": [131071,131071], "m2.Q": [0,0], "m2.Y": [131071,131072] } -{"m1.P": [1,1], "m1.X": [131072,131072], "m2.Q": [0,0], "m2.Y": [131072,131073] } -{"m1.P": [1,1], "m1.X": [131072,131073], "m2.Q": [0,0], "m2.Y": [131072,131073] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [0,0], "m2.Y": [131072,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [0,0,0], "m2.Y": [131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [0,0,0,0], "m2.Y": [131071,131072,131073,131074] } -{"m1.P": [1,1], "m1.X": [131072,131074], "m2.Q": [0,0,0,0,0], "m2.Y": [223,131071,131072,131073,131074] } +{"m1.P": [1, 1], "m1.X": [131071, 131071], "m2.Q": [0, 0], "m2.Y": [131071, 131072], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131072], "m2.Q": [0, 0], "m2.Y": [131072, 131073], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131073], "m2.Q": [0, 0], "m2.Y": [131072, 131073], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [0, 0], "m2.Y": [131072, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [0, 0, 0], "m2.Y": [131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [0, 0, 0, 0], "m2.Y": [131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [131072, 131074], "m2.Q": [0, 0, 0, 0, 0], "m2.Y": [223, 131071, 131072, 131073, 131074], "m1.ONE": [1, 1]} ;; -{"m1.P": [1], "m1.X": [7431768211449], "m2.Q": [0], "m2.Y": [7431768211449] } -{"m1.P": [1], "m1.X": [63374607431768211449], "m2.Q": [0], "m2.Y": [63374607431768211449] } -{"m1.P": [1], "m1.X": [38463463374607431768211449], "m2.Q": [0], "m2.Y": [38463463374607431768211449] } -{"m1.P": [1], "m1.X": [66920938463463374607431768211449], "m2.Q": [0], "m2.Y": [66920938463463374607431768211449] } -{"m1.P": [1], "m1.X": [366920938463463374607431768211449], "m2.Q": [0], "m2.Y": [366920938463463374607431768211449] } -{"m1.P": [1], "m1.X": [2366920938463463374607431768211449], "m2.Q": [0], "m2.Y": [2366920938463463374607431768211449] } -{"m1.P": [1], "m1.X": [82366920938463463374607431768211449], "m2.Q": [0], "m2.Y": [82366920938463463374607431768211449] } -{"m1.P": [1], "m1.X": [282366920938463463374607431768211449], "m2.Q": [0], "m2.Y": [282366920938463463374607431768211449] } -{"m1.P": [1], "m1.X": [40282366920938463463374607431768211449], "m2.Q": [0], "m2.Y": [40282366920938463463374607431768211449] } -{"m1.P": [1], "m1.X": [340282366920938012012012012012012012012], "m2.Q": [0], "m2.Y": [340282366920938012012012012012012012012] } -{"m1.P": [1], "m1.X": [340282366920938463463370101010101010101], "m2.Q": [0], "m2.Y": [340282366920938463463370101010101010101] } -{"m1.P": [1], "m1.X": [340282366920938463463374607401010101010], "m2.Q": [0], "m2.Y": [340282366920938463463374607401010101010] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431760000001], "m2.Q": [0], "m2.Y": [340282366920938463463374607431760000001] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211300], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211300] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211400], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211400] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211448], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211448] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211449], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211449] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211450], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211450] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211451], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211451] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211452], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211452] } -{"m1.P": [1], "m1.X": [340282366920938463463374607431768211453], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211453] } +{"m1.P": [1], "m1.X": [7431768211449], "m2.Q": [0], "m2.Y": [7431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [63374607431768211449], "m2.Q": [0], "m2.Y": [63374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [38463463374607431768211449], "m2.Q": [0], "m2.Y": [38463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [66920938463463374607431768211449], "m2.Q": [0], "m2.Y": [66920938463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [366920938463463374607431768211449], "m2.Q": [0], "m2.Y": [366920938463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [2366920938463463374607431768211449], "m2.Q": [0], "m2.Y": [2366920938463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [82366920938463463374607431768211449], "m2.Q": [0], "m2.Y": [82366920938463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [282366920938463463374607431768211449], "m2.Q": [0], "m2.Y": [282366920938463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [40282366920938463463374607431768211449], "m2.Q": [0], "m2.Y": [40282366920938463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938012012012012012012012012], "m2.Q": [0], "m2.Y": [340282366920938012012012012012012012012], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463370101010101010101], "m2.Q": [0], "m2.Y": [340282366920938463463370101010101010101], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607401010101010], "m2.Q": [0], "m2.Y": [340282366920938463463374607401010101010], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431760000001], "m2.Q": [0], "m2.Y": [340282366920938463463374607431760000001], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211300], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211300], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211400], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211400], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211448], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211448], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211449], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211449], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211450], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211450], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211451], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211451], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211452], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211452], "m1.ONE": [1]} +{"m1.P": [1], "m1.X": [340282366920938463463374607431768211453], "m2.Q": [0], "m2.Y": [340282366920938463463374607431768211453], "m1.ONE": [1]} ;; -{"m1.P": [1,1], "m1.X": [340282366920938463463374607431768211453,340282366920938463463374607431768211453], "m2.Q": [0,0], "m2.Y": [340282366920938463463374607431768211453,340282366920938463463374607431768211453] } -{"m1.P": [1,1], "m1.X": [340282366920938463463374607431768211452,340282366920938463463374607431768211452], "m2.Q": [0,0], "m2.Y": [340282366920938463463374607431768211452,340282366920938463463374607431768211453] } -{"m1.P": [1,1], "m1.X": [340282366920938463463374607431768211453,340282366920938463463374607431768211453], "m2.Q": [0,0], "m2.Y": [340282366920938463463374607431768211452,340282366920938463463374607431768211453] } -{"m1.P": [1,1], "m1.X": [340282366920938463463374607431768211453,340282366920938463463374607431768211453], "m2.Q": [0,0], "m2.Y": [340282366920938463463374607431768211453,340282366920938463463374607431768211452] } -{"m1.P": [1,1], "m1.X": [340282366920938463463374607431768211452,340282366920938463463374607431768211453], "m2.Q": [0,0], "m2.Y": [340282366920938463463374607431768211452,340282366920938463463374607431768211453] } -{"m1.P": [1,1], "m1.X": [340282366920938463463374607431768211452,340282366920938463463374607431768211453], "m2.Q": [0,0,0], "m2.Y": [340282366920938463463374607431768211452,340282366920938463463374607431768211453,340282366920938463463374607431768211454] } +{"m1.P": [1, 1], "m1.X": [340282366920938463463374607431768211453, 340282366920938463463374607431768211453], "m2.Q": [0, 0], "m2.Y": [340282366920938463463374607431768211453, 340282366920938463463374607431768211453], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [340282366920938463463374607431768211452, 340282366920938463463374607431768211452], "m2.Q": [0, 0], "m2.Y": [340282366920938463463374607431768211452, 340282366920938463463374607431768211453], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [340282366920938463463374607431768211453, 340282366920938463463374607431768211453], "m2.Q": [0, 0], "m2.Y": [340282366920938463463374607431768211452, 340282366920938463463374607431768211453], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [340282366920938463463374607431768211453, 340282366920938463463374607431768211453], "m2.Q": [0, 0], "m2.Y": [340282366920938463463374607431768211453, 340282366920938463463374607431768211452], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [340282366920938463463374607431768211452, 340282366920938463463374607431768211453], "m2.Q": [0, 0], "m2.Y": [340282366920938463463374607431768211452, 340282366920938463463374607431768211453], "m1.ONE": [1, 1]} +{"m1.P": [1, 1], "m1.X": [340282366920938463463374607431768211452, 340282366920938463463374607431768211453], "m2.Q": [0, 0, 0], "m2.Y": [340282366920938463463374607431768211452, 340282366920938463463374607431768211453, 340282366920938463463374607431768211454], "m1.ONE": [1, 1]} diff --git a/testdata/corset/agnostic/lookup_08.accepts b/testdata/corset/agnostic/lookup_08.accepts index fa19fa451..b72a2436e 100644 --- a/testdata/corset/agnostic/lookup_08.accepts +++ b/testdata/corset/agnostic/lookup_08.accepts @@ -1,91 +1,91 @@ ;; 2^128=340282366920938463463374607431768211456 ;; 2^160=1461501637330902918203684832716283019655932542976 ;; 2^256=11579208923731619542357098500868790785326998466564056403945758400791312963993 -{"m1.X_1": [0], "m1.X_0": [0], "m2.Y": [0] } -{"m1.X_1": [0], "m1.X_0": [1], "m2.Y": [1] } -{"m1.X_1": [0], "m1.X_0": [2], "m2.Y": [2] } -{"m1.X_1": [0], "m1.X_0": [3], "m2.Y": [3] } +{"m1.X_1": [0], "m1.X_0": [0], "m2.Y": [0], "m1.XC": [0]} +{"m1.X_1": [0], "m1.X_0": [1], "m2.Y": [1], "m1.XC": [1]} +{"m1.X_1": [0], "m1.X_0": [2], "m2.Y": [2], "m1.XC": [2]} +{"m1.X_1": [0], "m1.X_0": [3], "m2.Y": [3], "m1.XC": [3]} ;;============================================================================== ;;u8 ;;============================================================================== -{"m1.X_1": [0], "m1.X_0": [252], "m2.Y": [252] } -{"m1.X_1": [0], "m1.X_0": [253], "m2.Y": [253] } -{"m1.X_1": [0], "m1.X_0": [254], "m2.Y": [254] } -{"m1.X_1": [0], "m1.X_0": [255], "m2.Y": [255] } -{"m1.X_1": [0], "m1.X_0": [256], "m2.Y": [256] } -{"m1.X_1": [0], "m1.X_0": [257], "m2.Y": [257] } +{"m1.X_1": [0], "m1.X_0": [252], "m2.Y": [252], "m1.XC": [252]} +{"m1.X_1": [0], "m1.X_0": [253], "m2.Y": [253], "m1.XC": [253]} +{"m1.X_1": [0], "m1.X_0": [254], "m2.Y": [254], "m1.XC": [254]} +{"m1.X_1": [0], "m1.X_0": [255], "m2.Y": [255], "m1.XC": [255]} +{"m1.X_1": [0], "m1.X_0": [256], "m2.Y": [256], "m1.XC": [256]} +{"m1.X_1": [0], "m1.X_0": [257], "m2.Y": [257], "m1.XC": [257]} ;; -{"m1.X_1": [0,0], "m1.X_0": [0,256], "m2.Y": [256,257] } -{"m1.X_1": [0,0], "m1.X_0": [0,257], "m2.Y": [256,257] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,0,256], "m2.Y": [256,257,258] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,0,257], "m2.Y": [256,257,258] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,0,258], "m2.Y": [256,257,258] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,256,256], "m2.Y": [256,257,258] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,256,257], "m2.Y": [256,257,258] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,256,258], "m2.Y": [256,257,258] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,257,258], "m2.Y": [256,257,258] } +{"m1.X_1": [0, 0], "m1.X_0": [0, 256], "m2.Y": [256, 257], "m1.XC": [0, 256]} +{"m1.X_1": [0, 0], "m1.X_0": [0, 257], "m2.Y": [256, 257], "m1.XC": [0, 257]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 0, 256], "m2.Y": [256, 257, 258], "m1.XC": [0, 0, 256]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 0, 257], "m2.Y": [256, 257, 258], "m1.XC": [0, 0, 257]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 0, 258], "m2.Y": [256, 257, 258], "m1.XC": [0, 0, 258]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 256, 256], "m2.Y": [256, 257, 258], "m1.XC": [0, 256, 256]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 256, 257], "m2.Y": [256, 257, 258], "m1.XC": [0, 256, 257]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 256, 258], "m2.Y": [256, 257, 258], "m1.XC": [0, 256, 258]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 257, 258], "m2.Y": [256, 257, 258], "m1.XC": [0, 257, 258]} ;;============================================================================== ;;u16 ;;============================================================================== -{"m1.X_1": [0], "m1.X_0": [65531], "m2.Y": [65531] } -{"m1.X_1": [0], "m1.X_0": [65532], "m2.Y": [65532] } -{"m1.X_1": [0], "m1.X_0": [65533], "m2.Y": [65533] } -{"m1.X_1": [0], "m1.X_0": [65534], "m2.Y": [65534] } -{"m1.X_1": [0], "m1.X_0": [65535], "m2.Y": [65535] } -{"m1.X_1": [0], "m1.X_0": [65536], "m2.Y": [65536] } +{"m1.X_1": [0], "m1.X_0": [65531], "m2.Y": [65531], "m1.XC": [65531]} +{"m1.X_1": [0], "m1.X_0": [65532], "m2.Y": [65532], "m1.XC": [65532]} +{"m1.X_1": [0], "m1.X_0": [65533], "m2.Y": [65533], "m1.XC": [65533]} +{"m1.X_1": [0], "m1.X_0": [65534], "m2.Y": [65534], "m1.XC": [65534]} +{"m1.X_1": [0], "m1.X_0": [65535], "m2.Y": [65535], "m1.XC": [65535]} +{"m1.X_1": [0], "m1.X_0": [65536], "m2.Y": [65536], "m1.XC": [65536]} ;; -{"m1.X_1": [0,0], "m1.X_0": [0,65535], "m2.Y": [65535,65536] } -{"m1.X_1": [0,0], "m1.X_0": [0,65536], "m2.Y": [65535,65536] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,0,65535], "m2.Y": [65535,65536,65537] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,0,65536], "m2.Y": [65535,65536,65537] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,0,65537], "m2.Y": [65535,65536,65537] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,65535,65535], "m2.Y": [65535,65536,65537] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,65535,65536], "m2.Y": [65535,65536,65537] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,65535,65537], "m2.Y": [65535,65536,65537] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,65536,65537], "m2.Y": [65535,65536,65537] } +{"m1.X_1": [0, 0], "m1.X_0": [0, 65535], "m2.Y": [65535, 65536], "m1.XC": [0, 65535]} +{"m1.X_1": [0, 0], "m1.X_0": [0, 65536], "m2.Y": [65535, 65536], "m1.XC": [0, 65536]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 0, 65535], "m2.Y": [65535, 65536, 65537], "m1.XC": [0, 0, 65535]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 0, 65536], "m2.Y": [65535, 65536, 65537], "m1.XC": [0, 0, 65536]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 0, 65537], "m2.Y": [65535, 65536, 65537], "m1.XC": [0, 0, 65537]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 65535, 65535], "m2.Y": [65535, 65536, 65537], "m1.XC": [0, 65535, 65535]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 65535, 65536], "m2.Y": [65535, 65536, 65537], "m1.XC": [0, 65535, 65536]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 65535, 65537], "m2.Y": [65535, 65536, 65537], "m1.XC": [0, 65535, 65537]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 65536, 65537], "m2.Y": [65535, 65536, 65537], "m1.XC": [0, 65536, 65537]} ;;============================================================================== ;;u128 ;;============================================================================== -{"m1.X_1": [0], "m1.X_0": [340282366920938463463374607431768211450], "m2.Y": [340282366920938463463374607431768211450] } -{"m1.X_1": [0], "m1.X_0": [340282366920938463463374607431768211451], "m2.Y": [340282366920938463463374607431768211451] } -{"m1.X_1": [0], "m1.X_0": [340282366920938463463374607431768211452], "m2.Y": [340282366920938463463374607431768211452] } -{"m1.X_1": [0], "m1.X_0": [340282366920938463463374607431768211453], "m2.Y": [340282366920938463463374607431768211453] } -{"m1.X_1": [0], "m1.X_0": [340282366920938463463374607431768211454], "m2.Y": [340282366920938463463374607431768211454] } -{"m1.X_1": [0], "m1.X_0": [340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455] } -{"m1.X_1": [1], "m1.X_0": [0], "m2.Y": [340282366920938463463374607431768211456] } +{"m1.X_1": [0], "m1.X_0": [340282366920938463463374607431768211450], "m2.Y": [340282366920938463463374607431768211450], "m1.XC": [340282366920938463463374607431768211450]} +{"m1.X_1": [0], "m1.X_0": [340282366920938463463374607431768211451], "m2.Y": [340282366920938463463374607431768211451], "m1.XC": [340282366920938463463374607431768211451]} +{"m1.X_1": [0], "m1.X_0": [340282366920938463463374607431768211452], "m2.Y": [340282366920938463463374607431768211452], "m1.XC": [340282366920938463463374607431768211452]} +{"m1.X_1": [0], "m1.X_0": [340282366920938463463374607431768211453], "m2.Y": [340282366920938463463374607431768211453], "m1.XC": [340282366920938463463374607431768211453]} +{"m1.X_1": [0], "m1.X_0": [340282366920938463463374607431768211454], "m2.Y": [340282366920938463463374607431768211454], "m1.XC": [340282366920938463463374607431768211454]} +{"m1.X_1": [0], "m1.X_0": [340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455], "m1.XC": [340282366920938463463374607431768211455]} +{"m1.X_1": [1], "m1.X_0": [0], "m2.Y": [340282366920938463463374607431768211456], "m1.XC": [340282366920938463463374607431768211456]} ;; -{"m1.X_1": [0,0], "m1.X_0": [0,340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456] } -{"m1.X_1": [0,1], "m1.X_0": [0,0], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,0,340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457] } -{"m1.X_1": [0,0,1], "m1.X_0": [0,0,0], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457] } -{"m1.X_1": [0,0,1], "m1.X_0": [0,0,1], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457] } -{"m1.X_1": [0,0,0], "m1.X_0": [0,340282366920938463463374607431768211455,340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457] } -{"m1.X_1": [0,0,1], "m1.X_0": [0,340282366920938463463374607431768211455,0], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457] } -{"m1.X_1": [0,0,1], "m1.X_0": [0,340282366920938463463374607431768211455,2], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457,340282366920938463463374607431768211458] } -{"m1.X_1": [0,1,1], "m1.X_0": [0,1,2], "m2.Y": [340282366920938463463374607431768211455,340282366920938463463374607431768211456,340282366920938463463374607431768211457,340282366920938463463374607431768211458] } +{"m1.X_1": [0, 0], "m1.X_0": [0, 340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456], "m1.XC": [0, 340282366920938463463374607431768211455]} +{"m1.X_1": [0, 1], "m1.X_0": [0, 0], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456], "m1.XC": [0, 340282366920938463463374607431768211456]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 0, 340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457], "m1.XC": [0, 0, 340282366920938463463374607431768211455]} +{"m1.X_1": [0, 0, 1], "m1.X_0": [0, 0, 0], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457], "m1.XC": [0, 0, 340282366920938463463374607431768211456]} +{"m1.X_1": [0, 0, 1], "m1.X_0": [0, 0, 1], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457], "m1.XC": [0, 0, 340282366920938463463374607431768211457]} +{"m1.X_1": [0, 0, 0], "m1.X_0": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211455], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457], "m1.XC": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211455]} +{"m1.X_1": [0, 0, 1], "m1.X_0": [0, 340282366920938463463374607431768211455, 0], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457], "m1.XC": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211456]} +{"m1.X_1": [0, 0, 1], "m1.X_0": [0, 340282366920938463463374607431768211455, 2], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457, 340282366920938463463374607431768211458], "m1.XC": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211458]} +{"m1.X_1": [0, 1, 1], "m1.X_0": [0, 1, 2], "m2.Y": [340282366920938463463374607431768211455, 340282366920938463463374607431768211456, 340282366920938463463374607431768211457, 340282366920938463463374607431768211458], "m1.XC": [0, 340282366920938463463374607431768211457, 340282366920938463463374607431768211458]} ;;============================================================================== ;;u160 ;;============================================================================== -{"m1.X_1": [4294967295], "m1.X_0": [340282366920938463463374607431768211451], "m2.Y": [1461501637330902918203684832716283019655932542971] } -{"m1.X_1": [4294967295], "m1.X_0": [340282366920938463463374607431768211452], "m2.Y": [1461501637330902918203684832716283019655932542972] } -{"m1.X_1": [4294967295], "m1.X_0": [340282366920938463463374607431768211453], "m2.Y": [1461501637330902918203684832716283019655932542973] } -{"m1.X_1": [4294967295], "m1.X_0": [340282366920938463463374607431768211454], "m2.Y": [1461501637330902918203684832716283019655932542974] } -{"m1.X_1": [4294967295], "m1.X_0": [340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975] } -{"m1.X_1": [4294967296], "m1.X_0": [0], "m2.Y": [1461501637330902918203684832716283019655932542976] } -{"m1.X_1": [4294967296], "m1.X_0": [1], "m2.Y": [1461501637330902918203684832716283019655932542977] } +{"m1.X_1": [4294967295], "m1.X_0": [340282366920938463463374607431768211451], "m2.Y": [1461501637330902918203684832716283019655932542971], "m1.XC": [1461501637330902918203684832716283019655932542971]} +{"m1.X_1": [4294967295], "m1.X_0": [340282366920938463463374607431768211452], "m2.Y": [1461501637330902918203684832716283019655932542972], "m1.XC": [1461501637330902918203684832716283019655932542972]} +{"m1.X_1": [4294967295], "m1.X_0": [340282366920938463463374607431768211453], "m2.Y": [1461501637330902918203684832716283019655932542973], "m1.XC": [1461501637330902918203684832716283019655932542973]} +{"m1.X_1": [4294967295], "m1.X_0": [340282366920938463463374607431768211454], "m2.Y": [1461501637330902918203684832716283019655932542974], "m1.XC": [1461501637330902918203684832716283019655932542974]} +{"m1.X_1": [4294967295], "m1.X_0": [340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975], "m1.XC": [1461501637330902918203684832716283019655932542975]} +{"m1.X_1": [4294967296], "m1.X_0": [0], "m2.Y": [1461501637330902918203684832716283019655932542976], "m1.XC": [1461501637330902918203684832716283019655932542976]} +{"m1.X_1": [4294967296], "m1.X_0": [1], "m2.Y": [1461501637330902918203684832716283019655932542977], "m1.XC": [1461501637330902918203684832716283019655932542977]} ;; -{"m1.X_1": [0,4294967295], "m1.X_0": [0,340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976] } -{"m1.X_1": [0,4294967296], "m1.X_0": [0,0], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976] } -{"m1.X_1": [0,4294967295], "m1.X_0": [0,340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } -{"m1.X_1": [0,4294967296], "m1.X_0": [0,0], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } -{"m1.X_1": [0,4294967296], "m1.X_0": [0,1], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } +{"m1.X_1": [0, 4294967295], "m1.X_0": [0, 340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976], "m1.XC": [0, 1461501637330902918203684832716283019655932542975]} +{"m1.X_1": [0, 4294967296], "m1.X_0": [0, 0], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976], "m1.XC": [0, 1461501637330902918203684832716283019655932542976]} +{"m1.X_1": [0, 4294967295], "m1.X_0": [0, 340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.XC": [0, 1461501637330902918203684832716283019655932542975]} +{"m1.X_1": [0, 4294967296], "m1.X_0": [0, 0], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.XC": [0, 1461501637330902918203684832716283019655932542976]} +{"m1.X_1": [0, 4294967296], "m1.X_0": [0, 1], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.XC": [0, 1461501637330902918203684832716283019655932542977]} -{"m1.X_1": [0,4294967295,4294967295], "m1.X_0": [0,340282366920938463463374607431768211455,340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } -{"m1.X_1": [0,4294967295,4294967296], "m1.X_0": [0,340282366920938463463374607431768211455,0], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } -{"m1.X_1": [0,4294967295,4294967296], "m1.X_0": [0,340282366920938463463374607431768211455,1], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } -{"m1.X_1": [0,4294967296,4294967296], "m1.X_0": [0,0,1], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } -{"m1.X_1": [0,4294967296,4294967296], "m1.X_0": [0,1,1], "m2.Y": [1461501637330902918203684832716283019655932542975,1461501637330902918203684832716283019655932542976,1461501637330902918203684832716283019655932542977] } +{"m1.X_1": [0, 4294967295, 4294967295], "m1.X_0": [0, 340282366920938463463374607431768211455, 340282366920938463463374607431768211455], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.XC": [0, 1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542975]} +{"m1.X_1": [0, 4294967295, 4294967296], "m1.X_0": [0, 340282366920938463463374607431768211455, 0], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.XC": [0, 1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976]} +{"m1.X_1": [0, 4294967295, 4294967296], "m1.X_0": [0, 340282366920938463463374607431768211455, 1], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.XC": [0, 1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542977]} +{"m1.X_1": [0, 4294967296, 4294967296], "m1.X_0": [0, 0, 1], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.XC": [0, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977]} +{"m1.X_1": [0, 4294967296, 4294967296], "m1.X_0": [0, 1, 1], "m2.Y": [1461501637330902918203684832716283019655932542975, 1461501637330902918203684832716283019655932542976, 1461501637330902918203684832716283019655932542977], "m1.XC": [0, 1461501637330902918203684832716283019655932542977, 1461501637330902918203684832716283019655932542977]} diff --git a/testdata/corset/agnostic/lookup_08.lisp b/testdata/corset/agnostic/lookup_08.lisp index 0a35e0a93..9df174ff5 100644 --- a/testdata/corset/agnostic/lookup_08.lisp +++ b/testdata/corset/agnostic/lookup_08.lisp @@ -1,8 +1,10 @@ (module m1) ;; -(defcolumns (X :i128 :array [0:1])) +(defcolumns (X :i128 :array [0:1]) (XC :i256)) +;; XC holds the value of the expression (:: [X 1] [X 0]) +(defconstraint xc_def () (== XC (:: [X 1] [X 0]))) ;; -(deflookup l1 (m2.Y) ((:: [X 1] [X 0]))) +(deflookup l1 (m2.Y) (XC)) (module m2) (defcolumns (Y :i256)) diff --git a/testdata/corset/valid/array_07.accepts b/testdata/corset/valid/array_07.accepts index 4313231f8..7b9fab38c 100644 --- a/testdata/corset/valid/array_07.accepts +++ b/testdata/corset/valid/array_07.accepts @@ -1,9 +1,9 @@ -{ "m1.ACC_1": [], "m1.BYTE_0": [], "m1.BYTE_1": [], "m2.A": [], "m2.B": [] } -{ "m1.ACC_1": [0], "m1.BYTE_0": [0], "m1.BYTE_1": [0], "m2.A": [0], "m2.B": [0] } -{ "m1.ACC_1": [0], "m1.BYTE_0": [1], "m1.BYTE_1": [0], "m2.A": [0], "m2.B": [0] } -{ "m1.ACC_1": [0], "m1.BYTE_0": [1], "m1.BYTE_1": [1], "m2.A": [0], "m2.B": [0] } -{ "m1.ACC_1": [0], "m1.BYTE_0": [1], "m1.BYTE_1": [1], "m2.A": [0], "m2.B": [1] } -{ "m1.ACC_1": [1], "m1.BYTE_0": [0], "m1.BYTE_1": [0], "m2.A": [0], "m2.B": [0] } -{ "m1.ACC_1": [1], "m1.BYTE_0": [0], "m1.BYTE_1": [0], "m2.A": [1], "m2.B": [0] } -{ "m1.ACC_1": [1], "m1.BYTE_0": [0], "m1.BYTE_1": [1], "m2.A": [1], "m2.B": [1] } -{ "m1.ACC_1": [1], "m1.BYTE_0": [0], "m1.BYTE_1": [2], "m2.A": [1], "m2.B": [2] } +{"m1.ACC_1": [], "m1.BYTE_0": [], "m1.BYTE_1": [], "m2.A": [], "m2.B": [], "m1.B1": []} +{"m1.ACC_1": [0], "m1.BYTE_0": [0], "m1.BYTE_1": [0], "m2.A": [0], "m2.B": [0], "m1.B1": [0]} +{"m1.ACC_1": [0], "m1.BYTE_0": [1], "m1.BYTE_1": [0], "m2.A": [0], "m2.B": [0], "m1.B1": [0]} +{"m1.ACC_1": [0], "m1.BYTE_0": [1], "m1.BYTE_1": [1], "m2.A": [0], "m2.B": [0], "m1.B1": [1]} +{"m1.ACC_1": [0], "m1.BYTE_0": [1], "m1.BYTE_1": [1], "m2.A": [0], "m2.B": [1], "m1.B1": [1]} +{"m1.ACC_1": [1], "m1.BYTE_0": [0], "m1.BYTE_1": [0], "m2.A": [0], "m2.B": [0], "m1.B1": [0]} +{"m1.ACC_1": [1], "m1.BYTE_0": [0], "m1.BYTE_1": [0], "m2.A": [1], "m2.B": [0], "m1.B1": [0]} +{"m1.ACC_1": [1], "m1.BYTE_0": [0], "m1.BYTE_1": [1], "m2.A": [1], "m2.B": [1], "m1.B1": [1]} +{"m1.ACC_1": [1], "m1.BYTE_0": [0], "m1.BYTE_1": [2], "m2.A": [1], "m2.B": [2], "m1.B1": [2]} diff --git a/testdata/corset/valid/array_07.lisp b/testdata/corset/valid/array_07.lisp index 900ada110..96f95cbc4 100644 --- a/testdata/corset/valid/array_07.lisp +++ b/testdata/corset/valid/array_07.lisp @@ -2,14 +2,17 @@ (defcolumns (ACC_1 :i128) (BYTE :byte :array [0:1]) + (B1 :byte) ) (defconstraint test () (if (== ACC_1 1) (== 0 [BYTE 0]))) +;; B1 holds the value of the array access [BYTE 1] +(defconstraint b1_def () (== B1 [BYTE 1])) (module m2) (defcolumns (A :i128) (B :byte)) (deflookup l1 ;; target columns - (m1.ACC_1 [m1.BYTE 1]) + (m1.ACC_1 m1.B1) ;; source columns (A B)) diff --git a/testdata/corset/valid/lookup_03.accepts b/testdata/corset/valid/lookup_03.accepts index f1728a0a4..0fff5bcc9 100644 --- a/testdata/corset/valid/lookup_03.accepts +++ b/testdata/corset/valid/lookup_03.accepts @@ -1,41 +1,41 @@ -{ "X": [], "Y": [] } -{ "X": [0], "Y": [0] } -{ "X": [0], "Y": [1] } -{ "X": [1], "Y": [2] } -{ "X": [2], "Y": [4] } +{"X": [], "Y": [], "X2": []} +{"X": [0], "Y": [0], "X2": [0]} +{"X": [0], "Y": [1], "X2": [0]} +{"X": [1], "Y": [2], "X2": [2]} +{"X": [2], "Y": [4], "X2": [4]} ;; -{ "X": [0,0], "Y": [0,0] } -{ "X": [0,0], "Y": [1,2] } -{ "X": [1,0], "Y": [1,2] } -{ "X": [0,1], "Y": [1,2] } -{ "X": [1,1], "Y": [1,2] } -{ "X": [0,0], "Y": [2,1] } -{ "X": [1,0], "Y": [2,1] } -{ "X": [0,1], "Y": [2,1] } -{ "X": [1,1], "Y": [2,1] } -{ "X": [0,0], "Y": [2,2] } -{ "X": [1,0], "Y": [2,2] } -{ "X": [0,1], "Y": [2,2] } -{ "X": [1,1], "Y": [2,2] } +{"X": [0, 0], "Y": [0, 0], "X2": [0, 0]} +{"X": [0, 0], "Y": [1, 2], "X2": [0, 0]} +{"X": [1, 0], "Y": [1, 2], "X2": [2, 0]} +{"X": [0, 1], "Y": [1, 2], "X2": [0, 2]} +{"X": [1, 1], "Y": [1, 2], "X2": [2, 2]} +{"X": [0, 0], "Y": [2, 1], "X2": [0, 0]} +{"X": [1, 0], "Y": [2, 1], "X2": [2, 0]} +{"X": [0, 1], "Y": [2, 1], "X2": [0, 2]} +{"X": [1, 1], "Y": [2, 1], "X2": [2, 2]} +{"X": [0, 0], "Y": [2, 2], "X2": [0, 0]} +{"X": [1, 0], "Y": [2, 2], "X2": [2, 0]} +{"X": [0, 1], "Y": [2, 2], "X2": [0, 2]} +{"X": [1, 1], "Y": [2, 2], "X2": [2, 2]} ;; -{ "X": [0,0], "Y": [0,0] } -{ "X": [0,0], "Y": [1,4] } -{ "X": [2,0], "Y": [1,4] } -{ "X": [0,2], "Y": [1,4] } -{ "X": [2,2], "Y": [1,4] } -{ "X": [0,0], "Y": [4,1] } -{ "X": [2,0], "Y": [4,1] } -{ "X": [0,2], "Y": [4,1] } -{ "X": [2,2], "Y": [4,1] } -{ "X": [0,0], "Y": [4,4] } -{ "X": [2,0], "Y": [4,4] } -{ "X": [0,2], "Y": [4,4] } -{ "X": [2,2], "Y": [4,4] } +{"X": [0, 0], "Y": [0, 0], "X2": [0, 0]} +{"X": [0, 0], "Y": [1, 4], "X2": [0, 0]} +{"X": [2, 0], "Y": [1, 4], "X2": [4, 0]} +{"X": [0, 2], "Y": [1, 4], "X2": [0, 4]} +{"X": [2, 2], "Y": [1, 4], "X2": [4, 4]} +{"X": [0, 0], "Y": [4, 1], "X2": [0, 0]} +{"X": [2, 0], "Y": [4, 1], "X2": [4, 0]} +{"X": [0, 2], "Y": [4, 1], "X2": [0, 4]} +{"X": [2, 2], "Y": [4, 1], "X2": [4, 4]} +{"X": [0, 0], "Y": [4, 4], "X2": [0, 0]} +{"X": [2, 0], "Y": [4, 4], "X2": [4, 0]} +{"X": [0, 2], "Y": [4, 4], "X2": [0, 4]} +{"X": [2, 2], "Y": [4, 4], "X2": [4, 4]} ;; -{ "X": [1,2,3], "Y": [2,4,6] } -{ "X": [2,1,3], "Y": [2,4,6] } -{ "X": [1,3,2], "Y": [2,4,6] } -{ "X": [1,2,3], "Y": [4,2,6] } -{ "X": [1,2,3], "Y": [2,6,4] } -{ "X": [1,2,3], "Y": [6,4,2] } -{ "X": [1,2,3], "Y": [6,2,4] } +{"X": [1, 2, 3], "Y": [2, 4, 6], "X2": [2, 4, 6]} +{"X": [2, 1, 3], "Y": [2, 4, 6], "X2": [4, 2, 6]} +{"X": [1, 3, 2], "Y": [2, 4, 6], "X2": [2, 6, 4]} +{"X": [1, 2, 3], "Y": [4, 2, 6], "X2": [2, 4, 6]} +{"X": [1, 2, 3], "Y": [2, 6, 4], "X2": [2, 4, 6]} +{"X": [1, 2, 3], "Y": [6, 4, 2], "X2": [2, 4, 6]} +{"X": [1, 2, 3], "Y": [6, 2, 4], "X2": [2, 4, 6]} diff --git a/testdata/corset/valid/lookup_03.expanded.rejects b/testdata/corset/valid/lookup_03.expanded.rejects index aa6efccb6..66f353b3e 100644 --- a/testdata/corset/valid/lookup_03.expanded.rejects +++ b/testdata/corset/valid/lookup_03.expanded.rejects @@ -1,51 +1,51 @@ ;; BLS12_377 modulus=8444461749428370424248824938781546531375899335154063827935233455917409239041 -{"X": [0], "Y": [0], "(* X 2)": [8444461749428370424248824938781546531375899335154063827935233455917409239040]} -{"X": [0], "Y": [0], "(* X 2)": [1]} -{"X": [0], "Y": [0], "(* X 2)": [2]} -{"X": [0], "Y": [0], "(* X 2)": [3]} -;; -{"X": [0, 0], "Y": [0, 0], "(* X 2)": [8444461749428370424248824938781546531375899335154063827935233455917409239040, 0]} -{"X": [0, 0], "Y": [0, 0], "(* X 2)": [0, 8444461749428370424248824938781546531375899335154063827935233455917409239040]} -{"X": [0, 0], "Y": [0, 0], "(* X 2)": [1, 0]} -{"X": [0, 0], "Y": [0, 0], "(* X 2)": [0, 1]} -;; -{"X": [0, 1], "Y": [0, 2], "(* X 2)": [0, 0]} -{"X": [0, 1], "Y": [0, 2], "(* X 2)": [0, 1]} -{"X": [0, 1], "Y": [0, 2], "(* X 2)": [0, 3]} -{"X": [0, 1], "Y": [0, 2], "(* X 2)": [0, 4]} -;; -{"X": [0, 2], "Y": [0, 4], "(* X 2)": [0, 0]} -{"X": [0, 2], "Y": [0, 4], "(* X 2)": [0, 1]} -{"X": [0, 2], "Y": [0, 4], "(* X 2)": [0, 2]} -{"X": [0, 2], "Y": [0, 4], "(* X 2)": [0, 3]} -{"X": [0, 2], "Y": [0, 4], "(* X 2)": [0, 5]} -;; -{"X": [0, 0, 0], "Y": [0, 0, 0], "(* X 2)": [1, 0, 0]} -{"X": [0, 0, 0], "Y": [0, 0, 0], "(* X 2)": [0, 1, 0]} -{"X": [0, 0, 0], "Y": [0, 0, 0], "(* X 2)": [0, 0, 1]} -;; -{"X": [0, 1, 0], "Y": [0, 1, 2], "(* X 2)": [0, 0, 0]} -{"X": [0, 1, 0], "Y": [0, 1, 2], "(* X 2)": [0, 1, 0]} -{"X": [0, 1, 0], "Y": [0, 1, 2], "(* X 2)": [0, 3, 0]} -;; -{"X": [0, 0, 1], "Y": [0, 1, 2], "(* X 2)": [0, 0, 0]} -{"X": [0, 0, 1], "Y": [0, 1, 2], "(* X 2)": [0, 0, 1]} -{"X": [0, 0, 1], "Y": [0, 1, 2], "(* X 2)": [0, 0, 3]} -;; -{"X": [0, 1, 1], "Y": [0, 1, 2], "(* X 2)": [0, 0, 0]} -{"X": [0, 1, 1], "Y": [0, 1, 2], "(* X 2)": [0, 1, 0]} -{"X": [0, 1, 1], "Y": [0, 1, 2], "(* X 2)": [0, 3, 0]} -{"X": [0, 1, 1], "Y": [0, 1, 2], "(* X 2)": [0, 0, 1]} -{"X": [0, 1, 1], "Y": [0, 1, 2], "(* X 2)": [0, 1, 1]} -{"X": [0, 1, 1], "Y": [0, 1, 2], "(* X 2)": [0, 3, 1]} -{"X": [0, 1, 1], "Y": [0, 1, 2], "(* X 2)": [0, 0, 2]} -{"X": [0, 1, 1], "Y": [0, 1, 2], "(* X 2)": [0, 1, 2]} -{"X": [0, 1, 1], "Y": [0, 1, 2], "(* X 2)": [0, 3, 2]} -{"X": [0, 1, 1], "Y": [0, 1, 2], "(* X 2)": [0, 0, 3]} -{"X": [0, 1, 1], "Y": [0, 1, 2], "(* X 2)": [0, 1, 3]} -{"X": [0, 1, 1], "Y": [0, 1, 2], "(* X 2)": [0, 3, 3]} -;; -{"X": [0, 2, 2], "Y": [0, 4, 4], "(* X 2)": [0, 0, 4]} -{"X": [0, 2, 2], "Y": [0, 4, 4], "(* X 2)": [0, 4, 1]} -{"X": [0, 2, 2], "Y": [0, 4, 4], "(* X 2)": [0, 2, 4]} -{"X": [0, 2, 2], "Y": [0, 4, 4], "(* X 2)": [0, 4, 3]} +{"X": [0], "Y": [0], "X2": [8444461749428370424248824938781546531375899335154063827935233455917409239040]} +{"X": [0], "Y": [0], "X2": [1]} +{"X": [0], "Y": [0], "X2": [2]} +{"X": [0], "Y": [0], "X2": [3]} +;; +{"X": [0, 0], "Y": [0, 0], "X2": [8444461749428370424248824938781546531375899335154063827935233455917409239040, 0]} +{"X": [0, 0], "Y": [0, 0], "X2": [0, 8444461749428370424248824938781546531375899335154063827935233455917409239040]} +{"X": [0, 0], "Y": [0, 0], "X2": [1, 0]} +{"X": [0, 0], "Y": [0, 0], "X2": [0, 1]} +;; +{"X": [0, 1], "Y": [0, 2], "X2": [0, 0]} +{"X": [0, 1], "Y": [0, 2], "X2": [0, 1]} +{"X": [0, 1], "Y": [0, 2], "X2": [0, 3]} +{"X": [0, 1], "Y": [0, 2], "X2": [0, 4]} +;; +{"X": [0, 2], "Y": [0, 4], "X2": [0, 0]} +{"X": [0, 2], "Y": [0, 4], "X2": [0, 1]} +{"X": [0, 2], "Y": [0, 4], "X2": [0, 2]} +{"X": [0, 2], "Y": [0, 4], "X2": [0, 3]} +{"X": [0, 2], "Y": [0, 4], "X2": [0, 5]} +;; +{"X": [0, 0, 0], "Y": [0, 0, 0], "X2": [1, 0, 0]} +{"X": [0, 0, 0], "Y": [0, 0, 0], "X2": [0, 1, 0]} +{"X": [0, 0, 0], "Y": [0, 0, 0], "X2": [0, 0, 1]} +;; +{"X": [0, 1, 0], "Y": [0, 1, 2], "X2": [0, 0, 0]} +{"X": [0, 1, 0], "Y": [0, 1, 2], "X2": [0, 1, 0]} +{"X": [0, 1, 0], "Y": [0, 1, 2], "X2": [0, 3, 0]} +;; +{"X": [0, 0, 1], "Y": [0, 1, 2], "X2": [0, 0, 0]} +{"X": [0, 0, 1], "Y": [0, 1, 2], "X2": [0, 0, 1]} +{"X": [0, 0, 1], "Y": [0, 1, 2], "X2": [0, 0, 3]} +;; +{"X": [0, 1, 1], "Y": [0, 1, 2], "X2": [0, 0, 0]} +{"X": [0, 1, 1], "Y": [0, 1, 2], "X2": [0, 1, 0]} +{"X": [0, 1, 1], "Y": [0, 1, 2], "X2": [0, 3, 0]} +{"X": [0, 1, 1], "Y": [0, 1, 2], "X2": [0, 0, 1]} +{"X": [0, 1, 1], "Y": [0, 1, 2], "X2": [0, 1, 1]} +{"X": [0, 1, 1], "Y": [0, 1, 2], "X2": [0, 3, 1]} +{"X": [0, 1, 1], "Y": [0, 1, 2], "X2": [0, 0, 2]} +{"X": [0, 1, 1], "Y": [0, 1, 2], "X2": [0, 1, 2]} +{"X": [0, 1, 1], "Y": [0, 1, 2], "X2": [0, 3, 2]} +{"X": [0, 1, 1], "Y": [0, 1, 2], "X2": [0, 0, 3]} +{"X": [0, 1, 1], "Y": [0, 1, 2], "X2": [0, 1, 3]} +{"X": [0, 1, 1], "Y": [0, 1, 2], "X2": [0, 3, 3]} +;; +{"X": [0, 2, 2], "Y": [0, 4, 4], "X2": [0, 0, 4]} +{"X": [0, 2, 2], "Y": [0, 4, 4], "X2": [0, 4, 1]} +{"X": [0, 2, 2], "Y": [0, 4, 4], "X2": [0, 2, 4]} +{"X": [0, 2, 2], "Y": [0, 4, 4], "X2": [0, 4, 3]} diff --git a/testdata/corset/valid/lookup_03.lisp b/testdata/corset/valid/lookup_03.lisp index b8af880c3..610af35b1 100644 --- a/testdata/corset/valid/lookup_03.lisp +++ b/testdata/corset/valid/lookup_03.lisp @@ -1,2 +1,4 @@ -(defcolumns (X :i16) (Y :i32)) -(deflookup test (Y) ((* X 2))) +(defcolumns (X :i16) (Y :i32) (X2 :i17)) +;; X2 holds the value of the expression (* X 2) +(defconstraint x2_def () (== X2 (* X 2))) +(deflookup test (Y) (X2)) diff --git a/testdata/corset/valid/lookup_03.rejects b/testdata/corset/valid/lookup_03.rejects index 407a00f40..f540f1503 100644 --- a/testdata/corset/valid/lookup_03.rejects +++ b/testdata/corset/valid/lookup_03.rejects @@ -1,18 +1,18 @@ -{ "X": [1], "Y": [1] } -{ "X": [2], "Y": [1] } -{ "X": [3], "Y": [1] } -{ "X": [1], "Y": [3] } -{ "X": [1], "Y": [4] } -{ "X": [1], "Y": [5] } -{ "X": [2], "Y": [2] } -{ "X": [2], "Y": [3] } -{ "X": [2], "Y": [5] } -{ "X": [1,0], "Y": [1,1] } -{ "X": [1,0], "Y": [1,3] } -{ "X": [1,0], "Y": [1,4] } -{ "X": [0,1], "Y": [1,1] } -{ "X": [0,1], "Y": [1,3] } -{ "X": [0,1], "Y": [1,4] } -{ "X": [1,1], "Y": [1,1] } -{ "X": [1,1], "Y": [1,3] } -{ "X": [1,1], "Y": [1,4] } +{"X": [1], "Y": [1], "X2": [2]} +{"X": [2], "Y": [1], "X2": [4]} +{"X": [3], "Y": [1], "X2": [6]} +{"X": [1], "Y": [3], "X2": [2]} +{"X": [1], "Y": [4], "X2": [2]} +{"X": [1], "Y": [5], "X2": [2]} +{"X": [2], "Y": [2], "X2": [4]} +{"X": [2], "Y": [3], "X2": [4]} +{"X": [2], "Y": [5], "X2": [4]} +{"X": [1, 0], "Y": [1, 1], "X2": [2, 0]} +{"X": [1, 0], "Y": [1, 3], "X2": [2, 0]} +{"X": [1, 0], "Y": [1, 4], "X2": [2, 0]} +{"X": [0, 1], "Y": [1, 1], "X2": [0, 2]} +{"X": [0, 1], "Y": [1, 3], "X2": [0, 2]} +{"X": [0, 1], "Y": [1, 4], "X2": [0, 2]} +{"X": [1, 1], "Y": [1, 1], "X2": [2, 2]} +{"X": [1, 1], "Y": [1, 3], "X2": [2, 2]} +{"X": [1, 1], "Y": [1, 4], "X2": [2, 2]} diff --git a/testdata/corset/valid/lookup_04.accepts b/testdata/corset/valid/lookup_04.accepts index d36bc07ae..97b8d6575 100644 --- a/testdata/corset/valid/lookup_04.accepts +++ b/testdata/corset/valid/lookup_04.accepts @@ -1,10 +1,10 @@ -{ "ST": [], "X": [], "Y": [] } -{ "ST": [1], "X": [0], "Y": [1] } -{ "ST": [1,1], "X": [0,0], "Y": [1,2] } -{ "ST": [1,1], "X": [0,1], "Y": [1,2] } -{ "ST": [1,1], "X": [1,0], "Y": [1,2] } -{ "ST": [1,1], "X": [1,1], "Y": [1,2] } -{ "ST": [1,1], "X": [0,0], "Y": [2,1] } -{ "ST": [1,1], "X": [0,1], "Y": [2,1] } -{ "ST": [1,1], "X": [1,0], "Y": [2,1] } -{ "ST": [1,1], "X": [1,1], "Y": [2,1] } +{"ST": [], "X": [], "Y": [], "STX": []} +{"ST": [1], "X": [0], "Y": [1], "STX": [1]} +{"ST": [1, 1], "X": [0, 0], "Y": [1, 2], "STX": [1, 1]} +{"ST": [1, 1], "X": [0, 1], "Y": [1, 2], "STX": [1, 2]} +{"ST": [1, 1], "X": [1, 0], "Y": [1, 2], "STX": [2, 1]} +{"ST": [1, 1], "X": [1, 1], "Y": [1, 2], "STX": [2, 2]} +{"ST": [1, 1], "X": [0, 0], "Y": [2, 1], "STX": [1, 1]} +{"ST": [1, 1], "X": [0, 1], "Y": [2, 1], "STX": [1, 2]} +{"ST": [1, 1], "X": [1, 0], "Y": [2, 1], "STX": [2, 1]} +{"ST": [1, 1], "X": [1, 1], "Y": [2, 1], "STX": [2, 2]} diff --git a/testdata/corset/valid/lookup_04.lisp b/testdata/corset/valid/lookup_04.lisp index 6fb930f0d..be55badfe 100644 --- a/testdata/corset/valid/lookup_04.lisp +++ b/testdata/corset/valid/lookup_04.lisp @@ -1,2 +1,4 @@ -(defcolumns (ST :i4) (X :i16) (Y :i20)) -(deflookup test (Y) ((* ST (+ 1 X)))) +(defcolumns (ST :i4) (X :i16) (Y :i20) (STX :i20)) +;; STX holds the value of the expression (* ST (+ 1 X)) +(defconstraint stx_def () (== STX (* ST (+ 1 X)))) +(deflookup test (Y) (STX)) diff --git a/testdata/corset/valid/lookup_04.rejects b/testdata/corset/valid/lookup_04.rejects index 72fd514ce..b64d3ee4e 100644 --- a/testdata/corset/valid/lookup_04.rejects +++ b/testdata/corset/valid/lookup_04.rejects @@ -1,26 +1,26 @@ -{ "ST": [1], "X": [0], "Y": [0] } -{ "ST": [1], "X": [1], "Y": [0] } -{ "ST": [1], "X": [2], "Y": [0] } -{ "ST": [1], "X": [1], "Y": [1] } -{ "ST": [1], "X": [2], "Y": [1] } -{ "ST": [1], "X": [3], "Y": [1] } +{"ST": [1], "X": [0], "Y": [0], "STX": [1]} +{"ST": [1], "X": [1], "Y": [0], "STX": [2]} +{"ST": [1], "X": [2], "Y": [0], "STX": [3]} +{"ST": [1], "X": [1], "Y": [1], "STX": [2]} +{"ST": [1], "X": [2], "Y": [1], "STX": [3]} +{"ST": [1], "X": [3], "Y": [1], "STX": [4]} ;; -{ "ST": [1,1], "X": [0,0], "Y": [0,0] } -{ "ST": [1,1], "X": [1,0], "Y": [1,0] } -{ "ST": [1,1], "X": [1,0], "Y": [0,1] } -{ "ST": [1,1], "X": [1,0], "Y": [1,1] } -{ "ST": [1,1], "X": [0,1], "Y": [1,0] } -{ "ST": [1,1], "X": [0,1], "Y": [0,1] } -{ "ST": [1,1], "X": [0,1], "Y": [1,1] } -{ "ST": [1,1], "X": [1,1], "Y": [1,0] } -{ "ST": [1,1], "X": [1,1], "Y": [0,1] } -{ "ST": [1,1], "X": [1,1], "Y": [1,1] } -{ "ST": [1,1], "X": [1,2], "Y": [1,2] } -{ "ST": [1,1], "X": [2,1], "Y": [1,2] } -{ "ST": [1,1], "X": [2,2], "Y": [1,2] } -{ "ST": [1,1], "X": [1,2], "Y": [2,1] } -{ "ST": [1,1], "X": [2,1], "Y": [2,1] } -{ "ST": [1,1], "X": [2,2], "Y": [2,1] } -{ "ST": [1,1], "X": [1,2], "Y": [2,2] } -{ "ST": [1,1], "X": [2,1], "Y": [2,2] } -{ "ST": [1,1], "X": [2,2], "Y": [2,2] } +{"ST": [1, 1], "X": [0, 0], "Y": [0, 0], "STX": [1, 1]} +{"ST": [1, 1], "X": [1, 0], "Y": [1, 0], "STX": [2, 1]} +{"ST": [1, 1], "X": [1, 0], "Y": [0, 1], "STX": [2, 1]} +{"ST": [1, 1], "X": [1, 0], "Y": [1, 1], "STX": [2, 1]} +{"ST": [1, 1], "X": [0, 1], "Y": [1, 0], "STX": [1, 2]} +{"ST": [1, 1], "X": [0, 1], "Y": [0, 1], "STX": [1, 2]} +{"ST": [1, 1], "X": [0, 1], "Y": [1, 1], "STX": [1, 2]} +{"ST": [1, 1], "X": [1, 1], "Y": [1, 0], "STX": [2, 2]} +{"ST": [1, 1], "X": [1, 1], "Y": [0, 1], "STX": [2, 2]} +{"ST": [1, 1], "X": [1, 1], "Y": [1, 1], "STX": [2, 2]} +{"ST": [1, 1], "X": [1, 2], "Y": [1, 2], "STX": [2, 3]} +{"ST": [1, 1], "X": [2, 1], "Y": [1, 2], "STX": [3, 2]} +{"ST": [1, 1], "X": [2, 2], "Y": [1, 2], "STX": [3, 3]} +{"ST": [1, 1], "X": [1, 2], "Y": [2, 1], "STX": [2, 3]} +{"ST": [1, 1], "X": [2, 1], "Y": [2, 1], "STX": [3, 2]} +{"ST": [1, 1], "X": [2, 2], "Y": [2, 1], "STX": [3, 3]} +{"ST": [1, 1], "X": [1, 2], "Y": [2, 2], "STX": [2, 3]} +{"ST": [1, 1], "X": [2, 1], "Y": [2, 2], "STX": [3, 2]} +{"ST": [1, 1], "X": [2, 2], "Y": [2, 2], "STX": [3, 3]} diff --git a/testdata/corset/valid/lookup_05.accepts b/testdata/corset/valid/lookup_05.accepts index 99ba55ee2..9d50659e0 100644 --- a/testdata/corset/valid/lookup_05.accepts +++ b/testdata/corset/valid/lookup_05.accepts @@ -1,30 +1,30 @@ -{ "A": [], "B": [], "X": [], "Y": [] } +{"A": [], "B": [], "X": [], "Y": [], "B3": []} ;; -{ "A": [0], "B": [0], "X": [0], "Y": [0] } -{ "A": [1], "B": [0], "X": [1], "Y": [0] } -{ "A": [0], "B": [1], "X": [0], "Y": [3] } -{ "A": [1], "B": [1], "X": [1], "Y": [3] } +{"A": [0], "B": [0], "X": [0], "Y": [0], "B3": [0]} +{"A": [1], "B": [0], "X": [1], "Y": [0], "B3": [0]} +{"A": [0], "B": [1], "X": [0], "Y": [3], "B3": [3]} +{"A": [1], "B": [1], "X": [1], "Y": [3], "B3": [3]} ;; -{ "A": [0,0], "B": [0,0], "X": [0,0], "Y": [0,0] } -{ "A": [1,0], "B": [0,0], "X": [1,0], "Y": [0,0] } -{ "A": [1,0], "B": [0,0], "X": [0,1], "Y": [0,0] } -{ "A": [1,0], "B": [0,0], "X": [1,1], "Y": [0,0] } -{ "A": [0,0], "B": [1,0], "X": [0,0], "Y": [3,0] } -{ "A": [0,0], "B": [1,0], "X": [0,0], "Y": [0,3] } -{ "A": [0,0], "B": [1,0], "X": [0,0], "Y": [3,3] } -{ "A": [1,0], "B": [1,0], "X": [1,0], "Y": [3,0] } -{ "A": [1,0], "B": [1,0], "X": [0,1], "Y": [0,3] } -{ "A": [0,1], "B": [1,0], "X": [0,1], "Y": [3,0] } -{ "A": [0,1], "B": [1,0], "X": [1,0], "Y": [0,3] } -{ "A": [1,1], "B": [1,0], "X": [1,1], "Y": [3,0] } -{ "A": [1,1], "B": [1,0], "X": [1,1], "Y": [0,3] } +{"A": [0, 0], "B": [0, 0], "X": [0, 0], "Y": [0, 0], "B3": [0, 0]} +{"A": [1, 0], "B": [0, 0], "X": [1, 0], "Y": [0, 0], "B3": [0, 0]} +{"A": [1, 0], "B": [0, 0], "X": [0, 1], "Y": [0, 0], "B3": [0, 0]} +{"A": [1, 0], "B": [0, 0], "X": [1, 1], "Y": [0, 0], "B3": [0, 0]} +{"A": [0, 0], "B": [1, 0], "X": [0, 0], "Y": [3, 0], "B3": [3, 0]} +{"A": [0, 0], "B": [1, 0], "X": [0, 0], "Y": [0, 3], "B3": [3, 0]} +{"A": [0, 0], "B": [1, 0], "X": [0, 0], "Y": [3, 3], "B3": [3, 0]} +{"A": [1, 0], "B": [1, 0], "X": [1, 0], "Y": [3, 0], "B3": [3, 0]} +{"A": [1, 0], "B": [1, 0], "X": [0, 1], "Y": [0, 3], "B3": [3, 0]} +{"A": [0, 1], "B": [1, 0], "X": [0, 1], "Y": [3, 0], "B3": [3, 0]} +{"A": [0, 1], "B": [1, 0], "X": [1, 0], "Y": [0, 3], "B3": [3, 0]} +{"A": [1, 1], "B": [1, 0], "X": [1, 1], "Y": [3, 0], "B3": [3, 0]} +{"A": [1, 1], "B": [1, 0], "X": [1, 1], "Y": [0, 3], "B3": [3, 0]} ;; -{ "A": [1,0,0], "B": [1,0,0], "X": [1,0,0], "Y": [3,0,0] } -{ "A": [1,0,0], "B": [1,0,0], "X": [0,1,0], "Y": [0,3,0] } -{ "A": [1,0,0], "B": [1,0,0], "X": [0,0,1], "Y": [0,0,3] } -{ "A": [0,1,0], "B": [0,1,0], "X": [1,0,0], "Y": [3,0,0] } -{ "A": [0,1,0], "B": [0,1,0], "X": [0,1,0], "Y": [0,3,0] } -{ "A": [0,1,0], "B": [0,1,0], "X": [0,0,1], "Y": [0,0,3] } -{ "A": [0,0,1], "B": [0,0,1], "X": [1,0,0], "Y": [3,0,0] } -{ "A": [0,0,1], "B": [0,0,1], "X": [0,1,0], "Y": [0,3,0] } -{ "A": [0,0,1], "B": [0,0,1], "X": [0,0,1], "Y": [0,0,3] } +{"A": [1, 0, 0], "B": [1, 0, 0], "X": [1, 0, 0], "Y": [3, 0, 0], "B3": [3, 0, 0]} +{"A": [1, 0, 0], "B": [1, 0, 0], "X": [0, 1, 0], "Y": [0, 3, 0], "B3": [3, 0, 0]} +{"A": [1, 0, 0], "B": [1, 0, 0], "X": [0, 0, 1], "Y": [0, 0, 3], "B3": [3, 0, 0]} +{"A": [0, 1, 0], "B": [0, 1, 0], "X": [1, 0, 0], "Y": [3, 0, 0], "B3": [0, 3, 0]} +{"A": [0, 1, 0], "B": [0, 1, 0], "X": [0, 1, 0], "Y": [0, 3, 0], "B3": [0, 3, 0]} +{"A": [0, 1, 0], "B": [0, 1, 0], "X": [0, 0, 1], "Y": [0, 0, 3], "B3": [0, 3, 0]} +{"A": [0, 0, 1], "B": [0, 0, 1], "X": [1, 0, 0], "Y": [3, 0, 0], "B3": [0, 0, 3]} +{"A": [0, 0, 1], "B": [0, 0, 1], "X": [0, 1, 0], "Y": [0, 3, 0], "B3": [0, 0, 3]} +{"A": [0, 0, 1], "B": [0, 0, 1], "X": [0, 0, 1], "Y": [0, 0, 3], "B3": [0, 0, 3]} diff --git a/testdata/corset/valid/lookup_05.lisp b/testdata/corset/valid/lookup_05.lisp index 2634ac278..7326cbc02 100644 --- a/testdata/corset/valid/lookup_05.lisp +++ b/testdata/corset/valid/lookup_05.lisp @@ -1,2 +1,4 @@ -(defcolumns (A :i16) (B :i16) (X :i16) (Y :i18)) -(deflookup test (X Y) (A (* B 3))) +(defcolumns (A :i16) (B :i16) (X :i16) (Y :i18) (B3 :i18)) +;; B3 holds the value of the expression (* B 3) +(defconstraint b3_def () (== B3 (* B 3))) +(deflookup test (X Y) (A B3)) diff --git a/testdata/corset/valid/lookup_05.rejects b/testdata/corset/valid/lookup_05.rejects index ce22cc645..0568b8f1a 100644 --- a/testdata/corset/valid/lookup_05.rejects +++ b/testdata/corset/valid/lookup_05.rejects @@ -1,23 +1,23 @@ -{ "A": [0], "B": [1], "X": [0], "Y": [0] } -{ "A": [1], "B": [0], "X": [0], "Y": [0] } -{ "A": [1], "B": [1], "X": [0], "Y": [0] } +{"A": [0], "B": [1], "X": [0], "Y": [0], "B3": [3]} +{"A": [1], "B": [0], "X": [0], "Y": [0], "B3": [0]} +{"A": [1], "B": [1], "X": [0], "Y": [0], "B3": [3]} ;; -{ "A": [1,0], "B": [0,0], "X": [0,0], "Y": [0,0] } -{ "A": [0,1], "B": [0,0], "X": [0,0], "Y": [0,0] } -{ "A": [1,1], "B": [0,0], "X": [0,0], "Y": [0,0] } -{ "A": [0,0], "B": [1,0], "X": [0,0], "Y": [0,0] } -{ "A": [0,0], "B": [0,1], "X": [0,0], "Y": [0,0] } -{ "A": [0,0], "B": [1,1], "X": [0,0], "Y": [0,0] } +{"A": [1, 0], "B": [0, 0], "X": [0, 0], "Y": [0, 0], "B3": [0, 0]} +{"A": [0, 1], "B": [0, 0], "X": [0, 0], "Y": [0, 0], "B3": [0, 0]} +{"A": [1, 1], "B": [0, 0], "X": [0, 0], "Y": [0, 0], "B3": [0, 0]} +{"A": [0, 0], "B": [1, 0], "X": [0, 0], "Y": [0, 0], "B3": [3, 0]} +{"A": [0, 0], "B": [0, 1], "X": [0, 0], "Y": [0, 0], "B3": [0, 3]} +{"A": [0, 0], "B": [1, 1], "X": [0, 0], "Y": [0, 0], "B3": [3, 3]} ;; -{ "A": [1,0], "B": [1,0], "X": [1,0], "Y": [0,3] } -{ "A": [0,1], "B": [0,1], "X": [1,0], "Y": [0,3] } -{ "A": [1,0], "B": [1,0], "X": [0,1], "Y": [3,0] } -{ "A": [0,1], "B": [0,1], "X": [0,1], "Y": [3,0] } -{ "A": [2,1], "B": [2,1], "X": [1,1], "Y": [6,3] } -{ "A": [2,1], "B": [2,1], "X": [1,1], "Y": [3,6] } -{ "A": [1,2], "B": [2,1], "X": [1,1], "Y": [6,3] } -{ "A": [1,2], "B": [2,1], "X": [1,1], "Y": [3,6] } -{ "A": [2,1], "B": [2,1], "X": [1,2], "Y": [6,3] } -{ "A": [2,1], "B": [2,1], "X": [2,1], "Y": [3,6] } -{ "A": [1,2], "B": [2,1], "X": [2,1], "Y": [6,3] } -{ "A": [1,2], "B": [2,1], "X": [1,2], "Y": [3,6] } +{"A": [1, 0], "B": [1, 0], "X": [1, 0], "Y": [0, 3], "B3": [3, 0]} +{"A": [0, 1], "B": [0, 1], "X": [1, 0], "Y": [0, 3], "B3": [0, 3]} +{"A": [1, 0], "B": [1, 0], "X": [0, 1], "Y": [3, 0], "B3": [3, 0]} +{"A": [0, 1], "B": [0, 1], "X": [0, 1], "Y": [3, 0], "B3": [0, 3]} +{"A": [2, 1], "B": [2, 1], "X": [1, 1], "Y": [6, 3], "B3": [6, 3]} +{"A": [2, 1], "B": [2, 1], "X": [1, 1], "Y": [3, 6], "B3": [6, 3]} +{"A": [1, 2], "B": [2, 1], "X": [1, 1], "Y": [6, 3], "B3": [6, 3]} +{"A": [1, 2], "B": [2, 1], "X": [1, 1], "Y": [3, 6], "B3": [6, 3]} +{"A": [2, 1], "B": [2, 1], "X": [1, 2], "Y": [6, 3], "B3": [6, 3]} +{"A": [2, 1], "B": [2, 1], "X": [2, 1], "Y": [3, 6], "B3": [6, 3]} +{"A": [1, 2], "B": [2, 1], "X": [2, 1], "Y": [6, 3], "B3": [6, 3]} +{"A": [1, 2], "B": [2, 1], "X": [1, 2], "Y": [3, 6], "B3": [6, 3]} diff --git a/testdata/corset/valid/lookup_07.accepts b/testdata/corset/valid/lookup_07.accepts index 52388a316..f17a38659 100644 --- a/testdata/corset/valid/lookup_07.accepts +++ b/testdata/corset/valid/lookup_07.accepts @@ -1,11 +1,11 @@ -{ "A": [], "B": [], "X": [] } -{ "A": [1], "B": [0], "X": [1] } -{ "A": [1,2,3], "B": [0,1,2], "X": [1,0,0] } -{ "A": [1,2,3], "B": [0,1,2], "X": [1,1,0] } -{ "A": [1,2,3], "B": [0,1,2], "X": [0,1,1] } -{ "A": [1,2,3], "B": [0,1,2], "X": [0,0,1] } +{"A": [], "B": [], "X": [], "Z": []} +{"A": [1], "B": [0], "X": [1], "Z": [0]} +{"A": [1, 2, 3], "B": [0, 1, 2], "X": [1, 0, 0], "Z": [0, 0, 0]} +{"A": [1, 2, 3], "B": [0, 1, 2], "X": [1, 1, 0], "Z": [0, 0, 0]} +{"A": [1, 2, 3], "B": [0, 1, 2], "X": [0, 1, 1], "Z": [0, 0, 0]} +{"A": [1, 2, 3], "B": [0, 1, 2], "X": [0, 0, 1], "Z": [0, 0, 0]} -{ "A": [1,2,3], "B": [1,0,2], "X": [2,0,0] } -{ "A": [1,2,3], "B": [1,0,2], "X": [2,2,0] } -{ "A": [1,2,3], "B": [1,0,2], "X": [0,2,2] } -{ "A": [1,2,3], "B": [1,0,2], "X": [0,0,2] } +{"A": [1, 2, 3], "B": [1, 0, 2], "X": [2, 0, 0], "Z": [0, 0, 0]} +{"A": [1, 2, 3], "B": [1, 0, 2], "X": [2, 2, 0], "Z": [0, 0, 0]} +{"A": [1, 2, 3], "B": [1, 0, 2], "X": [0, 2, 2], "Z": [0, 0, 0]} +{"A": [1, 2, 3], "B": [1, 0, 2], "X": [0, 0, 2], "Z": [0, 0, 0]} diff --git a/testdata/corset/valid/lookup_07.lisp b/testdata/corset/valid/lookup_07.lisp index b76e589de..3c36b49a4 100644 --- a/testdata/corset/valid/lookup_07.lisp +++ b/testdata/corset/valid/lookup_07.lisp @@ -1,2 +1,4 @@ -(defcolumns (A :i16) (B :i16) (X :i16)) -(deflookup test (A B) (X 0)) +(defcolumns (A :i16) (B :i16) (X :i16) (Z :i16)) +;; Z holds the value of the constant 0 +(defconstraint z_def () (== Z 0)) +(deflookup test (A B) (X Z)) diff --git a/testdata/corset/valid/lookup_07.rejects b/testdata/corset/valid/lookup_07.rejects index 804035b27..78bedebfb 100644 --- a/testdata/corset/valid/lookup_07.rejects +++ b/testdata/corset/valid/lookup_07.rejects @@ -1,10 +1,10 @@ -{ "A": [0], "B": [0], "X": [1] } -{ "A": [1], "B": [1], "X": [1] } -{ "A": [0,1], "B": [0,1], "X": [0,1] } -{ "A": [1,0], "B": [1,0], "X": [0,1] } -{ "A": [0,1], "B": [0,1], "X": [0,1] } -{ "A": [1,1], "B": [1,1], "X": [0,1] } -{ "A": [0,1], "B": [0,1], "X": [1,0] } -{ "A": [1,0], "B": [1,0], "X": [1,0] } -{ "A": [0,1], "B": [0,1], "X": [1,0] } -{ "A": [1,1], "B": [1,1], "X": [1,0] } +{"A": [0], "B": [0], "X": [1], "Z": [0]} +{"A": [1], "B": [1], "X": [1], "Z": [0]} +{"A": [0, 1], "B": [0, 1], "X": [0, 1], "Z": [0, 0]} +{"A": [1, 0], "B": [1, 0], "X": [0, 1], "Z": [0, 0]} +{"A": [0, 1], "B": [0, 1], "X": [0, 1], "Z": [0, 0]} +{"A": [1, 1], "B": [1, 1], "X": [0, 1], "Z": [0, 0]} +{"A": [0, 1], "B": [0, 1], "X": [1, 0], "Z": [0, 0]} +{"A": [1, 0], "B": [1, 0], "X": [1, 0], "Z": [0, 0]} +{"A": [0, 1], "B": [0, 1], "X": [1, 0], "Z": [0, 0]} +{"A": [1, 1], "B": [1, 1], "X": [1, 0], "Z": [0, 0]} diff --git a/testdata/corset/valid/lookup_08.accepts b/testdata/corset/valid/lookup_08.accepts index 1c1a8fd79..991d09a30 100644 --- a/testdata/corset/valid/lookup_08.accepts +++ b/testdata/corset/valid/lookup_08.accepts @@ -1,11 +1,11 @@ -{ "B": [], "A": [], "X": [] } -{ "B": [1], "A": [0], "X": [1] } -{ "B": [1,2,3], "A": [0,1,2], "X": [1,0,0] } -{ "B": [1,2,3], "A": [0,1,2], "X": [1,1,0] } -{ "B": [1,2,3], "A": [0,1,2], "X": [0,1,1] } -{ "B": [1,2,3], "A": [0,1,2], "X": [0,0,1] } +{"B": [], "A": [], "X": [], "Z": []} +{"B": [1], "A": [0], "X": [1], "Z": [0]} +{"B": [1, 2, 3], "A": [0, 1, 2], "X": [1, 0, 0], "Z": [0, 0, 0]} +{"B": [1, 2, 3], "A": [0, 1, 2], "X": [1, 1, 0], "Z": [0, 0, 0]} +{"B": [1, 2, 3], "A": [0, 1, 2], "X": [0, 1, 1], "Z": [0, 0, 0]} +{"B": [1, 2, 3], "A": [0, 1, 2], "X": [0, 0, 1], "Z": [0, 0, 0]} -{ "B": [1,2,3], "A": [1,0,2], "X": [2,0,0] } -{ "B": [1,2,3], "A": [1,0,2], "X": [2,2,0] } -{ "B": [1,2,3], "A": [1,0,2], "X": [0,2,2] } -{ "B": [1,2,3], "A": [1,0,2], "X": [0,0,2] } +{"B": [1, 2, 3], "A": [1, 0, 2], "X": [2, 0, 0], "Z": [0, 0, 0]} +{"B": [1, 2, 3], "A": [1, 0, 2], "X": [2, 2, 0], "Z": [0, 0, 0]} +{"B": [1, 2, 3], "A": [1, 0, 2], "X": [0, 2, 2], "Z": [0, 0, 0]} +{"B": [1, 2, 3], "A": [1, 0, 2], "X": [0, 0, 2], "Z": [0, 0, 0]} diff --git a/testdata/corset/valid/lookup_08.lisp b/testdata/corset/valid/lookup_08.lisp index 39a313cb5..2f4fe0f45 100644 --- a/testdata/corset/valid/lookup_08.lisp +++ b/testdata/corset/valid/lookup_08.lisp @@ -1,2 +1,4 @@ -(defcolumns (A :i16) (B :i16) (X :i16)) -(deflookup test (A B) (0 X)) +(defcolumns (A :i16) (B :i16) (X :i16) (Z :i16)) +;; Z holds the value of the constant 0 +(defconstraint z_def () (== Z 0)) +(deflookup test (A B) (Z X)) diff --git a/testdata/corset/valid/lookup_08.rejects b/testdata/corset/valid/lookup_08.rejects index c34978078..be33caad9 100644 --- a/testdata/corset/valid/lookup_08.rejects +++ b/testdata/corset/valid/lookup_08.rejects @@ -1,10 +1,10 @@ -{ "B": [0], "A": [0], "X": [1] } -{ "B": [1], "A": [1], "X": [1] } -{ "B": [0,1], "A": [0,1], "X": [0,1] } -{ "B": [1,0], "A": [1,0], "X": [0,1] } -{ "B": [0,1], "A": [0,1], "X": [0,1] } -{ "B": [1,1], "A": [1,1], "X": [0,1] } -{ "B": [0,1], "A": [0,1], "X": [1,0] } -{ "B": [1,0], "A": [1,0], "X": [1,0] } -{ "B": [0,1], "A": [0,1], "X": [1,0] } -{ "B": [1,1], "A": [1,1], "X": [1,0] } +{"B": [0], "A": [0], "X": [1], "Z": [0]} +{"B": [1], "A": [1], "X": [1], "Z": [0]} +{"B": [0, 1], "A": [0, 1], "X": [0, 1], "Z": [0, 0]} +{"B": [1, 0], "A": [1, 0], "X": [0, 1], "Z": [0, 0]} +{"B": [0, 1], "A": [0, 1], "X": [0, 1], "Z": [0, 0]} +{"B": [1, 1], "A": [1, 1], "X": [0, 1], "Z": [0, 0]} +{"B": [0, 1], "A": [0, 1], "X": [1, 0], "Z": [0, 0]} +{"B": [1, 0], "A": [1, 0], "X": [1, 0], "Z": [0, 0]} +{"B": [0, 1], "A": [0, 1], "X": [1, 0], "Z": [0, 0]} +{"B": [1, 1], "A": [1, 1], "X": [1, 0], "Z": [0, 0]} diff --git a/testdata/corset/valid/lookup_10.accepts b/testdata/corset/valid/lookup_10.accepts index c0b9d8607..058f88d2d 100644 --- a/testdata/corset/valid/lookup_10.accepts +++ b/testdata/corset/valid/lookup_10.accepts @@ -1,41 +1,41 @@ -{ "m1.X": [], "m1.Y": [] } -{ "m1.X": [0], "m1.Y": [0] } -{ "m1.X": [0], "m1.Y": [1] } -{ "m1.X": [1], "m1.Y": [2] } -{ "m1.X": [2], "m1.Y": [4] } +{"m1.X": [], "m1.Y": [], "m1.X2": []} +{"m1.X": [0], "m1.Y": [0], "m1.X2": [0]} +{"m1.X": [0], "m1.Y": [1], "m1.X2": [0]} +{"m1.X": [1], "m1.Y": [2], "m1.X2": [2]} +{"m1.X": [2], "m1.Y": [4], "m1.X2": [4]} ;; -{ "m1.X": [0,0], "m1.Y": [0,0] } -{ "m1.X": [0,0], "m1.Y": [1,2] } -{ "m1.X": [1,0], "m1.Y": [1,2] } -{ "m1.X": [0,1], "m1.Y": [1,2] } -{ "m1.X": [1,1], "m1.Y": [1,2] } -{ "m1.X": [0,0], "m1.Y": [2,1] } -{ "m1.X": [1,0], "m1.Y": [2,1] } -{ "m1.X": [0,1], "m1.Y": [2,1] } -{ "m1.X": [1,1], "m1.Y": [2,1] } -{ "m1.X": [0,0], "m1.Y": [2,2] } -{ "m1.X": [1,0], "m1.Y": [2,2] } -{ "m1.X": [0,1], "m1.Y": [2,2] } -{ "m1.X": [1,1], "m1.Y": [2,2] } +{"m1.X": [0, 0], "m1.Y": [0, 0], "m1.X2": [0, 0]} +{"m1.X": [0, 0], "m1.Y": [1, 2], "m1.X2": [0, 0]} +{"m1.X": [1, 0], "m1.Y": [1, 2], "m1.X2": [2, 0]} +{"m1.X": [0, 1], "m1.Y": [1, 2], "m1.X2": [0, 2]} +{"m1.X": [1, 1], "m1.Y": [1, 2], "m1.X2": [2, 2]} +{"m1.X": [0, 0], "m1.Y": [2, 1], "m1.X2": [0, 0]} +{"m1.X": [1, 0], "m1.Y": [2, 1], "m1.X2": [2, 0]} +{"m1.X": [0, 1], "m1.Y": [2, 1], "m1.X2": [0, 2]} +{"m1.X": [1, 1], "m1.Y": [2, 1], "m1.X2": [2, 2]} +{"m1.X": [0, 0], "m1.Y": [2, 2], "m1.X2": [0, 0]} +{"m1.X": [1, 0], "m1.Y": [2, 2], "m1.X2": [2, 0]} +{"m1.X": [0, 1], "m1.Y": [2, 2], "m1.X2": [0, 2]} +{"m1.X": [1, 1], "m1.Y": [2, 2], "m1.X2": [2, 2]} ;; -{ "m1.X": [0,0], "m1.Y": [0,0] } -{ "m1.X": [0,0], "m1.Y": [1,4] } -{ "m1.X": [2,0], "m1.Y": [1,4] } -{ "m1.X": [0,2], "m1.Y": [1,4] } -{ "m1.X": [2,2], "m1.Y": [1,4] } -{ "m1.X": [0,0], "m1.Y": [4,1] } -{ "m1.X": [2,0], "m1.Y": [4,1] } -{ "m1.X": [0,2], "m1.Y": [4,1] } -{ "m1.X": [2,2], "m1.Y": [4,1] } -{ "m1.X": [0,0], "m1.Y": [4,4] } -{ "m1.X": [2,0], "m1.Y": [4,4] } -{ "m1.X": [0,2], "m1.Y": [4,4] } -{ "m1.X": [2,2], "m1.Y": [4,4] } +{"m1.X": [0, 0], "m1.Y": [0, 0], "m1.X2": [0, 0]} +{"m1.X": [0, 0], "m1.Y": [1, 4], "m1.X2": [0, 0]} +{"m1.X": [2, 0], "m1.Y": [1, 4], "m1.X2": [4, 0]} +{"m1.X": [0, 2], "m1.Y": [1, 4], "m1.X2": [0, 4]} +{"m1.X": [2, 2], "m1.Y": [1, 4], "m1.X2": [4, 4]} +{"m1.X": [0, 0], "m1.Y": [4, 1], "m1.X2": [0, 0]} +{"m1.X": [2, 0], "m1.Y": [4, 1], "m1.X2": [4, 0]} +{"m1.X": [0, 2], "m1.Y": [4, 1], "m1.X2": [0, 4]} +{"m1.X": [2, 2], "m1.Y": [4, 1], "m1.X2": [4, 4]} +{"m1.X": [0, 0], "m1.Y": [4, 4], "m1.X2": [0, 0]} +{"m1.X": [2, 0], "m1.Y": [4, 4], "m1.X2": [4, 0]} +{"m1.X": [0, 2], "m1.Y": [4, 4], "m1.X2": [0, 4]} +{"m1.X": [2, 2], "m1.Y": [4, 4], "m1.X2": [4, 4]} ;; -{ "m1.X": [1,2,3], "m1.Y": [2,4,6] } -{ "m1.X": [2,1,3], "m1.Y": [2,4,6] } -{ "m1.X": [1,3,2], "m1.Y": [2,4,6] } -{ "m1.X": [1,2,3], "m1.Y": [4,2,6] } -{ "m1.X": [1,2,3], "m1.Y": [2,6,4] } -{ "m1.X": [1,2,3], "m1.Y": [6,4,2] } -{ "m1.X": [1,2,3], "m1.Y": [6,2,4] } +{"m1.X": [1, 2, 3], "m1.Y": [2, 4, 6], "m1.X2": [2, 4, 6]} +{"m1.X": [2, 1, 3], "m1.Y": [2, 4, 6], "m1.X2": [4, 2, 6]} +{"m1.X": [1, 3, 2], "m1.Y": [2, 4, 6], "m1.X2": [2, 6, 4]} +{"m1.X": [1, 2, 3], "m1.Y": [4, 2, 6], "m1.X2": [2, 4, 6]} +{"m1.X": [1, 2, 3], "m1.Y": [2, 6, 4], "m1.X2": [2, 4, 6]} +{"m1.X": [1, 2, 3], "m1.Y": [6, 4, 2], "m1.X2": [2, 4, 6]} +{"m1.X": [1, 2, 3], "m1.Y": [6, 2, 4], "m1.X2": [2, 4, 6]} diff --git a/testdata/corset/valid/lookup_10.lisp b/testdata/corset/valid/lookup_10.lisp index 1430492b1..3cf39d4d8 100644 --- a/testdata/corset/valid/lookup_10.lisp +++ b/testdata/corset/valid/lookup_10.lisp @@ -1,5 +1,7 @@ (defun (selector) (* m1.X 2)) (module m1) -(defcolumns (X :i16) (Y :i17)) -(deflookup test (Y) ((selector))) +(defcolumns (X :i16) (Y :i17) (X2 :i17)) +;; X2 holds the value of the expression (selector) +(defconstraint x2_def () (== X2 (selector))) +(deflookup test (Y) (X2)) diff --git a/testdata/corset/valid/lookup_10.rejects b/testdata/corset/valid/lookup_10.rejects index 213bcbe82..999f37d5e 100644 --- a/testdata/corset/valid/lookup_10.rejects +++ b/testdata/corset/valid/lookup_10.rejects @@ -1,18 +1,18 @@ -{ "m1.X": [1], "m1.Y": [1] } -{ "m1.X": [2], "m1.Y": [1] } -{ "m1.X": [3], "m1.Y": [1] } -{ "m1.X": [1], "m1.Y": [3] } -{ "m1.X": [1], "m1.Y": [4] } -{ "m1.X": [1], "m1.Y": [5] } -{ "m1.X": [2], "m1.Y": [2] } -{ "m1.X": [2], "m1.Y": [3] } -{ "m1.X": [2], "m1.Y": [5] } -{ "m1.X": [1,0], "m1.Y": [1,1] } -{ "m1.X": [1,0], "m1.Y": [1,3] } -{ "m1.X": [1,0], "m1.Y": [1,4] } -{ "m1.X": [0,1], "m1.Y": [1,1] } -{ "m1.X": [0,1], "m1.Y": [1,3] } -{ "m1.X": [0,1], "m1.Y": [1,4] } -{ "m1.X": [1,1], "m1.Y": [1,1] } -{ "m1.X": [1,1], "m1.Y": [1,3] } -{ "m1.X": [1,1], "m1.Y": [1,4] } +{"m1.X": [1], "m1.Y": [1], "m1.X2": [2]} +{"m1.X": [2], "m1.Y": [1], "m1.X2": [4]} +{"m1.X": [3], "m1.Y": [1], "m1.X2": [6]} +{"m1.X": [1], "m1.Y": [3], "m1.X2": [2]} +{"m1.X": [1], "m1.Y": [4], "m1.X2": [2]} +{"m1.X": [1], "m1.Y": [5], "m1.X2": [2]} +{"m1.X": [2], "m1.Y": [2], "m1.X2": [4]} +{"m1.X": [2], "m1.Y": [3], "m1.X2": [4]} +{"m1.X": [2], "m1.Y": [5], "m1.X2": [4]} +{"m1.X": [1, 0], "m1.Y": [1, 1], "m1.X2": [2, 0]} +{"m1.X": [1, 0], "m1.Y": [1, 3], "m1.X2": [2, 0]} +{"m1.X": [1, 0], "m1.Y": [1, 4], "m1.X2": [2, 0]} +{"m1.X": [0, 1], "m1.Y": [1, 1], "m1.X2": [0, 2]} +{"m1.X": [0, 1], "m1.Y": [1, 3], "m1.X2": [0, 2]} +{"m1.X": [0, 1], "m1.Y": [1, 4], "m1.X2": [0, 2]} +{"m1.X": [1, 1], "m1.Y": [1, 1], "m1.X2": [2, 2]} +{"m1.X": [1, 1], "m1.Y": [1, 3], "m1.X2": [2, 2]} +{"m1.X": [1, 1], "m1.Y": [1, 4], "m1.X2": [2, 2]} diff --git a/testdata/corset/valid/lookup_12.accepts b/testdata/corset/valid/lookup_12.accepts index 2ec68fdd1..a6ca4838f 100644 --- a/testdata/corset/valid/lookup_12.accepts +++ b/testdata/corset/valid/lookup_12.accepts @@ -1,175 +1,175 @@ ;; { "X": [], "Y": [] } ;; { "X": [0], "Y": [0] } ;; Check initial padding row! -{ "X": [0], "Y": [1] } +{"X": [0], "Y": [1], "Z": [0]} ;; -{ "X": [0,0], "Y": [0,0] } -{ "X": [0,0], "Y": [0,1] } -{ "X": [0,0], "Y": [1,0] } -{ "X": [1,0], "Y": [0,1] } -{ "X": [1,0], "Y": [1,0] } -{ "X": [1,0], "Y": [1,1] } -{ "X": [0,1], "Y": [0,1] } -{ "X": [0,1], "Y": [1,0] } -{ "X": [0,1], "Y": [1,1] } -{ "X": [1,1], "Y": [0,1] } -{ "X": [1,1], "Y": [1,0] } -{ "X": [1,1], "Y": [1,1] } -{ "X": [1,1], "Y": [1,2] } -{ "X": [2,2], "Y": [2,2] } -{ "X": [2,2], "Y": [2,1] } -{ "X": [2,2], "Y": [1,2] } -{ "X": [1,2], "Y": [2,1] } -{ "X": [1,2], "Y": [1,2] } -{ "X": [2,1], "Y": [2,1] } -{ "X": [2,1], "Y": [1,2] } -{ "X": [1,1], "Y": [2,1] } -{ "X": [1,1], "Y": [1,2] } -{ "X": [1,1], "Y": [1,1] } +{"X": [0, 0], "Y": [0, 0], "Z": [0, 0]} +{"X": [0, 0], "Y": [0, 1], "Z": [0, 0]} +{"X": [0, 0], "Y": [1, 0], "Z": [0, 0]} +{"X": [1, 0], "Y": [0, 1], "Z": [1, 0]} +{"X": [1, 0], "Y": [1, 0], "Z": [1, 0]} +{"X": [1, 0], "Y": [1, 1], "Z": [1, 0]} +{"X": [0, 1], "Y": [0, 1], "Z": [0, 1]} +{"X": [0, 1], "Y": [1, 0], "Z": [0, 1]} +{"X": [0, 1], "Y": [1, 1], "Z": [0, 1]} +{"X": [1, 1], "Y": [0, 1], "Z": [1, 1]} +{"X": [1, 1], "Y": [1, 0], "Z": [1, 1]} +{"X": [1, 1], "Y": [1, 1], "Z": [1, 1]} +{"X": [1, 1], "Y": [1, 2], "Z": [1, 1]} +{"X": [2, 2], "Y": [2, 2], "Z": [2, 2]} +{"X": [2, 2], "Y": [2, 1], "Z": [2, 2]} +{"X": [2, 2], "Y": [1, 2], "Z": [2, 2]} +{"X": [1, 2], "Y": [2, 1], "Z": [1, 2]} +{"X": [1, 2], "Y": [1, 2], "Z": [1, 2]} +{"X": [2, 1], "Y": [2, 1], "Z": [2, 1]} +{"X": [2, 1], "Y": [1, 2], "Z": [2, 1]} +{"X": [1, 1], "Y": [2, 1], "Z": [1, 1]} +{"X": [1, 1], "Y": [1, 2], "Z": [1, 1]} +{"X": [1, 1], "Y": [1, 1], "Z": [1, 1]} ;; -{ "X": [0,0,0], "Y": [2,0,1] } -{ "X": [1,0,0], "Y": [2,0,1] } -{ "X": [0,1,0], "Y": [2,0,1] } -{ "X": [0,0,1], "Y": [2,0,1] } -{ "X": [1,0,1], "Y": [2,0,1] } -{ "X": [0,1,1], "Y": [2,0,1] } -{ "X": [1,1,0], "Y": [2,0,1] } -{ "X": [1,1,1], "Y": [2,0,1] } -{ "X": [0,0,0], "Y": [0,2,1] } -{ "X": [1,0,0], "Y": [0,2,1] } -{ "X": [0,1,0], "Y": [0,2,1] } -{ "X": [0,0,1], "Y": [0,2,1] } -{ "X": [1,0,1], "Y": [0,2,1] } -{ "X": [0,1,1], "Y": [0,2,1] } -{ "X": [1,1,0], "Y": [0,2,1] } -{ "X": [1,1,1], "Y": [0,2,1] } -{ "X": [0,0,0], "Y": [0,1,2] } -{ "X": [1,0,0], "Y": [0,1,2] } -{ "X": [0,1,0], "Y": [0,1,2] } -{ "X": [0,0,1], "Y": [0,1,2] } -{ "X": [1,0,1], "Y": [0,1,2] } -{ "X": [0,1,1], "Y": [0,1,2] } -{ "X": [1,1,0], "Y": [0,1,2] } -{ "X": [1,1,1], "Y": [0,1,2] } -{ "X": [0,0,0], "Y": [2,1,0] } -{ "X": [1,0,0], "Y": [2,1,0] } -{ "X": [0,1,0], "Y": [2,1,0] } -{ "X": [0,0,1], "Y": [2,1,0] } -{ "X": [1,0,1], "Y": [2,1,0] } -{ "X": [0,1,1], "Y": [2,1,0] } -{ "X": [1,1,0], "Y": [2,1,0] } -{ "X": [1,1,1], "Y": [2,1,0] } -{ "X": [0,0,0], "Y": [1,2,0] } -{ "X": [1,0,0], "Y": [1,2,0] } -{ "X": [0,1,0], "Y": [1,2,0] } -{ "X": [0,0,1], "Y": [1,2,0] } -{ "X": [1,0,1], "Y": [1,2,0] } -{ "X": [0,1,1], "Y": [1,2,0] } -{ "X": [1,1,0], "Y": [1,2,0] } -{ "X": [1,1,1], "Y": [1,2,0] } -{ "X": [0,0,0], "Y": [1,0,2] } -{ "X": [1,0,0], "Y": [1,0,2] } -{ "X": [0,1,0], "Y": [1,0,2] } -{ "X": [0,0,1], "Y": [1,0,2] } -{ "X": [1,0,1], "Y": [1,0,2] } -{ "X": [0,1,1], "Y": [1,0,2] } -{ "X": [1,1,0], "Y": [1,0,2] } -{ "X": [1,1,1], "Y": [1,0,2] } -{ "X": [0,0,0], "Y": [2,1,1] } -{ "X": [1,0,0], "Y": [2,1,1] } -{ "X": [0,1,0], "Y": [2,1,1] } -{ "X": [0,0,1], "Y": [2,1,1] } -{ "X": [1,0,1], "Y": [2,1,1] } -{ "X": [0,1,1], "Y": [2,1,1] } -{ "X": [1,1,0], "Y": [2,1,1] } -{ "X": [1,1,1], "Y": [2,1,1] } -{ "X": [0,0,0], "Y": [1,2,1] } -{ "X": [1,0,0], "Y": [1,2,1] } -{ "X": [0,1,0], "Y": [1,2,1] } -{ "X": [0,0,1], "Y": [1,2,1] } -{ "X": [1,0,1], "Y": [1,2,1] } -{ "X": [0,1,1], "Y": [1,2,1] } -{ "X": [1,1,0], "Y": [1,2,1] } -{ "X": [1,1,1], "Y": [1,2,1] } -{ "X": [0,0,0], "Y": [1,1,2] } -{ "X": [1,0,0], "Y": [1,1,2] } -{ "X": [0,1,0], "Y": [1,1,2] } -{ "X": [0,0,1], "Y": [1,1,2] } -{ "X": [1,0,1], "Y": [1,1,2] } -{ "X": [0,1,1], "Y": [1,1,2] } -{ "X": [1,1,0], "Y": [1,1,2] } -{ "X": [1,1,1], "Y": [1,1,2] } +{"X": [0, 0, 0], "Y": [2, 0, 1], "Z": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [2, 0, 1], "Z": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [2, 0, 1], "Z": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [2, 0, 1], "Z": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [2, 0, 1], "Z": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [2, 0, 1], "Z": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [2, 0, 1], "Z": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [2, 0, 1], "Z": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [0, 2, 1], "Z": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [0, 2, 1], "Z": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [0, 2, 1], "Z": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [0, 2, 1], "Z": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [0, 2, 1], "Z": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [0, 2, 1], "Z": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [0, 2, 1], "Z": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [0, 2, 1], "Z": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [0, 1, 2], "Z": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [0, 1, 2], "Z": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [0, 1, 2], "Z": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [0, 1, 2], "Z": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [0, 1, 2], "Z": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [0, 1, 2], "Z": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [0, 1, 2], "Z": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [0, 1, 2], "Z": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [2, 1, 0], "Z": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [2, 1, 0], "Z": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [2, 1, 0], "Z": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [2, 1, 0], "Z": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [2, 1, 0], "Z": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [2, 1, 0], "Z": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [2, 1, 0], "Z": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [2, 1, 0], "Z": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [1, 2, 0], "Z": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [1, 2, 0], "Z": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [1, 2, 0], "Z": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [1, 2, 0], "Z": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [1, 2, 0], "Z": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [1, 2, 0], "Z": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [1, 2, 0], "Z": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [1, 2, 0], "Z": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [1, 0, 2], "Z": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [1, 0, 2], "Z": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [1, 0, 2], "Z": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [1, 0, 2], "Z": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [1, 0, 2], "Z": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [1, 0, 2], "Z": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [1, 0, 2], "Z": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [1, 0, 2], "Z": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [2, 1, 1], "Z": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [2, 1, 1], "Z": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [2, 1, 1], "Z": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [2, 1, 1], "Z": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [2, 1, 1], "Z": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [2, 1, 1], "Z": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [2, 1, 1], "Z": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [2, 1, 1], "Z": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [1, 2, 1], "Z": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [1, 2, 1], "Z": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [1, 2, 1], "Z": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [1, 2, 1], "Z": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [1, 2, 1], "Z": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [1, 2, 1], "Z": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [1, 2, 1], "Z": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [1, 2, 1], "Z": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [1, 1, 2], "Z": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [1, 1, 2], "Z": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [1, 1, 2], "Z": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [1, 1, 2], "Z": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [1, 1, 2], "Z": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [1, 1, 2], "Z": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [1, 1, 2], "Z": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [1, 1, 2], "Z": [1, 1, 1]} ;; -{ "X": [3,3,3], "Y": [2,3,1] } -{ "X": [1,3,3], "Y": [2,3,1] } -{ "X": [3,1,3], "Y": [2,3,1] } -{ "X": [3,3,1], "Y": [2,3,1] } -{ "X": [1,3,1], "Y": [2,3,1] } -{ "X": [3,1,1], "Y": [2,3,1] } -{ "X": [1,1,3], "Y": [2,3,1] } -{ "X": [1,1,1], "Y": [2,3,1] } -{ "X": [3,3,3], "Y": [3,2,1] } -{ "X": [1,3,3], "Y": [3,2,1] } -{ "X": [3,1,3], "Y": [3,2,1] } -{ "X": [3,3,1], "Y": [3,2,1] } -{ "X": [1,3,1], "Y": [3,2,1] } -{ "X": [3,1,1], "Y": [3,2,1] } -{ "X": [1,1,3], "Y": [3,2,1] } -{ "X": [1,1,1], "Y": [3,2,1] } -{ "X": [3,3,3], "Y": [3,1,2] } -{ "X": [1,3,3], "Y": [3,1,2] } -{ "X": [3,1,3], "Y": [3,1,2] } -{ "X": [3,3,1], "Y": [3,1,2] } -{ "X": [1,3,1], "Y": [3,1,2] } -{ "X": [3,1,1], "Y": [3,1,2] } -{ "X": [1,1,3], "Y": [3,1,2] } -{ "X": [1,1,1], "Y": [3,1,2] } -{ "X": [3,3,3], "Y": [2,1,3] } -{ "X": [1,3,3], "Y": [2,1,3] } -{ "X": [3,1,3], "Y": [2,1,3] } -{ "X": [3,3,1], "Y": [2,1,3] } -{ "X": [1,3,1], "Y": [2,1,3] } -{ "X": [3,1,1], "Y": [2,1,3] } -{ "X": [1,1,3], "Y": [2,1,3] } -{ "X": [1,1,1], "Y": [2,1,3] } -{ "X": [3,3,3], "Y": [1,2,3] } -{ "X": [1,3,3], "Y": [1,2,3] } -{ "X": [3,1,3], "Y": [1,2,3] } -{ "X": [3,3,1], "Y": [1,2,3] } -{ "X": [1,3,1], "Y": [1,2,3] } -{ "X": [3,1,1], "Y": [1,2,3] } -{ "X": [1,1,3], "Y": [1,2,3] } -{ "X": [1,1,1], "Y": [1,2,3] } -{ "X": [3,3,3], "Y": [1,3,2] } -{ "X": [1,3,3], "Y": [1,3,2] } -{ "X": [3,1,3], "Y": [1,3,2] } -{ "X": [3,3,1], "Y": [1,3,2] } -{ "X": [1,3,1], "Y": [1,3,2] } -{ "X": [3,1,1], "Y": [1,3,2] } -{ "X": [1,1,3], "Y": [1,3,2] } -{ "X": [1,1,1], "Y": [1,3,2] } +{"X": [3, 3, 3], "Y": [2, 3, 1], "Z": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [2, 3, 1], "Z": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [2, 3, 1], "Z": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [2, 3, 1], "Z": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [2, 3, 1], "Z": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [2, 3, 1], "Z": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [2, 3, 1], "Z": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [2, 3, 1], "Z": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [3, 2, 1], "Z": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [3, 2, 1], "Z": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [3, 2, 1], "Z": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [3, 2, 1], "Z": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [3, 2, 1], "Z": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [3, 2, 1], "Z": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [3, 2, 1], "Z": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [3, 2, 1], "Z": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [3, 1, 2], "Z": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [3, 1, 2], "Z": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [3, 1, 2], "Z": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [3, 1, 2], "Z": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [3, 1, 2], "Z": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [3, 1, 2], "Z": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [3, 1, 2], "Z": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [3, 1, 2], "Z": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [2, 1, 3], "Z": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [2, 1, 3], "Z": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [2, 1, 3], "Z": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [2, 1, 3], "Z": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [2, 1, 3], "Z": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [2, 1, 3], "Z": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [2, 1, 3], "Z": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [2, 1, 3], "Z": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [1, 2, 3], "Z": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [1, 2, 3], "Z": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [1, 2, 3], "Z": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [1, 2, 3], "Z": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [1, 2, 3], "Z": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [1, 2, 3], "Z": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [1, 2, 3], "Z": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [1, 2, 3], "Z": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [1, 3, 2], "Z": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [1, 3, 2], "Z": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [1, 3, 2], "Z": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [1, 3, 2], "Z": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [1, 3, 2], "Z": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [1, 3, 2], "Z": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [1, 3, 2], "Z": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [1, 3, 2], "Z": [1, 1, 1]} ;; -{ "X": [3,3,3], "Y": [1,2,3] } -{ "X": [1,3,3], "Y": [1,2,3] } -{ "X": [3,1,3], "Y": [1,2,3] } -{ "X": [3,3,1], "Y": [1,2,3] } -{ "X": [1,3,1], "Y": [1,2,3] } -{ "X": [3,1,1], "Y": [1,2,3] } -{ "X": [1,1,3], "Y": [1,2,3] } -{ "X": [1,1,1], "Y": [1,2,3] } -{ "X": [3,3,3], "Y": [2,1,3] } -{ "X": [1,3,3], "Y": [2,1,3] } -{ "X": [3,1,3], "Y": [2,1,3] } -{ "X": [3,3,1], "Y": [2,1,3] } -{ "X": [1,3,1], "Y": [2,1,3] } -{ "X": [3,1,1], "Y": [2,1,3] } -{ "X": [1,1,3], "Y": [2,1,3] } -{ "X": [1,1,1], "Y": [2,1,3] } -{ "X": [3,3,3], "Y": [1,3,2] } -{ "X": [1,3,3], "Y": [1,3,2] } -{ "X": [3,1,3], "Y": [1,3,2] } -{ "X": [3,3,1], "Y": [1,3,2] } -{ "X": [1,3,1], "Y": [1,3,2] } -{ "X": [3,1,1], "Y": [1,3,2] } -{ "X": [1,1,3], "Y": [1,3,2] } -{ "X": [1,1,1], "Y": [1,3,2] } +{"X": [3, 3, 3], "Y": [1, 2, 3], "Z": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [1, 2, 3], "Z": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [1, 2, 3], "Z": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [1, 2, 3], "Z": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [1, 2, 3], "Z": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [1, 2, 3], "Z": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [1, 2, 3], "Z": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [1, 2, 3], "Z": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [2, 1, 3], "Z": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [2, 1, 3], "Z": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [2, 1, 3], "Z": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [2, 1, 3], "Z": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [2, 1, 3], "Z": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [2, 1, 3], "Z": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [2, 1, 3], "Z": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [2, 1, 3], "Z": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [1, 3, 2], "Z": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [1, 3, 2], "Z": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [1, 3, 2], "Z": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [1, 3, 2], "Z": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [1, 3, 2], "Z": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [1, 3, 2], "Z": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [1, 3, 2], "Z": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [1, 3, 2], "Z": [1, 1, 1]} diff --git a/testdata/corset/valid/lookup_12.lisp b/testdata/corset/valid/lookup_12.lisp index 5d63e3340..8baa6dea1 100644 --- a/testdata/corset/valid/lookup_12.lisp +++ b/testdata/corset/valid/lookup_12.lisp @@ -1,3 +1,5 @@ (defconst ONE 1) -(defcolumns (X :i16) (Y :i16)) -(deflookup test (Y) ((* ONE X))) +(defcolumns (X :i16) (Y :i16) (Z :i16)) +;; Z holds the value of the expression (* ONE X) +(defconstraint z_def () (== Z (* ONE X))) +(deflookup test (Y) (Z)) diff --git a/testdata/corset/valid/lookup_12.rejects b/testdata/corset/valid/lookup_12.rejects index 8418fe129..950a6439e 100644 --- a/testdata/corset/valid/lookup_12.rejects +++ b/testdata/corset/valid/lookup_12.rejects @@ -1,37 +1,37 @@ -{ "X": [1], "Y": [2] } +{"X": [1], "Y": [2], "Z": [1]} ;; -{ "X": [1,2], "Y": [1,1] } -{ "X": [2,1], "Y": [1,1] } -{ "X": [2,2], "Y": [1,1] } +{"X": [1, 2], "Y": [1, 1], "Z": [1, 2]} +{"X": [2, 1], "Y": [1, 1], "Z": [2, 1]} +{"X": [2, 2], "Y": [1, 1], "Z": [2, 2]} ;; -{ "X": [1,2], "Y": [1,3] } -{ "X": [1,2], "Y": [3,1] } -{ "X": [1,2], "Y": [1,1] } -{ "X": [2,1], "Y": [1,1] } -{ "X": [2,1], "Y": [1,3] } -{ "X": [2,1], "Y": [3,1] } -{ "X": [2,2], "Y": [1,3] } -{ "X": [2,2], "Y": [3,1] } +{"X": [1, 2], "Y": [1, 3], "Z": [1, 2]} +{"X": [1, 2], "Y": [3, 1], "Z": [1, 2]} +{"X": [1, 2], "Y": [1, 1], "Z": [1, 2]} +{"X": [2, 1], "Y": [1, 1], "Z": [2, 1]} +{"X": [2, 1], "Y": [1, 3], "Z": [2, 1]} +{"X": [2, 1], "Y": [3, 1], "Z": [2, 1]} +{"X": [2, 2], "Y": [1, 3], "Z": [2, 2]} +{"X": [2, 2], "Y": [3, 1], "Z": [2, 2]} ;; -{ "X": [3,3,3], "Y": [1,2,1] } -{ "X": [1,3,3], "Y": [1,2,1] } -{ "X": [3,1,3], "Y": [1,2,1] } -{ "X": [3,3,1], "Y": [1,2,1] } -{ "X": [1,3,1], "Y": [1,2,1] } -{ "X": [3,1,1], "Y": [1,2,1] } -{ "X": [1,1,3], "Y": [1,2,1] } -{ "X": [1,1,1], "Y": [2,2,2] } -{ "X": [1,1,1], "Y": [2,2,3] } -{ "X": [1,1,1], "Y": [3,2,2] } -{ "X": [1,1,1], "Y": [2,3,2] } -{ "X": [3,3,3], "Y": [1,1,2] } -{ "X": [1,3,3], "Y": [1,1,2] } -{ "X": [3,1,3], "Y": [1,1,2] } -{ "X": [3,3,1], "Y": [1,1,2] } -{ "X": [1,3,1], "Y": [1,1,2] } -{ "X": [3,1,1], "Y": [1,1,2] } -{ "X": [1,1,3], "Y": [1,1,2] } -{ "X": [1,1,1], "Y": [2,2,2] } -{ "X": [1,1,1], "Y": [3,2,2] } -{ "X": [1,1,1], "Y": [2,3,2] } -{ "X": [1,1,1], "Y": [2,2,3] } +{"X": [3, 3, 3], "Y": [1, 2, 1], "Z": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [1, 2, 1], "Z": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [1, 2, 1], "Z": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [1, 2, 1], "Z": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [1, 2, 1], "Z": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [1, 2, 1], "Z": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [1, 2, 1], "Z": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [2, 2, 2], "Z": [1, 1, 1]} +{"X": [1, 1, 1], "Y": [2, 2, 3], "Z": [1, 1, 1]} +{"X": [1, 1, 1], "Y": [3, 2, 2], "Z": [1, 1, 1]} +{"X": [1, 1, 1], "Y": [2, 3, 2], "Z": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [1, 1, 2], "Z": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [1, 1, 2], "Z": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [1, 1, 2], "Z": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [1, 1, 2], "Z": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [1, 1, 2], "Z": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [1, 1, 2], "Z": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [1, 1, 2], "Z": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [2, 2, 2], "Z": [1, 1, 1]} +{"X": [1, 1, 1], "Y": [3, 2, 2], "Z": [1, 1, 1]} +{"X": [1, 1, 1], "Y": [2, 3, 2], "Z": [1, 1, 1]} +{"X": [1, 1, 1], "Y": [2, 2, 3], "Z": [1, 1, 1]} diff --git a/testdata/corset/valid/lookup_15.accepts b/testdata/corset/valid/lookup_15.accepts index 03c08460f..18259153b 100644 --- a/testdata/corset/valid/lookup_15.accepts +++ b/testdata/corset/valid/lookup_15.accepts @@ -1,26 +1,26 @@ -{ "X": [], "Y": [] } +{"X": [], "Y": [], "PX": []} ;; -{ "X": [0], "Y": [1] } -{ "X": [1], "Y": [0] } -{ "X": [1], "Y": [1] } +{"X": [0], "Y": [1], "PX": [0]} +{"X": [1], "Y": [0], "PX": [0]} +{"X": [1], "Y": [1], "PX": [0]} ;; -{ "X": [0,0], "Y": [0,0] } -{ "X": [0,0], "Y": [1,0] } -{ "X": [0,0], "Y": [0,1] } -{ "X": [0,0], "Y": [1,1] } +{"X": [0, 0], "Y": [0, 0], "PX": [0, 0]} +{"X": [0, 0], "Y": [1, 0], "PX": [0, 0]} +{"X": [0, 0], "Y": [0, 1], "PX": [0, 0]} +{"X": [0, 0], "Y": [1, 1], "PX": [0, 0]} ;; -{ "X": [1,0], "Y": [1,0] } -{ "X": [1,0], "Y": [0,1] } -{ "X": [1,0], "Y": [1,1] } +{"X": [1, 0], "Y": [1, 0], "PX": [0, 1]} +{"X": [1, 0], "Y": [0, 1], "PX": [0, 1]} +{"X": [1, 0], "Y": [1, 1], "PX": [0, 1]} ;; -{ "X": [0,1], "Y": [0,0] } -{ "X": [0,1], "Y": [1,0] } -{ "X": [0,1], "Y": [0,1] } -{ "X": [0,1], "Y": [1,1] } +{"X": [0, 1], "Y": [0, 0], "PX": [0, 0]} +{"X": [0, 1], "Y": [1, 0], "PX": [0, 0]} +{"X": [0, 1], "Y": [0, 1], "PX": [0, 0]} +{"X": [0, 1], "Y": [1, 1], "PX": [0, 0]} ;; -{ "X": [1,1], "Y": [1,0] } -{ "X": [1,1], "Y": [0,1] } -{ "X": [1,1], "Y": [1,1] } +{"X": [1, 1], "Y": [1, 0], "PX": [0, 1]} +{"X": [1, 1], "Y": [0, 1], "PX": [0, 1]} +{"X": [1, 1], "Y": [1, 1], "PX": [0, 1]} ;; -{ "X": [1,2], "Y": [1,1] } -{ "X": [1,256], "Y": [1,1] } +{"X": [1, 2], "Y": [1, 1], "PX": [0, 1]} +{"X": [1, 256], "Y": [1, 1], "PX": [0, 1]} diff --git a/testdata/corset/valid/lookup_15.lisp b/testdata/corset/valid/lookup_15.lisp index 7fa5f0e0a..861541cee 100644 --- a/testdata/corset/valid/lookup_15.lisp +++ b/testdata/corset/valid/lookup_15.lisp @@ -1,2 +1,4 @@ -(defcolumns (X :i16) (Y :i16)) -(deflookup test (Y) ((shift X -1))) +(defcolumns (X :i16) (Y :i16) (PX :i16)) +;; PX holds the value of the expression (shift X -1) +(defconstraint px_def () (== PX (shift X -1))) +(deflookup test (Y) (PX)) diff --git a/testdata/corset/valid/lookup_15.rejects b/testdata/corset/valid/lookup_15.rejects index 83c8461bd..16a32e4db 100644 --- a/testdata/corset/valid/lookup_15.rejects +++ b/testdata/corset/valid/lookup_15.rejects @@ -1,3 +1,3 @@ -{ "X": [1,0], "Y": [0,0] } -{ "X": [1,1], "Y": [0,0] } -{ "X": [1,0], "Y": [0,0] } +{"X": [1, 0], "Y": [0, 0], "PX": [0, 1]} +{"X": [1, 1], "Y": [0, 0], "PX": [0, 1]} +{"X": [1, 0], "Y": [0, 0], "PX": [0, 1]} diff --git a/testdata/corset/valid/lookup_16.accepts b/testdata/corset/valid/lookup_16.accepts index 4f4790c77..ad9aa3e74 100644 --- a/testdata/corset/valid/lookup_16.accepts +++ b/testdata/corset/valid/lookup_16.accepts @@ -1,19 +1,19 @@ -{ "X": [], "Y": [] } -{ "X": [0], "Y": [0] } -{ "X": [0], "Y": [1] } +{"X": [], "Y": [], "PY": []} +{"X": [0], "Y": [0], "PY": [0]} +{"X": [0], "Y": [1], "PY": [0]} ;; -{ "X": [0,0], "Y": [0,0] } -{ "X": [0,0], "Y": [0,1] } +{"X": [0, 0], "Y": [0, 0], "PY": [0, 0]} +{"X": [0, 0], "Y": [0, 1], "PY": [0, 0]} ;; -{ "X": [0,0], "Y": [1,0] } -{ "X": [0,1], "Y": [1,0] } -{ "X": [1,0], "Y": [1,0] } -{ "X": [1,1], "Y": [1,0] } +{"X": [0, 0], "Y": [1, 0], "PY": [0, 1]} +{"X": [0, 1], "Y": [1, 0], "PY": [0, 1]} +{"X": [1, 0], "Y": [1, 0], "PY": [0, 1]} +{"X": [1, 1], "Y": [1, 0], "PY": [0, 1]} ;; -{ "X": [0,0], "Y": [1,1] } -{ "X": [0,1], "Y": [1,1] } -{ "X": [1,0], "Y": [1,1] } -{ "X": [1,1], "Y": [1,1] } +{"X": [0, 0], "Y": [1, 1], "PY": [0, 1]} +{"X": [0, 1], "Y": [1, 1], "PY": [0, 1]} +{"X": [1, 0], "Y": [1, 1], "PY": [0, 1]} +{"X": [1, 1], "Y": [1, 1], "PY": [0, 1]} ;; -{ "X": [0,1,2], "Y": [2,1,0] } -{ "X": [0,1,2], "Y": [1,2,0] } +{"X": [0, 1, 2], "Y": [2, 1, 0], "PY": [0, 2, 1]} +{"X": [0, 1, 2], "Y": [1, 2, 0], "PY": [0, 1, 2]} diff --git a/testdata/corset/valid/lookup_16.lisp b/testdata/corset/valid/lookup_16.lisp index 784454247..abf343392 100644 --- a/testdata/corset/valid/lookup_16.lisp +++ b/testdata/corset/valid/lookup_16.lisp @@ -1,2 +1,4 @@ -(defcolumns (X :i16) (Y :i16)) -(deflookup test ((shift Y -1)) (X)) +(defcolumns (X :i16) (Y :i16) (PY :i16)) +;; PY holds the value of the expression (shift Y -1) +(defconstraint py_def () (== PY (shift Y -1))) +(deflookup test (PY) (X)) diff --git a/testdata/corset/valid/lookup_16.rejects b/testdata/corset/valid/lookup_16.rejects index c42718970..b4f68225e 100644 --- a/testdata/corset/valid/lookup_16.rejects +++ b/testdata/corset/valid/lookup_16.rejects @@ -1,11 +1,11 @@ -{"X": [1], "Y": [0]} -{"X": [1], "Y": [1]} +{"X": [1], "Y": [0], "PY": [0]} +{"X": [1], "Y": [1], "PY": [0]} ;; -{ "X": [0,1], "Y": [0,0] } -{ "X": [0,1], "Y": [0,1] } -{ "X": [1,0], "Y": [0,1] } -{ "X": [1,1], "Y": [0,1] } +{"X": [0, 1], "Y": [0, 0], "PY": [0, 0]} +{"X": [0, 1], "Y": [0, 1], "PY": [0, 0]} +{"X": [1, 0], "Y": [0, 1], "PY": [0, 0]} +{"X": [1, 1], "Y": [0, 1], "PY": [0, 0]} ;; -{ "X": [0,1], "Y": [2,0] } -{ "X": [0,1], "Y": [2,1] } -{ "X": [0,1], "Y": [2,2] } +{"X": [0, 1], "Y": [2, 0], "PY": [0, 2]} +{"X": [0, 1], "Y": [2, 1], "PY": [0, 2]} +{"X": [0, 1], "Y": [2, 2], "PY": [0, 2]} diff --git a/testdata/corset/valid/lookup_23.accepts b/testdata/corset/valid/lookup_23.accepts index 057a7fb4c..4da81f9ab 100644 --- a/testdata/corset/valid/lookup_23.accepts +++ b/testdata/corset/valid/lookup_23.accepts @@ -1,10 +1,10 @@ -{ "P": [1], "X": [0], "Y": [0] } +{"P": [1], "X": [0], "Y": [0], "Q": [1]} ;; -{ "P": [0,1], "X": [0,0], "Y": [123,0] } -{ "P": [1,0], "X": [0,0], "Y": [0,123] } -{ "P": [1,1], "X": [123,123], "Y": [123,0] } +{"P": [0, 1], "X": [0, 0], "Y": [123, 0], "Q": [1, 1]} +{"P": [1, 0], "X": [0, 0], "Y": [0, 123], "Q": [1, 1]} +{"P": [1, 1], "X": [123, 123], "Y": [123, 0], "Q": [1, 1]} ;; -{ "P": [1,1,1], "X": [123,123,123], "Y": [123,0,254] } -{ "P": [1,1,0], "X": [123,123,123], "Y": [123,0,254] } -{ "P": [1,0,1], "X": [123,123,123], "Y": [123,254,0] } -{ "P": [0,1,1], "X": [123,123,123], "Y": [254,123,0] } +{"P": [1, 1, 1], "X": [123, 123, 123], "Y": [123, 0, 254], "Q": [1, 1, 1]} +{"P": [1, 1, 0], "X": [123, 123, 123], "Y": [123, 0, 254], "Q": [1, 1, 1]} +{"P": [1, 0, 1], "X": [123, 123, 123], "Y": [123, 254, 0], "Q": [1, 1, 1]} +{"P": [0, 1, 1], "X": [123, 123, 123], "Y": [254, 123, 0], "Q": [1, 1, 1]} diff --git a/testdata/corset/valid/lookup_23.lisp b/testdata/corset/valid/lookup_23.lisp index 69c6ab6ad..136f8ea11 100644 --- a/testdata/corset/valid/lookup_23.lisp +++ b/testdata/corset/valid/lookup_23.lisp @@ -1,3 +1,5 @@ -(defcolumns (X :i16) (P :binary) (Y :i16)) +(defcolumns (X :i16) (P :binary) (Y :i16) (Q :binary :padding 1)) +;; Q holds the value of the constant selector 1 +(defconstraint q_def () (== Q 1)) ;; use of selector -(defclookup test P (Y) 1 (X)) +(defclookup test P (Y) Q (X)) diff --git a/testdata/corset/valid/lookup_23.rejects b/testdata/corset/valid/lookup_23.rejects index 2911294f5..4ee27f8e5 100644 --- a/testdata/corset/valid/lookup_23.rejects +++ b/testdata/corset/valid/lookup_23.rejects @@ -1,23 +1,23 @@ -{ "P": [0], "X": [0], "Y": [0] } -{ "P": [1], "X": [0], "Y": [1] } -{ "P": [0], "X": [1], "Y": [0] } +{"P": [0], "X": [0], "Y": [0], "Q": [1]} +{"P": [1], "X": [0], "Y": [1], "Q": [1]} +{"P": [0], "X": [1], "Y": [0], "Q": [1]} ;; -{ "P": [0,0], "X": [1,1], "Y": [0,1] } -{ "P": [1,0], "X": [1,1], "Y": [0,1] } -{ "P": [0,1], "X": [1,1], "Y": [0,1] } -{ "P": [1,1], "X": [1,2], "Y": [0,1] } +{"P": [0, 0], "X": [1, 1], "Y": [0, 1], "Q": [1, 1]} +{"P": [1, 0], "X": [1, 1], "Y": [0, 1], "Q": [1, 1]} +{"P": [0, 1], "X": [1, 1], "Y": [0, 1], "Q": [1, 1]} +{"P": [1, 1], "X": [1, 2], "Y": [0, 1], "Q": [1, 1]} ;; -{ "P": [0,0], "X": [1,1], "Y": [1,0] } -{ "P": [1,0], "X": [1,1], "Y": [1,0] } -{ "P": [0,1], "X": [1,1], "Y": [1,0] } -{ "P": [1,1], "X": [1,2], "Y": [1,0] } +{"P": [0, 0], "X": [1, 1], "Y": [1, 0], "Q": [1, 1]} +{"P": [1, 0], "X": [1, 1], "Y": [1, 0], "Q": [1, 1]} +{"P": [0, 1], "X": [1, 1], "Y": [1, 0], "Q": [1, 1]} +{"P": [1, 1], "X": [1, 2], "Y": [1, 0], "Q": [1, 1]} ;; -{ "P": [0,0], "X": [9,9], "Y": [0,9] } -{ "P": [1,0], "X": [9,9], "Y": [0,9] } -{ "P": [0,1], "X": [9,9], "Y": [0,9] } -{ "P": [1,1], "X": [9,2], "Y": [0,9] } +{"P": [0, 0], "X": [9, 9], "Y": [0, 9], "Q": [1, 1]} +{"P": [1, 0], "X": [9, 9], "Y": [0, 9], "Q": [1, 1]} +{"P": [0, 1], "X": [9, 9], "Y": [0, 9], "Q": [1, 1]} +{"P": [1, 1], "X": [9, 2], "Y": [0, 9], "Q": [1, 1]} ;; -{ "P": [0,0], "X": [9,9], "Y": [9,0] } -{ "P": [1,0], "X": [9,9], "Y": [9,0] } -{ "P": [0,1], "X": [9,9], "Y": [9,0] } -{ "P": [1,1], "X": [9,2], "Y": [9,0] } +{"P": [0, 0], "X": [9, 9], "Y": [9, 0], "Q": [1, 1]} +{"P": [1, 0], "X": [9, 9], "Y": [9, 0], "Q": [1, 1]} +{"P": [0, 1], "X": [9, 9], "Y": [9, 0], "Q": [1, 1]} +{"P": [1, 1], "X": [9, 2], "Y": [9, 0], "Q": [1, 1]} diff --git a/testdata/corset/valid/lookup_25.accepts b/testdata/corset/valid/lookup_25.accepts index 2ec68fdd1..57dd80b56 100644 --- a/testdata/corset/valid/lookup_25.accepts +++ b/testdata/corset/valid/lookup_25.accepts @@ -1,175 +1,175 @@ ;; { "X": [], "Y": [] } ;; { "X": [0], "Y": [0] } ;; Check initial padding row! -{ "X": [0], "Y": [1] } +{"X": [0], "Y": [1], "IdX": [0]} ;; -{ "X": [0,0], "Y": [0,0] } -{ "X": [0,0], "Y": [0,1] } -{ "X": [0,0], "Y": [1,0] } -{ "X": [1,0], "Y": [0,1] } -{ "X": [1,0], "Y": [1,0] } -{ "X": [1,0], "Y": [1,1] } -{ "X": [0,1], "Y": [0,1] } -{ "X": [0,1], "Y": [1,0] } -{ "X": [0,1], "Y": [1,1] } -{ "X": [1,1], "Y": [0,1] } -{ "X": [1,1], "Y": [1,0] } -{ "X": [1,1], "Y": [1,1] } -{ "X": [1,1], "Y": [1,2] } -{ "X": [2,2], "Y": [2,2] } -{ "X": [2,2], "Y": [2,1] } -{ "X": [2,2], "Y": [1,2] } -{ "X": [1,2], "Y": [2,1] } -{ "X": [1,2], "Y": [1,2] } -{ "X": [2,1], "Y": [2,1] } -{ "X": [2,1], "Y": [1,2] } -{ "X": [1,1], "Y": [2,1] } -{ "X": [1,1], "Y": [1,2] } -{ "X": [1,1], "Y": [1,1] } +{"X": [0, 0], "Y": [0, 0], "IdX": [0, 0]} +{"X": [0, 0], "Y": [0, 1], "IdX": [0, 0]} +{"X": [0, 0], "Y": [1, 0], "IdX": [0, 0]} +{"X": [1, 0], "Y": [0, 1], "IdX": [1, 0]} +{"X": [1, 0], "Y": [1, 0], "IdX": [1, 0]} +{"X": [1, 0], "Y": [1, 1], "IdX": [1, 0]} +{"X": [0, 1], "Y": [0, 1], "IdX": [0, 1]} +{"X": [0, 1], "Y": [1, 0], "IdX": [0, 1]} +{"X": [0, 1], "Y": [1, 1], "IdX": [0, 1]} +{"X": [1, 1], "Y": [0, 1], "IdX": [1, 1]} +{"X": [1, 1], "Y": [1, 0], "IdX": [1, 1]} +{"X": [1, 1], "Y": [1, 1], "IdX": [1, 1]} +{"X": [1, 1], "Y": [1, 2], "IdX": [1, 1]} +{"X": [2, 2], "Y": [2, 2], "IdX": [2, 2]} +{"X": [2, 2], "Y": [2, 1], "IdX": [2, 2]} +{"X": [2, 2], "Y": [1, 2], "IdX": [2, 2]} +{"X": [1, 2], "Y": [2, 1], "IdX": [1, 2]} +{"X": [1, 2], "Y": [1, 2], "IdX": [1, 2]} +{"X": [2, 1], "Y": [2, 1], "IdX": [2, 1]} +{"X": [2, 1], "Y": [1, 2], "IdX": [2, 1]} +{"X": [1, 1], "Y": [2, 1], "IdX": [1, 1]} +{"X": [1, 1], "Y": [1, 2], "IdX": [1, 1]} +{"X": [1, 1], "Y": [1, 1], "IdX": [1, 1]} ;; -{ "X": [0,0,0], "Y": [2,0,1] } -{ "X": [1,0,0], "Y": [2,0,1] } -{ "X": [0,1,0], "Y": [2,0,1] } -{ "X": [0,0,1], "Y": [2,0,1] } -{ "X": [1,0,1], "Y": [2,0,1] } -{ "X": [0,1,1], "Y": [2,0,1] } -{ "X": [1,1,0], "Y": [2,0,1] } -{ "X": [1,1,1], "Y": [2,0,1] } -{ "X": [0,0,0], "Y": [0,2,1] } -{ "X": [1,0,0], "Y": [0,2,1] } -{ "X": [0,1,0], "Y": [0,2,1] } -{ "X": [0,0,1], "Y": [0,2,1] } -{ "X": [1,0,1], "Y": [0,2,1] } -{ "X": [0,1,1], "Y": [0,2,1] } -{ "X": [1,1,0], "Y": [0,2,1] } -{ "X": [1,1,1], "Y": [0,2,1] } -{ "X": [0,0,0], "Y": [0,1,2] } -{ "X": [1,0,0], "Y": [0,1,2] } -{ "X": [0,1,0], "Y": [0,1,2] } -{ "X": [0,0,1], "Y": [0,1,2] } -{ "X": [1,0,1], "Y": [0,1,2] } -{ "X": [0,1,1], "Y": [0,1,2] } -{ "X": [1,1,0], "Y": [0,1,2] } -{ "X": [1,1,1], "Y": [0,1,2] } -{ "X": [0,0,0], "Y": [2,1,0] } -{ "X": [1,0,0], "Y": [2,1,0] } -{ "X": [0,1,0], "Y": [2,1,0] } -{ "X": [0,0,1], "Y": [2,1,0] } -{ "X": [1,0,1], "Y": [2,1,0] } -{ "X": [0,1,1], "Y": [2,1,0] } -{ "X": [1,1,0], "Y": [2,1,0] } -{ "X": [1,1,1], "Y": [2,1,0] } -{ "X": [0,0,0], "Y": [1,2,0] } -{ "X": [1,0,0], "Y": [1,2,0] } -{ "X": [0,1,0], "Y": [1,2,0] } -{ "X": [0,0,1], "Y": [1,2,0] } -{ "X": [1,0,1], "Y": [1,2,0] } -{ "X": [0,1,1], "Y": [1,2,0] } -{ "X": [1,1,0], "Y": [1,2,0] } -{ "X": [1,1,1], "Y": [1,2,0] } -{ "X": [0,0,0], "Y": [1,0,2] } -{ "X": [1,0,0], "Y": [1,0,2] } -{ "X": [0,1,0], "Y": [1,0,2] } -{ "X": [0,0,1], "Y": [1,0,2] } -{ "X": [1,0,1], "Y": [1,0,2] } -{ "X": [0,1,1], "Y": [1,0,2] } -{ "X": [1,1,0], "Y": [1,0,2] } -{ "X": [1,1,1], "Y": [1,0,2] } -{ "X": [0,0,0], "Y": [2,1,1] } -{ "X": [1,0,0], "Y": [2,1,1] } -{ "X": [0,1,0], "Y": [2,1,1] } -{ "X": [0,0,1], "Y": [2,1,1] } -{ "X": [1,0,1], "Y": [2,1,1] } -{ "X": [0,1,1], "Y": [2,1,1] } -{ "X": [1,1,0], "Y": [2,1,1] } -{ "X": [1,1,1], "Y": [2,1,1] } -{ "X": [0,0,0], "Y": [1,2,1] } -{ "X": [1,0,0], "Y": [1,2,1] } -{ "X": [0,1,0], "Y": [1,2,1] } -{ "X": [0,0,1], "Y": [1,2,1] } -{ "X": [1,0,1], "Y": [1,2,1] } -{ "X": [0,1,1], "Y": [1,2,1] } -{ "X": [1,1,0], "Y": [1,2,1] } -{ "X": [1,1,1], "Y": [1,2,1] } -{ "X": [0,0,0], "Y": [1,1,2] } -{ "X": [1,0,0], "Y": [1,1,2] } -{ "X": [0,1,0], "Y": [1,1,2] } -{ "X": [0,0,1], "Y": [1,1,2] } -{ "X": [1,0,1], "Y": [1,1,2] } -{ "X": [0,1,1], "Y": [1,1,2] } -{ "X": [1,1,0], "Y": [1,1,2] } -{ "X": [1,1,1], "Y": [1,1,2] } +{"X": [0, 0, 0], "Y": [2, 0, 1], "IdX": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [2, 0, 1], "IdX": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [2, 0, 1], "IdX": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [2, 0, 1], "IdX": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [2, 0, 1], "IdX": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [2, 0, 1], "IdX": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [2, 0, 1], "IdX": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [2, 0, 1], "IdX": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [0, 2, 1], "IdX": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [0, 2, 1], "IdX": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [0, 2, 1], "IdX": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [0, 2, 1], "IdX": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [0, 2, 1], "IdX": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [0, 2, 1], "IdX": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [0, 2, 1], "IdX": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [0, 2, 1], "IdX": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [0, 1, 2], "IdX": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [0, 1, 2], "IdX": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [0, 1, 2], "IdX": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [0, 1, 2], "IdX": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [0, 1, 2], "IdX": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [0, 1, 2], "IdX": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [0, 1, 2], "IdX": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [0, 1, 2], "IdX": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [2, 1, 0], "IdX": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [2, 1, 0], "IdX": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [2, 1, 0], "IdX": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [2, 1, 0], "IdX": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [2, 1, 0], "IdX": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [2, 1, 0], "IdX": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [2, 1, 0], "IdX": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [2, 1, 0], "IdX": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [1, 2, 0], "IdX": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [1, 2, 0], "IdX": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [1, 2, 0], "IdX": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [1, 2, 0], "IdX": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [1, 2, 0], "IdX": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [1, 2, 0], "IdX": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [1, 2, 0], "IdX": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [1, 2, 0], "IdX": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [1, 0, 2], "IdX": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [1, 0, 2], "IdX": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [1, 0, 2], "IdX": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [1, 0, 2], "IdX": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [1, 0, 2], "IdX": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [1, 0, 2], "IdX": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [1, 0, 2], "IdX": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [1, 0, 2], "IdX": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [2, 1, 1], "IdX": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [2, 1, 1], "IdX": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [2, 1, 1], "IdX": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [2, 1, 1], "IdX": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [2, 1, 1], "IdX": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [2, 1, 1], "IdX": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [2, 1, 1], "IdX": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [2, 1, 1], "IdX": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [1, 2, 1], "IdX": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [1, 2, 1], "IdX": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [1, 2, 1], "IdX": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [1, 2, 1], "IdX": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [1, 2, 1], "IdX": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [1, 2, 1], "IdX": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [1, 2, 1], "IdX": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [1, 2, 1], "IdX": [1, 1, 1]} +{"X": [0, 0, 0], "Y": [1, 1, 2], "IdX": [0, 0, 0]} +{"X": [1, 0, 0], "Y": [1, 1, 2], "IdX": [1, 0, 0]} +{"X": [0, 1, 0], "Y": [1, 1, 2], "IdX": [0, 1, 0]} +{"X": [0, 0, 1], "Y": [1, 1, 2], "IdX": [0, 0, 1]} +{"X": [1, 0, 1], "Y": [1, 1, 2], "IdX": [1, 0, 1]} +{"X": [0, 1, 1], "Y": [1, 1, 2], "IdX": [0, 1, 1]} +{"X": [1, 1, 0], "Y": [1, 1, 2], "IdX": [1, 1, 0]} +{"X": [1, 1, 1], "Y": [1, 1, 2], "IdX": [1, 1, 1]} ;; -{ "X": [3,3,3], "Y": [2,3,1] } -{ "X": [1,3,3], "Y": [2,3,1] } -{ "X": [3,1,3], "Y": [2,3,1] } -{ "X": [3,3,1], "Y": [2,3,1] } -{ "X": [1,3,1], "Y": [2,3,1] } -{ "X": [3,1,1], "Y": [2,3,1] } -{ "X": [1,1,3], "Y": [2,3,1] } -{ "X": [1,1,1], "Y": [2,3,1] } -{ "X": [3,3,3], "Y": [3,2,1] } -{ "X": [1,3,3], "Y": [3,2,1] } -{ "X": [3,1,3], "Y": [3,2,1] } -{ "X": [3,3,1], "Y": [3,2,1] } -{ "X": [1,3,1], "Y": [3,2,1] } -{ "X": [3,1,1], "Y": [3,2,1] } -{ "X": [1,1,3], "Y": [3,2,1] } -{ "X": [1,1,1], "Y": [3,2,1] } -{ "X": [3,3,3], "Y": [3,1,2] } -{ "X": [1,3,3], "Y": [3,1,2] } -{ "X": [3,1,3], "Y": [3,1,2] } -{ "X": [3,3,1], "Y": [3,1,2] } -{ "X": [1,3,1], "Y": [3,1,2] } -{ "X": [3,1,1], "Y": [3,1,2] } -{ "X": [1,1,3], "Y": [3,1,2] } -{ "X": [1,1,1], "Y": [3,1,2] } -{ "X": [3,3,3], "Y": [2,1,3] } -{ "X": [1,3,3], "Y": [2,1,3] } -{ "X": [3,1,3], "Y": [2,1,3] } -{ "X": [3,3,1], "Y": [2,1,3] } -{ "X": [1,3,1], "Y": [2,1,3] } -{ "X": [3,1,1], "Y": [2,1,3] } -{ "X": [1,1,3], "Y": [2,1,3] } -{ "X": [1,1,1], "Y": [2,1,3] } -{ "X": [3,3,3], "Y": [1,2,3] } -{ "X": [1,3,3], "Y": [1,2,3] } -{ "X": [3,1,3], "Y": [1,2,3] } -{ "X": [3,3,1], "Y": [1,2,3] } -{ "X": [1,3,1], "Y": [1,2,3] } -{ "X": [3,1,1], "Y": [1,2,3] } -{ "X": [1,1,3], "Y": [1,2,3] } -{ "X": [1,1,1], "Y": [1,2,3] } -{ "X": [3,3,3], "Y": [1,3,2] } -{ "X": [1,3,3], "Y": [1,3,2] } -{ "X": [3,1,3], "Y": [1,3,2] } -{ "X": [3,3,1], "Y": [1,3,2] } -{ "X": [1,3,1], "Y": [1,3,2] } -{ "X": [3,1,1], "Y": [1,3,2] } -{ "X": [1,1,3], "Y": [1,3,2] } -{ "X": [1,1,1], "Y": [1,3,2] } +{"X": [3, 3, 3], "Y": [2, 3, 1], "IdX": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [2, 3, 1], "IdX": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [2, 3, 1], "IdX": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [2, 3, 1], "IdX": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [2, 3, 1], "IdX": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [2, 3, 1], "IdX": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [2, 3, 1], "IdX": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [2, 3, 1], "IdX": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [3, 2, 1], "IdX": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [3, 2, 1], "IdX": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [3, 2, 1], "IdX": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [3, 2, 1], "IdX": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [3, 2, 1], "IdX": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [3, 2, 1], "IdX": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [3, 2, 1], "IdX": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [3, 2, 1], "IdX": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [3, 1, 2], "IdX": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [3, 1, 2], "IdX": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [3, 1, 2], "IdX": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [3, 1, 2], "IdX": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [3, 1, 2], "IdX": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [3, 1, 2], "IdX": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [3, 1, 2], "IdX": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [3, 1, 2], "IdX": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [2, 1, 3], "IdX": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [2, 1, 3], "IdX": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [2, 1, 3], "IdX": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [2, 1, 3], "IdX": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [2, 1, 3], "IdX": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [2, 1, 3], "IdX": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [2, 1, 3], "IdX": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [2, 1, 3], "IdX": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [1, 2, 3], "IdX": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [1, 2, 3], "IdX": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [1, 2, 3], "IdX": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [1, 2, 3], "IdX": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [1, 2, 3], "IdX": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [1, 2, 3], "IdX": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [1, 2, 3], "IdX": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [1, 2, 3], "IdX": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [1, 3, 2], "IdX": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [1, 3, 2], "IdX": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [1, 3, 2], "IdX": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [1, 3, 2], "IdX": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [1, 3, 2], "IdX": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [1, 3, 2], "IdX": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [1, 3, 2], "IdX": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [1, 3, 2], "IdX": [1, 1, 1]} ;; -{ "X": [3,3,3], "Y": [1,2,3] } -{ "X": [1,3,3], "Y": [1,2,3] } -{ "X": [3,1,3], "Y": [1,2,3] } -{ "X": [3,3,1], "Y": [1,2,3] } -{ "X": [1,3,1], "Y": [1,2,3] } -{ "X": [3,1,1], "Y": [1,2,3] } -{ "X": [1,1,3], "Y": [1,2,3] } -{ "X": [1,1,1], "Y": [1,2,3] } -{ "X": [3,3,3], "Y": [2,1,3] } -{ "X": [1,3,3], "Y": [2,1,3] } -{ "X": [3,1,3], "Y": [2,1,3] } -{ "X": [3,3,1], "Y": [2,1,3] } -{ "X": [1,3,1], "Y": [2,1,3] } -{ "X": [3,1,1], "Y": [2,1,3] } -{ "X": [1,1,3], "Y": [2,1,3] } -{ "X": [1,1,1], "Y": [2,1,3] } -{ "X": [3,3,3], "Y": [1,3,2] } -{ "X": [1,3,3], "Y": [1,3,2] } -{ "X": [3,1,3], "Y": [1,3,2] } -{ "X": [3,3,1], "Y": [1,3,2] } -{ "X": [1,3,1], "Y": [1,3,2] } -{ "X": [3,1,1], "Y": [1,3,2] } -{ "X": [1,1,3], "Y": [1,3,2] } -{ "X": [1,1,1], "Y": [1,3,2] } +{"X": [3, 3, 3], "Y": [1, 2, 3], "IdX": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [1, 2, 3], "IdX": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [1, 2, 3], "IdX": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [1, 2, 3], "IdX": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [1, 2, 3], "IdX": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [1, 2, 3], "IdX": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [1, 2, 3], "IdX": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [1, 2, 3], "IdX": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [2, 1, 3], "IdX": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [2, 1, 3], "IdX": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [2, 1, 3], "IdX": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [2, 1, 3], "IdX": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [2, 1, 3], "IdX": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [2, 1, 3], "IdX": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [2, 1, 3], "IdX": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [2, 1, 3], "IdX": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [1, 3, 2], "IdX": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [1, 3, 2], "IdX": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [1, 3, 2], "IdX": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [1, 3, 2], "IdX": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [1, 3, 2], "IdX": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [1, 3, 2], "IdX": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [1, 3, 2], "IdX": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [1, 3, 2], "IdX": [1, 1, 1]} diff --git a/testdata/corset/valid/lookup_25.lisp b/testdata/corset/valid/lookup_25.lisp index a1b485dcf..b7110cc30 100644 --- a/testdata/corset/valid/lookup_25.lisp +++ b/testdata/corset/valid/lookup_25.lisp @@ -1,4 +1,6 @@ (defpurefun (Id A) (if (== A 0) A A)) ;; -(defcolumns (X :i16) (Y :i16)) -(deflookup test (Y) ((Id X))) +(defcolumns (X :i16) (Y :i16) (IdX :i16)) +;; IdX holds the value of the expression (Id X) +(defconstraint idx_def () (== IdX (Id X))) +(deflookup test (Y) (IdX)) diff --git a/testdata/corset/valid/lookup_25.rejects b/testdata/corset/valid/lookup_25.rejects index 8418fe129..5b576538d 100644 --- a/testdata/corset/valid/lookup_25.rejects +++ b/testdata/corset/valid/lookup_25.rejects @@ -1,37 +1,37 @@ -{ "X": [1], "Y": [2] } +{"X": [1], "Y": [2], "IdX": [1]} ;; -{ "X": [1,2], "Y": [1,1] } -{ "X": [2,1], "Y": [1,1] } -{ "X": [2,2], "Y": [1,1] } +{"X": [1, 2], "Y": [1, 1], "IdX": [1, 2]} +{"X": [2, 1], "Y": [1, 1], "IdX": [2, 1]} +{"X": [2, 2], "Y": [1, 1], "IdX": [2, 2]} ;; -{ "X": [1,2], "Y": [1,3] } -{ "X": [1,2], "Y": [3,1] } -{ "X": [1,2], "Y": [1,1] } -{ "X": [2,1], "Y": [1,1] } -{ "X": [2,1], "Y": [1,3] } -{ "X": [2,1], "Y": [3,1] } -{ "X": [2,2], "Y": [1,3] } -{ "X": [2,2], "Y": [3,1] } +{"X": [1, 2], "Y": [1, 3], "IdX": [1, 2]} +{"X": [1, 2], "Y": [3, 1], "IdX": [1, 2]} +{"X": [1, 2], "Y": [1, 1], "IdX": [1, 2]} +{"X": [2, 1], "Y": [1, 1], "IdX": [2, 1]} +{"X": [2, 1], "Y": [1, 3], "IdX": [2, 1]} +{"X": [2, 1], "Y": [3, 1], "IdX": [2, 1]} +{"X": [2, 2], "Y": [1, 3], "IdX": [2, 2]} +{"X": [2, 2], "Y": [3, 1], "IdX": [2, 2]} ;; -{ "X": [3,3,3], "Y": [1,2,1] } -{ "X": [1,3,3], "Y": [1,2,1] } -{ "X": [3,1,3], "Y": [1,2,1] } -{ "X": [3,3,1], "Y": [1,2,1] } -{ "X": [1,3,1], "Y": [1,2,1] } -{ "X": [3,1,1], "Y": [1,2,1] } -{ "X": [1,1,3], "Y": [1,2,1] } -{ "X": [1,1,1], "Y": [2,2,2] } -{ "X": [1,1,1], "Y": [2,2,3] } -{ "X": [1,1,1], "Y": [3,2,2] } -{ "X": [1,1,1], "Y": [2,3,2] } -{ "X": [3,3,3], "Y": [1,1,2] } -{ "X": [1,3,3], "Y": [1,1,2] } -{ "X": [3,1,3], "Y": [1,1,2] } -{ "X": [3,3,1], "Y": [1,1,2] } -{ "X": [1,3,1], "Y": [1,1,2] } -{ "X": [3,1,1], "Y": [1,1,2] } -{ "X": [1,1,3], "Y": [1,1,2] } -{ "X": [1,1,1], "Y": [2,2,2] } -{ "X": [1,1,1], "Y": [3,2,2] } -{ "X": [1,1,1], "Y": [2,3,2] } -{ "X": [1,1,1], "Y": [2,2,3] } +{"X": [3, 3, 3], "Y": [1, 2, 1], "IdX": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [1, 2, 1], "IdX": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [1, 2, 1], "IdX": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [1, 2, 1], "IdX": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [1, 2, 1], "IdX": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [1, 2, 1], "IdX": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [1, 2, 1], "IdX": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [2, 2, 2], "IdX": [1, 1, 1]} +{"X": [1, 1, 1], "Y": [2, 2, 3], "IdX": [1, 1, 1]} +{"X": [1, 1, 1], "Y": [3, 2, 2], "IdX": [1, 1, 1]} +{"X": [1, 1, 1], "Y": [2, 3, 2], "IdX": [1, 1, 1]} +{"X": [3, 3, 3], "Y": [1, 1, 2], "IdX": [3, 3, 3]} +{"X": [1, 3, 3], "Y": [1, 1, 2], "IdX": [1, 3, 3]} +{"X": [3, 1, 3], "Y": [1, 1, 2], "IdX": [3, 1, 3]} +{"X": [3, 3, 1], "Y": [1, 1, 2], "IdX": [3, 3, 1]} +{"X": [1, 3, 1], "Y": [1, 1, 2], "IdX": [1, 3, 1]} +{"X": [3, 1, 1], "Y": [1, 1, 2], "IdX": [3, 1, 1]} +{"X": [1, 1, 3], "Y": [1, 1, 2], "IdX": [1, 1, 3]} +{"X": [1, 1, 1], "Y": [2, 2, 2], "IdX": [1, 1, 1]} +{"X": [1, 1, 1], "Y": [3, 2, 2], "IdX": [1, 1, 1]} +{"X": [1, 1, 1], "Y": [2, 3, 2], "IdX": [1, 1, 1]} +{"X": [1, 1, 1], "Y": [2, 2, 3], "IdX": [1, 1, 1]} diff --git a/testdata/corset/valid/lookup_28.accepts b/testdata/corset/valid/lookup_28.accepts index 8c7ecdb12..608b0ce1a 100644 --- a/testdata/corset/valid/lookup_28.accepts +++ b/testdata/corset/valid/lookup_28.accepts @@ -1,65 +1,65 @@ -{ "P": [0], "X": [0], "Y": [0] } -{ "P": [0], "X": [1], "Y": [0] } -{ "P": [0], "X": [2], "Y": [0] } -{ "P": [0], "X": [3], "Y": [0] } -{ "P": [0], "X": [4], "Y": [0] } -{ "P": [0], "X": [5], "Y": [0] } -{ "P": [0], "X": [6], "Y": [0] } -{ "P": [0], "X": [9], "Y": [0] } -{ "P": [0], "X": [12], "Y": [0] } -{ "P": [0], "X": [97], "Y": [0] } -{ "P": [0], "X": [9912], "Y": [0] } -{ "P": [0], "X": [12387], "Y": [0] } -{ "P": [0], "X": [32789], "Y": [0] } +{"P": [0], "X": [0], "Y": [0], "SEL": [0]} +{"P": [0], "X": [1], "Y": [0], "SEL": [0]} +{"P": [0], "X": [2], "Y": [0], "SEL": [0]} +{"P": [0], "X": [3], "Y": [0], "SEL": [0]} +{"P": [0], "X": [4], "Y": [0], "SEL": [0]} +{"P": [0], "X": [5], "Y": [0], "SEL": [0]} +{"P": [0], "X": [6], "Y": [0], "SEL": [0]} +{"P": [0], "X": [9], "Y": [0], "SEL": [0]} +{"P": [0], "X": [12], "Y": [0], "SEL": [0]} +{"P": [0], "X": [97], "Y": [0], "SEL": [0]} +{"P": [0], "X": [9912], "Y": [0], "SEL": [0]} +{"P": [0], "X": [12387], "Y": [0], "SEL": [0]} +{"P": [0], "X": [32789], "Y": [0], "SEL": [0]} ;; -{ "P": [1], "X": [0], "Y": [0] } -{ "P": [1], "X": [1], "Y": [1] } -{ "P": [1], "X": [2], "Y": [2] } -{ "P": [1], "X": [3], "Y": [3] } -{ "P": [1], "X": [4], "Y": [4] } -{ "P": [1], "X": [5], "Y": [5] } -{ "P": [1], "X": [6], "Y": [6] } -{ "P": [1], "X": [9], "Y": [9] } -{ "P": [1], "X": [12], "Y": [12] } -{ "P": [1], "X": [97], "Y": [97] } -{ "P": [1], "X": [9912], "Y": [9912] } -{ "P": [1], "X": [12387], "Y": [12387] } -{ "P": [1], "X": [32789], "Y": [32789] } +{"P": [1], "X": [0], "Y": [0], "SEL": [1]} +{"P": [1], "X": [1], "Y": [1], "SEL": [1]} +{"P": [1], "X": [2], "Y": [2], "SEL": [1]} +{"P": [1], "X": [3], "Y": [3], "SEL": [1]} +{"P": [1], "X": [4], "Y": [4], "SEL": [1]} +{"P": [1], "X": [5], "Y": [5], "SEL": [1]} +{"P": [1], "X": [6], "Y": [6], "SEL": [1]} +{"P": [1], "X": [9], "Y": [9], "SEL": [1]} +{"P": [1], "X": [12], "Y": [12], "SEL": [1]} +{"P": [1], "X": [97], "Y": [97], "SEL": [1]} +{"P": [1], "X": [9912], "Y": [9912], "SEL": [1]} +{"P": [1], "X": [12387], "Y": [12387], "SEL": [1]} +{"P": [1], "X": [32789], "Y": [32789], "SEL": [1]} ;; -{ "P": [0,1], "X": [0,0], "Y": [0,0] } -{ "P": [0,1], "X": [0,23], "Y": [0,23] } -{ "P": [0,1], "X": [0,23], "Y": [23,0] } -{ "P": [0,1], "X": [0,23], "Y": [23,23] } -{ "P": [0,1], "X": [0,97], "Y": [0,97] } -{ "P": [0,1], "X": [0,97], "Y": [97,0] } -{ "P": [0,1], "X": [0,97], "Y": [97,97] } -{ "P": [0,1], "X": [0,12387], "Y": [0,12387] } -{ "P": [0,1], "X": [0,12387], "Y": [12387,0] } -{ "P": [0,1], "X": [0,12387], "Y": [12387,12387] } +{"P": [0, 1], "X": [0, 0], "Y": [0, 0], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 23], "Y": [0, 23], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 23], "Y": [23, 0], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 23], "Y": [23, 23], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 97], "Y": [0, 97], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 97], "Y": [97, 0], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 97], "Y": [97, 97], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 12387], "Y": [0, 12387], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 12387], "Y": [12387, 0], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 12387], "Y": [12387, 12387], "SEL": [0, 1]} ;; -{ "P": [0,0,1], "X": [0,0,123], "Y": [123,0,0] } -{ "P": [0,0,1], "X": [0,0,123], "Y": [0,123,0] } -{ "P": [0,0,1], "X": [0,0,123], "Y": [0,0,123] } -{ "P": [0,0,1], "X": [0,0,123], "Y": [123,0,123] } -{ "P": [0,0,1], "X": [0,0,123], "Y": [123,123,0] } +{"P": [0, 0, 1], "X": [0, 0, 123], "Y": [123, 0, 0], "SEL": [0, 0, 1]} +{"P": [0, 0, 1], "X": [0, 0, 123], "Y": [0, 123, 0], "SEL": [0, 0, 1]} +{"P": [0, 0, 1], "X": [0, 0, 123], "Y": [0, 0, 123], "SEL": [0, 0, 1]} +{"P": [0, 0, 1], "X": [0, 0, 123], "Y": [123, 0, 123], "SEL": [0, 0, 1]} +{"P": [0, 0, 1], "X": [0, 0, 123], "Y": [123, 123, 0], "SEL": [0, 0, 1]} ;; -{ "P": [0,1,1], "X": [0,9812,123], "Y": [123,9812,0] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [9812,123,0] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [9812,0,123] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [123,0,9812] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [0,9812,123] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [0,123,9812] } +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [123, 9812, 0], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [9812, 123, 0], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [9812, 0, 123], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [123, 0, 9812], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [0, 9812, 123], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [0, 123, 9812], "SEL": [0, 1, 0]} ;; -{ "P": [0,1,1], "X": [0,9812,123], "Y": [120,9812,0] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [9812,121,0] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [9812,0,251] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [124,0,9812] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [0,9812,125] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [0,127,9812] } +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [120, 9812, 0], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [9812, 121, 0], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [9812, 0, 251], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [124, 0, 9812], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [0, 9812, 125], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [0, 127, 9812], "SEL": [0, 1, 0]} ;; -{ "P": [0,1,2], "X": [0,9812,123], "Y": [123,9812,0] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [9812,123,0] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [9812,0,123] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [123,0,9812] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [0,9812,123] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [0,123,9812] } +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [123, 9812, 0], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [9812, 123, 0], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [9812, 0, 123], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [123, 0, 9812], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [0, 9812, 123], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [0, 123, 9812], "SEL": [0, 1, 1]} diff --git a/testdata/corset/valid/lookup_28.lisp b/testdata/corset/valid/lookup_28.lisp index d663b73d5..f24e3c5f0 100644 --- a/testdata/corset/valid/lookup_28.lisp +++ b/testdata/corset/valid/lookup_28.lisp @@ -1,9 +1,11 @@ -(defcolumns (X :i16) (Y :i16) (P :i16)) +(defcolumns (X :i16) (Y :i16) (P :i16) (SEL :binary)) (defpurefun (prev (X :any)) (shift X -1)) ;; define selector function (defun ((selector :binary :force)) (- P (prev P))) +;; SEL holds the value of the expression (selector) +(defconstraint sel_def () (== SEL (selector))) ;; example use of selector -(defclookup l1 (Y) (selector) (X)) +(defclookup l1 (Y) SEL (X)) ;; enforce (P - (prev P)) is binary. (defconstraint inc () diff --git a/testdata/corset/valid/lookup_28.rejects b/testdata/corset/valid/lookup_28.rejects index e23f3bb4c..7edccf71a 100644 --- a/testdata/corset/valid/lookup_28.rejects +++ b/testdata/corset/valid/lookup_28.rejects @@ -2,64 +2,64 @@ ;; { "P": [2], "X": [0], "Y": [0] } ;; { "P": [3], "X": [0], "Y": [0] } ;; -{ "P": [1], "X": [1], "Y": [0] } -{ "P": [1], "X": [2], "Y": [0] } -{ "P": [1], "X": [3], "Y": [0] } -{ "P": [1], "X": [4], "Y": [0] } -{ "P": [1], "X": [5], "Y": [0] } -{ "P": [1], "X": [6], "Y": [0] } -{ "P": [1], "X": [9], "Y": [0] } -{ "P": [1], "X": [12], "Y": [0] } -{ "P": [1], "X": [97], "Y": [0] } -{ "P": [1], "X": [9912], "Y": [0] } -{ "P": [1], "X": [12387], "Y": [0] } -{ "P": [1], "X": [32789], "Y": [0] } +{"P": [1], "X": [1], "Y": [0], "SEL": [1]} +{"P": [1], "X": [2], "Y": [0], "SEL": [1]} +{"P": [1], "X": [3], "Y": [0], "SEL": [1]} +{"P": [1], "X": [4], "Y": [0], "SEL": [1]} +{"P": [1], "X": [5], "Y": [0], "SEL": [1]} +{"P": [1], "X": [6], "Y": [0], "SEL": [1]} +{"P": [1], "X": [9], "Y": [0], "SEL": [1]} +{"P": [1], "X": [12], "Y": [0], "SEL": [1]} +{"P": [1], "X": [97], "Y": [0], "SEL": [1]} +{"P": [1], "X": [9912], "Y": [0], "SEL": [1]} +{"P": [1], "X": [12387], "Y": [0], "SEL": [1]} +{"P": [1], "X": [32789], "Y": [0], "SEL": [1]} ;; -{ "P": [1], "X": [1], "Y": [65533] } -{ "P": [1], "X": [2], "Y": [65531] } -{ "P": [1], "X": [3], "Y": [65530] } -{ "P": [1], "X": [4], "Y": [65529] } -{ "P": [1], "X": [5], "Y": [65527] } -{ "P": [1], "X": [6], "Y": [65526] } -{ "P": [1], "X": [9], "Y": [65521] } -{ "P": [1], "X": [12], "Y": [65520] } -{ "P": [1], "X": [97], "Y": [65521] } -{ "P": [1], "X": [9912], "Y": [65519] } -{ "P": [1], "X": [12387], "Y": [65501] } -{ "P": [1], "X": [32789], "Y": [65500] } +{"P": [1], "X": [1], "Y": [65533], "SEL": [1]} +{"P": [1], "X": [2], "Y": [65531], "SEL": [1]} +{"P": [1], "X": [3], "Y": [65530], "SEL": [1]} +{"P": [1], "X": [4], "Y": [65529], "SEL": [1]} +{"P": [1], "X": [5], "Y": [65527], "SEL": [1]} +{"P": [1], "X": [6], "Y": [65526], "SEL": [1]} +{"P": [1], "X": [9], "Y": [65521], "SEL": [1]} +{"P": [1], "X": [12], "Y": [65520], "SEL": [1]} +{"P": [1], "X": [97], "Y": [65521], "SEL": [1]} +{"P": [1], "X": [9912], "Y": [65519], "SEL": [1]} +{"P": [1], "X": [12387], "Y": [65501], "SEL": [1]} +{"P": [1], "X": [32789], "Y": [65500], "SEL": [1]} ;; -{ "P": [0,1], "X": [0,23], "Y": [0,24] } -{ "P": [0,1], "X": [0,23], "Y": [20,0] } -{ "P": [0,1], "X": [0,23], "Y": [22,24] } -{ "P": [0,1], "X": [0,97], "Y": [0,96] } -{ "P": [0,1], "X": [0,97], "Y": [98,0] } -{ "P": [0,1], "X": [0,97], "Y": [96,98] } -{ "P": [0,1], "X": [0,12387], "Y": [0,12388] } -{ "P": [0,1], "X": [0,12387], "Y": [12386,0] } -{ "P": [0,1], "X": [0,12387], "Y": [12386,12388] } +{"P": [0, 1], "X": [0, 23], "Y": [0, 24], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 23], "Y": [20, 0], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 23], "Y": [22, 24], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 97], "Y": [0, 96], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 97], "Y": [98, 0], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 97], "Y": [96, 98], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 12387], "Y": [0, 12388], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 12387], "Y": [12386, 0], "SEL": [0, 1]} +{"P": [0, 1], "X": [0, 12387], "Y": [12386, 12388], "SEL": [0, 1]} ;; -{ "P": [0,0,1], "X": [0,0,123], "Y": [121,0,0] } -{ "P": [0,0,1], "X": [0,0,123], "Y": [0,124,0] } -{ "P": [0,0,1], "X": [0,0,123], "Y": [0,0,125] } -{ "P": [0,0,1], "X": [0,0,123], "Y": [120,0,125] } -{ "P": [0,0,1], "X": [0,0,123], "Y": [122,124,0] } +{"P": [0, 0, 1], "X": [0, 0, 123], "Y": [121, 0, 0], "SEL": [0, 0, 1]} +{"P": [0, 0, 1], "X": [0, 0, 123], "Y": [0, 124, 0], "SEL": [0, 0, 1]} +{"P": [0, 0, 1], "X": [0, 0, 123], "Y": [0, 0, 125], "SEL": [0, 0, 1]} +{"P": [0, 0, 1], "X": [0, 0, 123], "Y": [120, 0, 125], "SEL": [0, 0, 1]} +{"P": [0, 0, 1], "X": [0, 0, 123], "Y": [122, 124, 0], "SEL": [0, 0, 1]} ;; -{ "P": [0,1,1], "X": [0,9812,123], "Y": [123,9811,0] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [9813,123,0] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [9810,0,123] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [123,0,9814] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [0,9816,123] } -{ "P": [0,1,1], "X": [0,9812,123], "Y": [0,123,9818] } +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [123, 9811, 0], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [9813, 123, 0], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [9810, 0, 123], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [123, 0, 9814], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [0, 9816, 123], "SEL": [0, 1, 0]} +{"P": [0, 1, 1], "X": [0, 9812, 123], "Y": [0, 123, 9818], "SEL": [0, 1, 0]} ;; -{ "P": [0,1,2], "X": [0,9812,123], "Y": [122,9812,0] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [123,9811,0] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [9812,124,0] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [9813,123,0] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [9812,0,121] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [9810,0,123] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [125,0,9812] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [123,0,9814] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [0,9812,120] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [0,9816,123] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [0,119,9812] } -{ "P": [0,1,2], "X": [0,9812,123], "Y": [0,123,9818] } +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [122, 9812, 0], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [123, 9811, 0], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [9812, 124, 0], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [9813, 123, 0], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [9812, 0, 121], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [9810, 0, 123], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [125, 0, 9812], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [123, 0, 9814], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [0, 9812, 120], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [0, 9816, 123], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [0, 119, 9812], "SEL": [0, 1, 1]} +{"P": [0, 1, 2], "X": [0, 9812, 123], "Y": [0, 123, 9818], "SEL": [0, 1, 1]} diff --git a/testdata/corset/valid/lookup_29.accepts b/testdata/corset/valid/lookup_29.accepts index a8424007b..fe2375707 100644 --- a/testdata/corset/valid/lookup_29.accepts +++ b/testdata/corset/valid/lookup_29.accepts @@ -1,80 +1,80 @@ -{ "sel": [0], "from" : [0], "into" : [255] } -{ "sel": [0], "from" : [13], "into" : [255] } -{ "sel": [0], "from" : [55], "into" : [255] } -{ "sel": [0], "from" : [99], "into" : [255] } -{ "sel": [0,0,0,0], "from" : [97,98,99,100], "into" : [3,11,98,231] } -{ "sel": [0,0,0,0], "from" : [67,68,69,70], "into" : [3,11,98,231] } -{ "sel": [0], "from" : [12345], "into" : [255] } +{"sel": [0], "from": [0], "into": [255], "tmp": [0]} +{"sel": [0], "from": [13], "into": [255], "tmp": [0]} +{"sel": [0], "from": [55], "into": [255], "tmp": [0]} +{"sel": [0], "from": [99], "into": [255], "tmp": [0]} +{"sel": [0, 0, 0, 0], "from": [97, 98, 99, 100], "into": [3, 11, 98, 231], "tmp": [0, 0, 0, 0]} +{"sel": [0, 0, 0, 0], "from": [67, 68, 69, 70], "into": [3, 11, 98, 231], "tmp": [0, 0, 0, 0]} +{"sel": [0], "from": [12345], "into": [255], "tmp": [0]} ;; -{ "sel": [1,0], "from" : [1,1], "into" : [1,1] } -{ "sel": [0,1], "from" : [1,1], "into" : [1,1] } -{ "sel": [1,0], "from" : [1,1], "into" : [1,2] } -{ "sel": [0,1], "from" : [1,1], "into" : [1,2] } -{ "sel": [1,0], "from" : [1,1], "into" : [2,1] } -{ "sel": [0,1], "from" : [1,1], "into" : [2,1] } -{ "sel": [0,1,0,0], "from" : [97,98,99,100], "into" : [3,11,98,231] } +{"sel": [1, 0], "from": [1, 1], "into": [1, 1], "tmp": [1, 0]} +{"sel": [0, 1], "from": [1, 1], "into": [1, 1], "tmp": [0, 1]} +{"sel": [1, 0], "from": [1, 1], "into": [1, 2], "tmp": [1, 0]} +{"sel": [0, 1], "from": [1, 1], "into": [1, 2], "tmp": [0, 1]} +{"sel": [1, 0], "from": [1, 1], "into": [2, 1], "tmp": [1, 0]} +{"sel": [0, 1], "from": [1, 1], "into": [2, 1], "tmp": [0, 1]} +{"sel": [0, 1, 0, 0], "from": [97, 98, 99, 100], "into": [3, 11, 98, 231], "tmp": [0, 98, 0, 0]} ;; -{ "sel": [0,0,0,0,0,0], "from" : [250,300,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,0,0,0,1], "from" : [250,251,252,300,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,0,0,1,0], "from" : [250,251,256,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,0,0,1,1], "from" : [266,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,0,1,0,0], "from" : [250,300,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,0,1,0,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,0,1,1,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,0,1,1,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,1,0,0,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,1,0,0,1], "from" : [250,251,252,300,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,1,0,1,0], "from" : [250,300,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,1,0,1,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,1,1,0,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,1,1,0,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,1,1,1,0], "from" : [300,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,0,1,1,1,1], "from" : [300,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,0,0,0,0], "from" : [300,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,0,0,0,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,0,0,1,0], "from" : [250,251,300,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,0,0,1,1], "from" : [250,251,300,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,0,1,0,0], "from" : [250,251,252,253,254,300], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,0,1,0,1], "from" : [250,251,252,253,300,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,0,1,1,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,0,1,1,1], "from" : [250,251,300,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,1,0,0,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,1,0,0,1], "from" : [250,251,252,300,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,1,0,1,0], "from" : [250,251,252,300,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,1,0,1,1], "from" : [250,251,252,300,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,1,1,0,0], "from" : [250,251,252,253,300,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,1,1,0,1], "from" : [250,251,252,253,300,255], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,1,1,1,0], "from" : [250,251,252,253,254,300], "into" : [250,251,252,253,254,255] } -{ "sel": [0,1,1,1,1,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,0,0,0,0], "from" : [250,251,300,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,0,0,0,1], "from" : [250,251,252,300,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,0,0,1,0], "from" : [250,251,300,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,0,0,1,1], "from" : [250,251,300,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,0,1,0,0], "from" : [250,251,300,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,0,1,0,1], "from" : [250,300,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,0,1,1,0], "from" : [250,251,252,253,254,300], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,0,1,1,1], "from" : [250,300,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,1,0,0,0], "from" : [250,300,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,1,0,0,1], "from" : [250,251,252,253,300,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,1,0,1,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,1,0,1,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,1,1,0,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,1,1,0,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,1,1,1,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,0,1,1,1,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,0,0,0,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,0,0,0,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,0,0,1,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,0,0,1,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,0,1,0,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,0,1,0,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,0,1,1,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,0,1,1,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,1,0,0,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,1,0,0,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,1,0,1,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,1,0,1,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,1,1,0,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,1,1,0,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,1,1,1,0], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } -{ "sel": [1,1,1,1,1,1], "from" : [250,251,252,253,254,255], "into" : [250,251,252,253,254,255] } +{"sel": [0, 0, 0, 0, 0, 0], "from": [250, 300, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 0, 0, 0, 0]} +{"sel": [0, 0, 0, 0, 0, 1], "from": [250, 251, 252, 300, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 0, 0, 0, 255]} +{"sel": [0, 0, 0, 0, 1, 0], "from": [250, 251, 256, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 0, 0, 254, 0]} +{"sel": [0, 0, 0, 0, 1, 1], "from": [266, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 0, 0, 254, 255]} +{"sel": [0, 0, 0, 1, 0, 0], "from": [250, 300, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 0, 253, 0, 0]} +{"sel": [0, 0, 0, 1, 0, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 0, 253, 0, 255]} +{"sel": [0, 0, 0, 1, 1, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 0, 253, 254, 0]} +{"sel": [0, 0, 0, 1, 1, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 0, 253, 254, 255]} +{"sel": [0, 0, 1, 0, 0, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 252, 0, 0, 0]} +{"sel": [0, 0, 1, 0, 0, 1], "from": [250, 251, 252, 300, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 252, 0, 0, 255]} +{"sel": [0, 0, 1, 0, 1, 0], "from": [250, 300, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 252, 0, 254, 0]} +{"sel": [0, 0, 1, 0, 1, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 252, 0, 254, 255]} +{"sel": [0, 0, 1, 1, 0, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 252, 253, 0, 0]} +{"sel": [0, 0, 1, 1, 0, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 252, 253, 0, 255]} +{"sel": [0, 0, 1, 1, 1, 0], "from": [300, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 252, 253, 254, 0]} +{"sel": [0, 0, 1, 1, 1, 1], "from": [300, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 0, 252, 253, 254, 255]} +{"sel": [0, 1, 0, 0, 0, 0], "from": [300, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 0, 0, 0, 0]} +{"sel": [0, 1, 0, 0, 0, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 0, 0, 0, 255]} +{"sel": [0, 1, 0, 0, 1, 0], "from": [250, 251, 300, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 0, 0, 254, 0]} +{"sel": [0, 1, 0, 0, 1, 1], "from": [250, 251, 300, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 0, 0, 254, 255]} +{"sel": [0, 1, 0, 1, 0, 0], "from": [250, 251, 252, 253, 254, 300], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 0, 253, 0, 0]} +{"sel": [0, 1, 0, 1, 0, 1], "from": [250, 251, 252, 253, 300, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 0, 253, 0, 255]} +{"sel": [0, 1, 0, 1, 1, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 0, 253, 254, 0]} +{"sel": [0, 1, 0, 1, 1, 1], "from": [250, 251, 300, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 0, 253, 254, 255]} +{"sel": [0, 1, 1, 0, 0, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 252, 0, 0, 0]} +{"sel": [0, 1, 1, 0, 0, 1], "from": [250, 251, 252, 300, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 252, 0, 0, 255]} +{"sel": [0, 1, 1, 0, 1, 0], "from": [250, 251, 252, 300, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 252, 0, 254, 0]} +{"sel": [0, 1, 1, 0, 1, 1], "from": [250, 251, 252, 300, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 252, 0, 254, 255]} +{"sel": [0, 1, 1, 1, 0, 0], "from": [250, 251, 252, 253, 300, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 252, 253, 0, 0]} +{"sel": [0, 1, 1, 1, 0, 1], "from": [250, 251, 252, 253, 300, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 252, 253, 0, 255]} +{"sel": [0, 1, 1, 1, 1, 0], "from": [250, 251, 252, 253, 254, 300], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 252, 253, 254, 0]} +{"sel": [0, 1, 1, 1, 1, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [0, 251, 252, 253, 254, 255]} +{"sel": [1, 0, 0, 0, 0, 0], "from": [250, 251, 300, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 0, 0, 0, 0]} +{"sel": [1, 0, 0, 0, 0, 1], "from": [250, 251, 252, 300, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 0, 0, 0, 255]} +{"sel": [1, 0, 0, 0, 1, 0], "from": [250, 251, 300, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 0, 0, 254, 0]} +{"sel": [1, 0, 0, 0, 1, 1], "from": [250, 251, 300, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 0, 0, 254, 255]} +{"sel": [1, 0, 0, 1, 0, 0], "from": [250, 251, 300, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 0, 253, 0, 0]} +{"sel": [1, 0, 0, 1, 0, 1], "from": [250, 300, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 0, 253, 0, 255]} +{"sel": [1, 0, 0, 1, 1, 0], "from": [250, 251, 252, 253, 254, 300], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 0, 253, 254, 0]} +{"sel": [1, 0, 0, 1, 1, 1], "from": [250, 300, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 0, 253, 254, 255]} +{"sel": [1, 0, 1, 0, 0, 0], "from": [250, 300, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 252, 0, 0, 0]} +{"sel": [1, 0, 1, 0, 0, 1], "from": [250, 251, 252, 253, 300, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 252, 0, 0, 255]} +{"sel": [1, 0, 1, 0, 1, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 252, 0, 254, 0]} +{"sel": [1, 0, 1, 0, 1, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 252, 0, 254, 255]} +{"sel": [1, 0, 1, 1, 0, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 252, 253, 0, 0]} +{"sel": [1, 0, 1, 1, 0, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 252, 253, 0, 255]} +{"sel": [1, 0, 1, 1, 1, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 252, 253, 254, 0]} +{"sel": [1, 0, 1, 1, 1, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 0, 252, 253, 254, 255]} +{"sel": [1, 1, 0, 0, 0, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 0, 0, 0, 0]} +{"sel": [1, 1, 0, 0, 0, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 0, 0, 0, 255]} +{"sel": [1, 1, 0, 0, 1, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 0, 0, 254, 0]} +{"sel": [1, 1, 0, 0, 1, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 0, 0, 254, 255]} +{"sel": [1, 1, 0, 1, 0, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 0, 253, 0, 0]} +{"sel": [1, 1, 0, 1, 0, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 0, 253, 0, 255]} +{"sel": [1, 1, 0, 1, 1, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 0, 253, 254, 0]} +{"sel": [1, 1, 0, 1, 1, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 0, 253, 254, 255]} +{"sel": [1, 1, 1, 0, 0, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 252, 0, 0, 0]} +{"sel": [1, 1, 1, 0, 0, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 252, 0, 0, 255]} +{"sel": [1, 1, 1, 0, 1, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 252, 0, 254, 0]} +{"sel": [1, 1, 1, 0, 1, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 252, 0, 254, 255]} +{"sel": [1, 1, 1, 1, 0, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 252, 253, 0, 0]} +{"sel": [1, 1, 1, 1, 0, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 252, 253, 0, 255]} +{"sel": [1, 1, 1, 1, 1, 0], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 252, 253, 254, 0]} +{"sel": [1, 1, 1, 1, 1, 1], "from": [250, 251, 252, 253, 254, 255], "into": [250, 251, 252, 253, 254, 255], "tmp": [250, 251, 252, 253, 254, 255]} diff --git a/testdata/corset/valid/lookup_29.lisp b/testdata/corset/valid/lookup_29.lisp index 4cdd5d9a1..cee50fa4b 100644 --- a/testdata/corset/valid/lookup_29.lisp +++ b/testdata/corset/valid/lookup_29.lisp @@ -1,5 +1,6 @@ -(defpurefun ((i8 :i8 :force) x) x) -(defcolumns (sel :i1) (from :i16) (into :i8)) +(defcolumns (sel :i1) (from :i16) (into :i8) (tmp :i8)) +;; tmp holds the (narrowed) value of from on selected rows +(defconstraint tmp_def () (if (== sel 1) (== tmp from))) (defclookup l1 @@ -8,5 +9,5 @@ ;; source selector sel ;; source column - ((i8 from)) + (tmp) ) diff --git a/testdata/corset/valid/lookup_29.rejects b/testdata/corset/valid/lookup_29.rejects index 379aba031..cc98b5f00 100644 --- a/testdata/corset/valid/lookup_29.rejects +++ b/testdata/corset/valid/lookup_29.rejects @@ -1,26 +1,26 @@ -{ "sel": [0,0,0,0,1], "from" : [250,251,252,253,1], "into" : [250,251,252,253,254] } -{ "sel": [0,0,0,1,0], "from" : [250,251,252,1,254], "into" : [250,251,252,253,254] } -{ "sel": [0,0,1,0,0], "from" : [250,251,1,252,254], "into" : [250,251,252,253,254] } -{ "sel": [0,1,0,0,0], "from" : [250,1,251,252,254], "into" : [250,251,252,253,254] } -{ "sel": [1,0,0,0,0], "from" : [1,250,251,252,254], "into" : [250,251,252,253,254] } +{"sel": [0, 0, 0, 0, 1], "from": [250, 251, 252, 253, 1], "into": [250, 251, 252, 253, 254], "tmp": [0, 0, 0, 0, 1]} +{"sel": [0, 0, 0, 1, 0], "from": [250, 251, 252, 1, 254], "into": [250, 251, 252, 253, 254], "tmp": [0, 0, 0, 1, 0]} +{"sel": [0, 0, 1, 0, 0], "from": [250, 251, 1, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [0, 0, 1, 0, 0]} +{"sel": [0, 1, 0, 0, 0], "from": [250, 1, 251, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [0, 1, 0, 0, 0]} +{"sel": [1, 0, 0, 0, 0], "from": [1, 250, 251, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [1, 0, 0, 0, 0]} ;; -{ "sel": [0,0,0,1,1], "from" : [250,251,252,253,1], "into" : [250,251,252,253,254] } -{ "sel": [0,0,1,0,1], "from" : [250,251,252,253,1], "into" : [250,251,252,253,254] } -{ "sel": [0,1,0,0,1], "from" : [250,251,252,253,1], "into" : [250,251,252,253,254] } -{ "sel": [1,0,0,0,1], "from" : [250,251,252,253,1], "into" : [250,251,252,253,254] } -{ "sel": [0,0,0,1,1], "from" : [250,251,252,1,254], "into" : [250,251,252,253,254] } -{ "sel": [0,0,1,1,0], "from" : [250,251,252,1,254], "into" : [250,251,252,253,254] } -{ "sel": [0,1,0,1,0], "from" : [250,251,252,1,254], "into" : [250,251,252,253,254] } -{ "sel": [1,0,0,1,0], "from" : [250,251,252,1,254], "into" : [250,251,252,253,254] } -{ "sel": [0,0,1,0,1], "from" : [250,251,1,252,254], "into" : [250,251,252,253,254] } -{ "sel": [0,0,1,1,0], "from" : [250,251,1,252,254], "into" : [250,251,252,253,254] } -{ "sel": [0,1,1,0,0], "from" : [250,251,1,252,254], "into" : [250,251,252,253,254] } -{ "sel": [1,0,1,0,0], "from" : [250,251,1,252,254], "into" : [250,251,252,253,254] } -{ "sel": [0,1,0,0,1], "from" : [250,1,251,252,254], "into" : [250,251,252,253,254] } -{ "sel": [0,1,0,1,0], "from" : [250,1,251,252,254], "into" : [250,251,252,253,254] } -{ "sel": [0,1,1,0,0], "from" : [250,1,251,252,254], "into" : [250,251,252,253,254] } -{ "sel": [1,1,0,0,0], "from" : [250,1,251,252,254], "into" : [250,251,252,253,254] } -{ "sel": [1,0,0,0,1], "from" : [1,250,251,252,254], "into" : [250,251,252,253,254] } -{ "sel": [1,0,0,1,0], "from" : [1,250,251,252,254], "into" : [250,251,252,253,254] } -{ "sel": [1,0,1,0,0], "from" : [1,250,251,252,254], "into" : [250,251,252,253,254] } -{ "sel": [1,1,0,0,0], "from" : [1,250,251,252,254], "into" : [250,251,252,253,254] } +{"sel": [0, 0, 0, 1, 1], "from": [250, 251, 252, 253, 1], "into": [250, 251, 252, 253, 254], "tmp": [0, 0, 0, 253, 1]} +{"sel": [0, 0, 1, 0, 1], "from": [250, 251, 252, 253, 1], "into": [250, 251, 252, 253, 254], "tmp": [0, 0, 252, 0, 1]} +{"sel": [0, 1, 0, 0, 1], "from": [250, 251, 252, 253, 1], "into": [250, 251, 252, 253, 254], "tmp": [0, 251, 0, 0, 1]} +{"sel": [1, 0, 0, 0, 1], "from": [250, 251, 252, 253, 1], "into": [250, 251, 252, 253, 254], "tmp": [250, 0, 0, 0, 1]} +{"sel": [0, 0, 0, 1, 1], "from": [250, 251, 252, 1, 254], "into": [250, 251, 252, 253, 254], "tmp": [0, 0, 0, 1, 254]} +{"sel": [0, 0, 1, 1, 0], "from": [250, 251, 252, 1, 254], "into": [250, 251, 252, 253, 254], "tmp": [0, 0, 252, 1, 0]} +{"sel": [0, 1, 0, 1, 0], "from": [250, 251, 252, 1, 254], "into": [250, 251, 252, 253, 254], "tmp": [0, 251, 0, 1, 0]} +{"sel": [1, 0, 0, 1, 0], "from": [250, 251, 252, 1, 254], "into": [250, 251, 252, 253, 254], "tmp": [250, 0, 0, 1, 0]} +{"sel": [0, 0, 1, 0, 1], "from": [250, 251, 1, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [0, 0, 1, 0, 254]} +{"sel": [0, 0, 1, 1, 0], "from": [250, 251, 1, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [0, 0, 1, 252, 0]} +{"sel": [0, 1, 1, 0, 0], "from": [250, 251, 1, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [0, 251, 1, 0, 0]} +{"sel": [1, 0, 1, 0, 0], "from": [250, 251, 1, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [250, 0, 1, 0, 0]} +{"sel": [0, 1, 0, 0, 1], "from": [250, 1, 251, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [0, 1, 0, 0, 254]} +{"sel": [0, 1, 0, 1, 0], "from": [250, 1, 251, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [0, 1, 0, 252, 0]} +{"sel": [0, 1, 1, 0, 0], "from": [250, 1, 251, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [0, 1, 251, 0, 0]} +{"sel": [1, 1, 0, 0, 0], "from": [250, 1, 251, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [250, 1, 0, 0, 0]} +{"sel": [1, 0, 0, 0, 1], "from": [1, 250, 251, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [1, 0, 0, 0, 254]} +{"sel": [1, 0, 0, 1, 0], "from": [1, 250, 251, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [1, 0, 0, 252, 0]} +{"sel": [1, 0, 1, 0, 0], "from": [1, 250, 251, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [1, 0, 251, 0, 0]} +{"sel": [1, 1, 0, 0, 0], "from": [1, 250, 251, 252, 254], "into": [250, 251, 252, 253, 254], "tmp": [1, 250, 0, 0, 0]} diff --git a/testdata/corset/valid/lookup_30.accepts b/testdata/corset/valid/lookup_30.accepts index 3effab1c2..3b8244534 100644 --- a/testdata/corset/valid/lookup_30.accepts +++ b/testdata/corset/valid/lookup_30.accepts @@ -1,15 +1,15 @@ -{ "m1.sel": [0], "m1.X": [1], "m1.Y": [255], "m2.X":[], "m2.Y":[] } -{ "m1.sel": [0], "m1.X": [254], "m1.Y": [255], "m2.X":[], "m2.Y":[] } -{ "m1.sel": [0], "m1.X": [12345], "m1.Y": [255], "m2.X":[], "m2.Y":[] } +{"m1.sel": [0], "m1.X": [1], "m1.Y": [255], "m2.X": [], "m2.Y": [], "m1.tmp": [0]} +{"m1.sel": [0], "m1.X": [254], "m1.Y": [255], "m2.X": [], "m2.Y": [], "m1.tmp": [0]} +{"m1.sel": [0], "m1.X": [12345], "m1.Y": [255], "m2.X": [], "m2.Y": [], "m1.tmp": [0]} ;; -{ "m1.sel": [1], "m1.X": [1], "m1.Y": [1], "m2.X":[1], "m2.Y":[1] } -{ "m1.sel": [1], "m1.X": [1], "m1.Y": [2], "m2.X":[1,1], "m2.Y":[1,2] } -{ "m1.sel": [1], "m1.X": [1], "m1.Y": [2], "m2.X":[1,1], "m2.Y":[2,1] } +{"m1.sel": [1], "m1.X": [1], "m1.Y": [1], "m2.X": [1], "m2.Y": [1], "m1.tmp": [1]} +{"m1.sel": [1], "m1.X": [1], "m1.Y": [2], "m2.X": [1, 1], "m2.Y": [1, 2], "m1.tmp": [1]} +{"m1.sel": [1], "m1.X": [1], "m1.Y": [2], "m2.X": [1, 1], "m2.Y": [2, 1], "m1.tmp": [1]} ;; -{ "m1.sel": [1,0], "m1.X": [1,65535], "m1.Y": [1,255], "m2.X":[1], "m2.Y":[1] } -{ "m1.sel": [1,0], "m1.X": [1,65535], "m1.Y": [2,255], "m2.X":[1,1], "m2.Y":[1,2] } -{ "m1.sel": [1,0], "m1.X": [1,65535], "m1.Y": [2,255], "m2.X":[1,1], "m2.Y":[2,1] } +{"m1.sel": [1, 0], "m1.X": [1, 65535], "m1.Y": [1, 255], "m2.X": [1], "m2.Y": [1], "m1.tmp": [1, 0]} +{"m1.sel": [1, 0], "m1.X": [1, 65535], "m1.Y": [2, 255], "m2.X": [1, 1], "m2.Y": [1, 2], "m1.tmp": [1, 0]} +{"m1.sel": [1, 0], "m1.X": [1, 65535], "m1.Y": [2, 255], "m2.X": [1, 1], "m2.Y": [2, 1], "m1.tmp": [1, 0]} ;; -{ "m1.sel": [0,1], "m1.X": [65535,1], "m1.Y": [1,255], "m2.X":[1,1], "m2.Y":[2,255] } -{ "m1.sel": [0,1], "m1.X": [65535,1], "m1.Y": [2,255], "m2.X":[1,1], "m2.Y":[2,255] } -{ "m1.sel": [0,1], "m1.X": [65535,1], "m1.Y": [2,255], "m2.X":[1,1], "m2.Y":[2,255] } +{"m1.sel": [0, 1], "m1.X": [65535, 1], "m1.Y": [1, 255], "m2.X": [1, 1], "m2.Y": [2, 255], "m1.tmp": [0, 1]} +{"m1.sel": [0, 1], "m1.X": [65535, 1], "m1.Y": [2, 255], "m2.X": [1, 1], "m2.Y": [2, 255], "m1.tmp": [0, 1]} +{"m1.sel": [0, 1], "m1.X": [65535, 1], "m1.Y": [2, 255], "m2.X": [1, 1], "m2.Y": [2, 255], "m1.tmp": [0, 1]} diff --git a/testdata/corset/valid/lookup_30.lisp b/testdata/corset/valid/lookup_30.lisp index d7245f251..b2f59e60d 100644 --- a/testdata/corset/valid/lookup_30.lisp +++ b/testdata/corset/valid/lookup_30.lisp @@ -1,6 +1,7 @@ -(defpurefun ((i8 :i8 :force) x) x) (module m1) -(defcolumns (sel :i1) (X :i16) (Y :i8)) +(defcolumns (sel :i1) (X :i16) (Y :i8) (tmp :i8)) +;; tmp holds the (narrowed) value of X on selected rows +(defconstraint tmp_def () (if (== sel 1) (== tmp X))) (defclookup l1 @@ -9,7 +10,7 @@ ;; source selector m1.sel ;; source column - ((i8 m1.X) m1.Y)) + (m1.tmp m1.Y)) (module m2) (defcolumns (X :i8) (Y :i8)) diff --git a/testdata/corset/valid/lookup_30.rejects b/testdata/corset/valid/lookup_30.rejects index 7cd1e73c2..1bd9bb11a 100644 --- a/testdata/corset/valid/lookup_30.rejects +++ b/testdata/corset/valid/lookup_30.rejects @@ -1,4 +1,4 @@ -{ "m1.sel": [1], "m1.X": [1], "m1.Y": [255], "m2.X":[1,2,3,4,5], "m2.Y":[250,251,252,253,254] } -{ "m1.sel": [0,1], "m1.X": [256,1], "m1.Y": [0,255], "m2.X":[1,2,3,4,5], "m2.Y":[250,251,252,253,254] } -{ "m1.sel": [1,0], "m1.X": [1,256], "m1.Y": [0,255], "m2.X":[1,2,3,4,5], "m2.Y":[250,251,252,253,254] } -{ "m1.sel": [1,1], "m1.X": [1,1], "m1.Y": [254,255], "m2.X":[1,2,3,4,5], "m2.Y":[250,251,252,253,254] } +{"m1.sel": [1], "m1.X": [1], "m1.Y": [255], "m2.X": [1, 2, 3, 4, 5], "m2.Y": [250, 251, 252, 253, 254], "m1.tmp": [1]} +{"m1.sel": [0, 1], "m1.X": [256, 1], "m1.Y": [0, 255], "m2.X": [1, 2, 3, 4, 5], "m2.Y": [250, 251, 252, 253, 254], "m1.tmp": [0, 1]} +{"m1.sel": [1, 0], "m1.X": [1, 256], "m1.Y": [0, 255], "m2.X": [1, 2, 3, 4, 5], "m2.Y": [250, 251, 252, 253, 254], "m1.tmp": [1, 0]} +{"m1.sel": [1, 1], "m1.X": [1, 1], "m1.Y": [254, 255], "m2.X": [1, 2, 3, 4, 5], "m2.Y": [250, 251, 252, 253, 254], "m1.tmp": [1, 1]}