diff --git a/changelogs/unreleased/1309-dark64 b/changelogs/unreleased/1309-dark64 new file mode 100644 index 000000000..ef329c680 --- /dev/null +++ b/changelogs/unreleased/1309-dark64 @@ -0,0 +1 @@ +Improve safety in range checks \ No newline at end of file diff --git a/zokrates_ast/src/common/error.rs b/zokrates_ast/src/common/error.rs index 82a201881..6f799fd8b 100644 --- a/zokrates_ast/src/common/error.rs +++ b/zokrates_ast/src/common/error.rs @@ -18,7 +18,7 @@ pub enum RuntimeError { BranchIsolation, ConstantLtBitness, ConstantLtSum, - LtFinalSum, + LtSum, LtSymetric, Or, Xor, @@ -83,7 +83,7 @@ impl fmt::Display for RuntimeError { BranchIsolation => "Branch isolation failed", ConstantLtBitness => "Bitness check failed in constant Lt check", ConstantLtSum => "Sum check failed in constant Lt check", - LtFinalSum => "Sum check failed in final Lt check", + LtSum => "Sum check failed in Lt check", LtSymetric => "Symetrical check failed in Lt check", Or => "Or check failed", Xor => "Xor check failed", diff --git a/zokrates_cli/tests/code/taxation.smt2 b/zokrates_cli/tests/code/taxation.smt2 index 7935ade77..19b00772b 100644 --- a/zokrates_cli/tests/code/taxation.smt2 +++ b/zokrates_cli/tests/code/taxation.smt2 @@ -1,6 +1,6 @@ ; Auto generated by ZoKrates -; Number of circuit variables: 260 -; Number of equalities: 261 +; Number of circuit variables: 764 +; Number of equalities: 769 (declare-const |~prime| Int) (declare-const |~out_0| Int) (declare-const |~one| Int) @@ -261,7 +261,511 @@ (declare-const |_254| Int) (declare-const |_257| Int) (declare-const |_258| Int) +(declare-const |_259| Int) +(declare-const |_260| Int) +(declare-const |_261| Int) +(declare-const |_262| Int) +(declare-const |_263| Int) (declare-const |_264| Int) +(declare-const |_265| Int) +(declare-const |_266| Int) +(declare-const |_267| Int) +(declare-const |_268| Int) +(declare-const |_269| Int) +(declare-const |_270| Int) +(declare-const |_271| Int) +(declare-const |_272| Int) +(declare-const |_273| Int) +(declare-const |_274| Int) +(declare-const |_275| Int) +(declare-const |_276| Int) +(declare-const |_277| Int) +(declare-const |_278| Int) +(declare-const |_279| Int) +(declare-const |_280| Int) +(declare-const |_281| Int) +(declare-const |_282| Int) +(declare-const |_283| Int) +(declare-const |_284| Int) +(declare-const |_285| Int) +(declare-const |_286| Int) +(declare-const |_287| Int) +(declare-const |_288| Int) +(declare-const |_289| Int) +(declare-const |_290| Int) +(declare-const |_291| Int) +(declare-const |_292| Int) +(declare-const |_293| Int) +(declare-const |_294| Int) +(declare-const |_295| Int) +(declare-const |_296| Int) +(declare-const |_297| Int) +(declare-const |_298| Int) +(declare-const |_299| Int) +(declare-const |_300| Int) +(declare-const |_301| Int) +(declare-const |_302| Int) +(declare-const |_303| Int) +(declare-const |_304| Int) +(declare-const |_305| Int) +(declare-const |_306| Int) +(declare-const |_307| Int) +(declare-const |_308| Int) +(declare-const |_309| Int) +(declare-const |_310| Int) +(declare-const |_311| Int) +(declare-const |_312| Int) +(declare-const |_313| Int) +(declare-const |_314| Int) +(declare-const |_315| Int) +(declare-const |_316| Int) +(declare-const |_317| Int) +(declare-const |_318| Int) +(declare-const |_319| Int) +(declare-const |_320| Int) +(declare-const |_321| Int) +(declare-const |_322| Int) +(declare-const |_323| Int) +(declare-const |_324| Int) +(declare-const |_325| Int) +(declare-const |_326| Int) +(declare-const |_327| Int) +(declare-const |_328| Int) +(declare-const |_329| Int) +(declare-const |_330| Int) +(declare-const |_331| Int) +(declare-const |_332| Int) +(declare-const |_333| Int) +(declare-const |_334| Int) +(declare-const |_335| Int) +(declare-const |_336| Int) +(declare-const |_337| Int) +(declare-const |_338| Int) +(declare-const |_339| Int) +(declare-const |_340| Int) +(declare-const |_341| Int) +(declare-const |_342| Int) +(declare-const |_343| Int) +(declare-const |_344| Int) +(declare-const |_345| Int) +(declare-const |_346| Int) +(declare-const |_347| Int) +(declare-const |_348| Int) +(declare-const |_349| Int) +(declare-const |_350| Int) +(declare-const |_351| Int) +(declare-const |_352| Int) +(declare-const |_353| Int) +(declare-const |_354| Int) +(declare-const |_355| Int) +(declare-const |_356| Int) +(declare-const |_357| Int) +(declare-const |_358| Int) +(declare-const |_359| Int) +(declare-const |_360| Int) +(declare-const |_361| Int) +(declare-const |_362| Int) +(declare-const |_363| Int) +(declare-const |_364| Int) +(declare-const |_365| Int) +(declare-const |_366| Int) +(declare-const |_367| Int) +(declare-const |_368| Int) +(declare-const |_369| Int) +(declare-const |_370| Int) +(declare-const |_371| Int) +(declare-const |_372| Int) +(declare-const |_373| Int) +(declare-const |_374| Int) +(declare-const |_375| Int) +(declare-const |_376| Int) +(declare-const |_377| Int) +(declare-const |_378| Int) +(declare-const |_379| Int) +(declare-const |_380| Int) +(declare-const |_381| Int) +(declare-const |_382| Int) +(declare-const |_383| Int) +(declare-const |_384| Int) +(declare-const |_385| Int) +(declare-const |_386| Int) +(declare-const |_387| Int) +(declare-const |_388| Int) +(declare-const |_389| Int) +(declare-const |_390| Int) +(declare-const |_391| Int) +(declare-const |_392| Int) +(declare-const |_393| Int) +(declare-const |_394| Int) +(declare-const |_395| Int) +(declare-const |_396| Int) +(declare-const |_397| Int) +(declare-const |_398| Int) +(declare-const |_399| Int) +(declare-const |_400| Int) +(declare-const |_401| Int) +(declare-const |_402| Int) +(declare-const |_403| Int) +(declare-const |_404| Int) +(declare-const |_405| Int) +(declare-const |_406| Int) +(declare-const |_407| Int) +(declare-const |_408| Int) +(declare-const |_409| Int) +(declare-const |_410| Int) +(declare-const |_411| Int) +(declare-const |_412| Int) +(declare-const |_413| Int) +(declare-const |_414| Int) +(declare-const |_415| Int) +(declare-const |_416| Int) +(declare-const |_417| Int) +(declare-const |_418| Int) +(declare-const |_419| Int) +(declare-const |_420| Int) +(declare-const |_421| Int) +(declare-const |_422| Int) +(declare-const |_423| Int) +(declare-const |_424| Int) +(declare-const |_425| Int) +(declare-const |_426| Int) +(declare-const |_427| Int) +(declare-const |_428| Int) +(declare-const |_429| Int) +(declare-const |_430| Int) +(declare-const |_431| Int) +(declare-const |_432| Int) +(declare-const |_433| Int) +(declare-const |_434| Int) +(declare-const |_435| Int) +(declare-const |_436| Int) +(declare-const |_437| Int) +(declare-const |_438| Int) +(declare-const |_439| Int) +(declare-const |_440| Int) +(declare-const |_441| Int) +(declare-const |_442| Int) +(declare-const |_443| Int) +(declare-const |_444| Int) +(declare-const |_445| Int) +(declare-const |_446| Int) +(declare-const |_447| Int) +(declare-const |_448| Int) +(declare-const |_449| Int) +(declare-const |_450| Int) +(declare-const |_451| Int) +(declare-const |_452| Int) +(declare-const |_453| Int) +(declare-const |_454| Int) +(declare-const |_455| Int) +(declare-const |_456| Int) +(declare-const |_457| Int) +(declare-const |_458| Int) +(declare-const |_459| Int) +(declare-const |_460| Int) +(declare-const |_461| Int) +(declare-const |_462| Int) +(declare-const |_463| Int) +(declare-const |_464| Int) +(declare-const |_465| Int) +(declare-const |_466| Int) +(declare-const |_467| Int) +(declare-const |_468| Int) +(declare-const |_469| Int) +(declare-const |_470| Int) +(declare-const |_471| Int) +(declare-const |_472| Int) +(declare-const |_473| Int) +(declare-const |_474| Int) +(declare-const |_475| Int) +(declare-const |_476| Int) +(declare-const |_477| Int) +(declare-const |_478| Int) +(declare-const |_479| Int) +(declare-const |_480| Int) +(declare-const |_481| Int) +(declare-const |_482| Int) +(declare-const |_483| Int) +(declare-const |_484| Int) +(declare-const |_485| Int) +(declare-const |_486| Int) +(declare-const |_487| Int) +(declare-const |_488| Int) +(declare-const |_489| Int) +(declare-const |_490| Int) +(declare-const |_491| Int) +(declare-const |_492| Int) +(declare-const |_493| Int) +(declare-const |_494| Int) +(declare-const |_495| Int) +(declare-const |_496| Int) +(declare-const |_497| Int) +(declare-const |_498| Int) +(declare-const |_499| Int) +(declare-const |_500| Int) +(declare-const |_501| Int) +(declare-const |_502| Int) +(declare-const |_503| Int) +(declare-const |_504| Int) +(declare-const |_505| Int) +(declare-const |_506| Int) +(declare-const |_507| Int) +(declare-const |_508| Int) +(declare-const |_509| Int) +(declare-const |_510| Int) +(declare-const |_511| Int) +(declare-const |_512| Int) +(declare-const |_513| Int) +(declare-const |_514| Int) +(declare-const |_515| Int) +(declare-const |_516| Int) +(declare-const |_517| Int) +(declare-const |_518| Int) +(declare-const |_519| Int) +(declare-const |_520| Int) +(declare-const |_521| Int) +(declare-const |_522| Int) +(declare-const |_523| Int) +(declare-const |_524| Int) +(declare-const |_525| Int) +(declare-const |_526| Int) +(declare-const |_527| Int) +(declare-const |_528| Int) +(declare-const |_529| Int) +(declare-const |_530| Int) +(declare-const |_531| Int) +(declare-const |_532| Int) +(declare-const |_533| Int) +(declare-const |_534| Int) +(declare-const |_535| Int) +(declare-const |_536| Int) +(declare-const |_537| Int) +(declare-const |_538| Int) +(declare-const |_539| Int) +(declare-const |_540| Int) +(declare-const |_541| Int) +(declare-const |_542| Int) +(declare-const |_543| Int) +(declare-const |_544| Int) +(declare-const |_545| Int) +(declare-const |_546| Int) +(declare-const |_547| Int) +(declare-const |_548| Int) +(declare-const |_549| Int) +(declare-const |_550| Int) +(declare-const |_551| Int) +(declare-const |_552| Int) +(declare-const |_553| Int) +(declare-const |_554| Int) +(declare-const |_555| Int) +(declare-const |_556| Int) +(declare-const |_557| Int) +(declare-const |_558| Int) +(declare-const |_559| Int) +(declare-const |_560| Int) +(declare-const |_561| Int) +(declare-const |_562| Int) +(declare-const |_563| Int) +(declare-const |_564| Int) +(declare-const |_565| Int) +(declare-const |_566| Int) +(declare-const |_567| Int) +(declare-const |_568| Int) +(declare-const |_569| Int) +(declare-const |_570| Int) +(declare-const |_571| Int) +(declare-const |_572| Int) +(declare-const |_573| Int) +(declare-const |_574| Int) +(declare-const |_575| Int) +(declare-const |_576| Int) +(declare-const |_577| Int) +(declare-const |_578| Int) +(declare-const |_579| Int) +(declare-const |_580| Int) +(declare-const |_581| Int) +(declare-const |_582| Int) +(declare-const |_583| Int) +(declare-const |_584| Int) +(declare-const |_585| Int) +(declare-const |_586| Int) +(declare-const |_587| Int) +(declare-const |_588| Int) +(declare-const |_589| Int) +(declare-const |_590| Int) +(declare-const |_591| Int) +(declare-const |_592| Int) +(declare-const |_593| Int) +(declare-const |_594| Int) +(declare-const |_595| Int) +(declare-const |_596| Int) +(declare-const |_597| Int) +(declare-const |_598| Int) +(declare-const |_599| Int) +(declare-const |_600| Int) +(declare-const |_601| Int) +(declare-const |_602| Int) +(declare-const |_603| Int) +(declare-const |_604| Int) +(declare-const |_605| Int) +(declare-const |_606| Int) +(declare-const |_607| Int) +(declare-const |_608| Int) +(declare-const |_609| Int) +(declare-const |_610| Int) +(declare-const |_611| Int) +(declare-const |_612| Int) +(declare-const |_613| Int) +(declare-const |_614| Int) +(declare-const |_615| Int) +(declare-const |_616| Int) +(declare-const |_617| Int) +(declare-const |_618| Int) +(declare-const |_619| Int) +(declare-const |_620| Int) +(declare-const |_621| Int) +(declare-const |_622| Int) +(declare-const |_623| Int) +(declare-const |_624| Int) +(declare-const |_625| Int) +(declare-const |_626| Int) +(declare-const |_627| Int) +(declare-const |_628| Int) +(declare-const |_629| Int) +(declare-const |_630| Int) +(declare-const |_631| Int) +(declare-const |_632| Int) +(declare-const |_633| Int) +(declare-const |_634| Int) +(declare-const |_635| Int) +(declare-const |_636| Int) +(declare-const |_637| Int) +(declare-const |_638| Int) +(declare-const |_639| Int) +(declare-const |_640| Int) +(declare-const |_641| Int) +(declare-const |_642| Int) +(declare-const |_643| Int) +(declare-const |_644| Int) +(declare-const |_645| Int) +(declare-const |_646| Int) +(declare-const |_647| Int) +(declare-const |_648| Int) +(declare-const |_649| Int) +(declare-const |_650| Int) +(declare-const |_651| Int) +(declare-const |_652| Int) +(declare-const |_653| Int) +(declare-const |_654| Int) +(declare-const |_655| Int) +(declare-const |_656| Int) +(declare-const |_657| Int) +(declare-const |_658| Int) +(declare-const |_659| Int) +(declare-const |_660| Int) +(declare-const |_661| Int) +(declare-const |_662| Int) +(declare-const |_663| Int) +(declare-const |_664| Int) +(declare-const |_665| Int) +(declare-const |_666| Int) +(declare-const |_667| Int) +(declare-const |_668| Int) +(declare-const |_669| Int) +(declare-const |_670| Int) +(declare-const |_671| Int) +(declare-const |_672| Int) +(declare-const |_673| Int) +(declare-const |_674| Int) +(declare-const |_675| Int) +(declare-const |_676| Int) +(declare-const |_677| Int) +(declare-const |_678| Int) +(declare-const |_679| Int) +(declare-const |_680| Int) +(declare-const |_681| Int) +(declare-const |_682| Int) +(declare-const |_683| Int) +(declare-const |_684| Int) +(declare-const |_685| Int) +(declare-const |_686| Int) +(declare-const |_687| Int) +(declare-const |_688| Int) +(declare-const |_689| Int) +(declare-const |_690| Int) +(declare-const |_691| Int) +(declare-const |_692| Int) +(declare-const |_693| Int) +(declare-const |_694| Int) +(declare-const |_695| Int) +(declare-const |_696| Int) +(declare-const |_697| Int) +(declare-const |_698| Int) +(declare-const |_699| Int) +(declare-const |_700| Int) +(declare-const |_701| Int) +(declare-const |_702| Int) +(declare-const |_703| Int) +(declare-const |_704| Int) +(declare-const |_705| Int) +(declare-const |_706| Int) +(declare-const |_707| Int) +(declare-const |_708| Int) +(declare-const |_709| Int) +(declare-const |_710| Int) +(declare-const |_711| Int) +(declare-const |_712| Int) +(declare-const |_713| Int) +(declare-const |_714| Int) +(declare-const |_715| Int) +(declare-const |_716| Int) +(declare-const |_717| Int) +(declare-const |_718| Int) +(declare-const |_719| Int) +(declare-const |_720| Int) +(declare-const |_721| Int) +(declare-const |_722| Int) +(declare-const |_723| Int) +(declare-const |_724| Int) +(declare-const |_725| Int) +(declare-const |_726| Int) +(declare-const |_727| Int) +(declare-const |_728| Int) +(declare-const |_729| Int) +(declare-const |_730| Int) +(declare-const |_731| Int) +(declare-const |_732| Int) +(declare-const |_733| Int) +(declare-const |_734| Int) +(declare-const |_735| Int) +(declare-const |_736| Int) +(declare-const |_737| Int) +(declare-const |_738| Int) +(declare-const |_739| Int) +(declare-const |_740| Int) +(declare-const |_741| Int) +(declare-const |_742| Int) +(declare-const |_743| Int) +(declare-const |_744| Int) +(declare-const |_745| Int) +(declare-const |_746| Int) +(declare-const |_747| Int) +(declare-const |_748| Int) +(declare-const |_749| Int) +(declare-const |_750| Int) +(declare-const |_751| Int) +(declare-const |_752| Int) +(declare-const |_753| Int) +(declare-const |_754| Int) +(declare-const |_755| Int) +(declare-const |_756| Int) +(declare-const |_757| Int) +(declare-const |_758| Int) +(declare-const |_759| Int) +(declare-const |_760| Int) +(declare-const |_761| Int) +(declare-const |_762| Int) +(declare-const |_768| Int) (assert (and (= |~prime| 21888242871839275222246405745257275088548364400416034343698204186575808495617) (= |~one| 1) @@ -524,6 +1028,514 @@ (= (mod (* (+ (* |~one| 14651237294507013008273219182214280847718990358813499091232105186081237893121) (* |_0| 1) (* |_1| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (* |_258| 1)) |~prime|) (mod (* |_257| 1) |~prime|)) (= (mod (* (+ (* |~one| 1) (* |_257| 21888242871839275222246405745257275088548364400416034343698204186575808495616)) (+ (* |~one| 14651237294507013008273219182214280847718990358813499091232105186081237893121) (* |_0| 1) (* |_1| 21888242871839275222246405745257275088548364400416034343698204186575808495616))) |~prime|) (mod 0 |~prime|)) (= (mod (* (* |~one| 1) (* |~one| 1)) |~prime|) (mod (* |_257| 1) |~prime|)) -(= (mod (* (* |_2| 1) (+ (* |_0| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1| 1))) |~prime|) (mod (* |_264| 1) |~prime|)) -(= (mod (* (* |~one| 1) (* |_264| 1)) |~prime|) (mod (* |~out_0| 1) |~prime|)) + +(= (mod (* (* |_259| 1) (* |_259| 1)) |~prime|) (mod (* |_259| 1) |~prime|)) +(= (mod (* (* |_260| 1) (* |_260| 1)) |~prime|) (mod (* |_260| 1) |~prime|)) +(= (mod (* (* |_261| 1) (* |_261| 1)) |~prime|) (mod (* |_261| 1) |~prime|)) +(= (mod (* (* |_262| 1) (* |_262| 1)) |~prime|) (mod (* |_262| 1) |~prime|)) +(= (mod (* (* |_263| 1) (* |_263| 1)) |~prime|) (mod (* |_263| 1) |~prime|)) +(= (mod (* (* |_264| 1) (* |_264| 1)) |~prime|) (mod (* |_264| 1) |~prime|)) +(= (mod (* (* |_265| 1) (* |_265| 1)) |~prime|) (mod (* |_265| 1) |~prime|)) +(= (mod (* (* |_266| 1) (* |_266| 1)) |~prime|) (mod (* |_266| 1) |~prime|)) +(= (mod (* (* |_267| 1) (* |_267| 1)) |~prime|) (mod (* |_267| 1) |~prime|)) +(= (mod (* (* |_268| 1) (* |_268| 1)) |~prime|) (mod (* |_268| 1) |~prime|)) +(= (mod (* (* |_269| 1) (* |_269| 1)) |~prime|) (mod (* |_269| 1) |~prime|)) +(= (mod (* (* |_270| 1) (* |_270| 1)) |~prime|) (mod (* |_270| 1) |~prime|)) +(= (mod (* (* |_271| 1) (* |_271| 1)) |~prime|) (mod (* |_271| 1) |~prime|)) +(= (mod (* (* |_272| 1) (* |_272| 1)) |~prime|) (mod (* |_272| 1) |~prime|)) +(= (mod (* (* |_273| 1) (* |_273| 1)) |~prime|) (mod (* |_273| 1) |~prime|)) +(= (mod (* (* |_274| 1) (* |_274| 1)) |~prime|) (mod (* |_274| 1) |~prime|)) +(= (mod (* (* |_275| 1) (* |_275| 1)) |~prime|) (mod (* |_275| 1) |~prime|)) +(= (mod (* (* |_276| 1) (* |_276| 1)) |~prime|) (mod (* |_276| 1) |~prime|)) +(= (mod (* (* |_277| 1) (* |_277| 1)) |~prime|) (mod (* |_277| 1) |~prime|)) +(= (mod (* (* |_278| 1) (* |_278| 1)) |~prime|) (mod (* |_278| 1) |~prime|)) +(= (mod (* (* |_279| 1) (* |_279| 1)) |~prime|) (mod (* |_279| 1) |~prime|)) +(= (mod (* (* |_280| 1) (* |_280| 1)) |~prime|) (mod (* |_280| 1) |~prime|)) +(= (mod (* (* |_281| 1) (* |_281| 1)) |~prime|) (mod (* |_281| 1) |~prime|)) +(= (mod (* (* |_282| 1) (* |_282| 1)) |~prime|) (mod (* |_282| 1) |~prime|)) +(= (mod (* (* |_283| 1) (* |_283| 1)) |~prime|) (mod (* |_283| 1) |~prime|)) +(= (mod (* (* |_284| 1) (* |_284| 1)) |~prime|) (mod (* |_284| 1) |~prime|)) +(= (mod (* (* |_285| 1) (* |_285| 1)) |~prime|) (mod (* |_285| 1) |~prime|)) +(= (mod (* (* |_286| 1) (* |_286| 1)) |~prime|) (mod (* |_286| 1) |~prime|)) +(= (mod (* (* |_287| 1) (* |_287| 1)) |~prime|) (mod (* |_287| 1) |~prime|)) +(= (mod (* (* |_288| 1) (* |_288| 1)) |~prime|) (mod (* |_288| 1) |~prime|)) +(= (mod (* (* |_289| 1) (* |_289| 1)) |~prime|) (mod (* |_289| 1) |~prime|)) +(= (mod (* (* |_290| 1) (* |_290| 1)) |~prime|) (mod (* |_290| 1) |~prime|)) +(= (mod (* (* |_291| 1) (* |_291| 1)) |~prime|) (mod (* |_291| 1) |~prime|)) +(= (mod (* (* |_292| 1) (* |_292| 1)) |~prime|) (mod (* |_292| 1) |~prime|)) +(= (mod (* (* |_293| 1) (* |_293| 1)) |~prime|) (mod (* |_293| 1) |~prime|)) +(= (mod (* (* |_294| 1) (* |_294| 1)) |~prime|) (mod (* |_294| 1) |~prime|)) +(= (mod (* (* |_295| 1) (* |_295| 1)) |~prime|) (mod (* |_295| 1) |~prime|)) +(= (mod (* (* |_296| 1) (* |_296| 1)) |~prime|) (mod (* |_296| 1) |~prime|)) +(= (mod (* (* |_297| 1) (* |_297| 1)) |~prime|) (mod (* |_297| 1) |~prime|)) +(= (mod (* (* |_298| 1) (* |_298| 1)) |~prime|) (mod (* |_298| 1) |~prime|)) +(= (mod (* (* |_299| 1) (* |_299| 1)) |~prime|) (mod (* |_299| 1) |~prime|)) +(= (mod (* (* |_300| 1) (* |_300| 1)) |~prime|) (mod (* |_300| 1) |~prime|)) +(= (mod (* (* |_301| 1) (* |_301| 1)) |~prime|) (mod (* |_301| 1) |~prime|)) +(= (mod (* (* |_302| 1) (* |_302| 1)) |~prime|) (mod (* |_302| 1) |~prime|)) +(= (mod (* (* |_303| 1) (* |_303| 1)) |~prime|) (mod (* |_303| 1) |~prime|)) +(= (mod (* (* |_304| 1) (* |_304| 1)) |~prime|) (mod (* |_304| 1) |~prime|)) +(= (mod (* (* |_305| 1) (* |_305| 1)) |~prime|) (mod (* |_305| 1) |~prime|)) +(= (mod (* (* |_306| 1) (* |_306| 1)) |~prime|) (mod (* |_306| 1) |~prime|)) +(= (mod (* (* |_307| 1) (* |_307| 1)) |~prime|) (mod (* |_307| 1) |~prime|)) +(= (mod (* (* |_308| 1) (* |_308| 1)) |~prime|) (mod (* |_308| 1) |~prime|)) +(= (mod (* (* |_309| 1) (* |_309| 1)) |~prime|) (mod (* |_309| 1) |~prime|)) +(= (mod (* (* |_310| 1) (* |_310| 1)) |~prime|) (mod (* |_310| 1) |~prime|)) +(= (mod (* (* |_311| 1) (* |_311| 1)) |~prime|) (mod (* |_311| 1) |~prime|)) +(= (mod (* (* |_312| 1) (* |_312| 1)) |~prime|) (mod (* |_312| 1) |~prime|)) +(= (mod (* (* |_313| 1) (* |_313| 1)) |~prime|) (mod (* |_313| 1) |~prime|)) +(= (mod (* (* |_314| 1) (* |_314| 1)) |~prime|) (mod (* |_314| 1) |~prime|)) +(= (mod (* (* |_315| 1) (* |_315| 1)) |~prime|) (mod (* |_315| 1) |~prime|)) +(= (mod (* (* |_316| 1) (* |_316| 1)) |~prime|) (mod (* |_316| 1) |~prime|)) +(= (mod (* (* |_317| 1) (* |_317| 1)) |~prime|) (mod (* |_317| 1) |~prime|)) +(= (mod (* (* |_318| 1) (* |_318| 1)) |~prime|) (mod (* |_318| 1) |~prime|)) +(= (mod (* (* |_319| 1) (* |_319| 1)) |~prime|) (mod (* |_319| 1) |~prime|)) +(= (mod (* (* |_320| 1) (* |_320| 1)) |~prime|) (mod (* |_320| 1) |~prime|)) +(= (mod (* (* |_321| 1) (* |_321| 1)) |~prime|) (mod (* |_321| 1) |~prime|)) +(= (mod (* (* |_322| 1) (* |_322| 1)) |~prime|) (mod (* |_322| 1) |~prime|)) +(= (mod (* (* |_323| 1) (* |_323| 1)) |~prime|) (mod (* |_323| 1) |~prime|)) +(= (mod (* (* |_324| 1) (* |_324| 1)) |~prime|) (mod (* |_324| 1) |~prime|)) +(= (mod (* (* |_325| 1) (* |_325| 1)) |~prime|) (mod (* |_325| 1) |~prime|)) +(= (mod (* (* |_326| 1) (* |_326| 1)) |~prime|) (mod (* |_326| 1) |~prime|)) +(= (mod (* (* |_327| 1) (* |_327| 1)) |~prime|) (mod (* |_327| 1) |~prime|)) +(= (mod (* (* |_328| 1) (* |_328| 1)) |~prime|) (mod (* |_328| 1) |~prime|)) +(= (mod (* (* |_329| 1) (* |_329| 1)) |~prime|) (mod (* |_329| 1) |~prime|)) +(= (mod (* (* |_330| 1) (* |_330| 1)) |~prime|) (mod (* |_330| 1) |~prime|)) +(= (mod (* (* |_331| 1) (* |_331| 1)) |~prime|) (mod (* |_331| 1) |~prime|)) +(= (mod (* (* |_332| 1) (* |_332| 1)) |~prime|) (mod (* |_332| 1) |~prime|)) +(= (mod (* (* |_333| 1) (* |_333| 1)) |~prime|) (mod (* |_333| 1) |~prime|)) +(= (mod (* (* |_334| 1) (* |_334| 1)) |~prime|) (mod (* |_334| 1) |~prime|)) +(= (mod (* (* |_335| 1) (* |_335| 1)) |~prime|) (mod (* |_335| 1) |~prime|)) +(= (mod (* (* |_336| 1) (* |_336| 1)) |~prime|) (mod (* |_336| 1) |~prime|)) +(= (mod (* (* |_337| 1) (* |_337| 1)) |~prime|) (mod (* |_337| 1) |~prime|)) +(= (mod (* (* |_338| 1) (* |_338| 1)) |~prime|) (mod (* |_338| 1) |~prime|)) +(= (mod (* (* |_339| 1) (* |_339| 1)) |~prime|) (mod (* |_339| 1) |~prime|)) +(= (mod (* (* |_340| 1) (* |_340| 1)) |~prime|) (mod (* |_340| 1) |~prime|)) +(= (mod (* (* |_341| 1) (* |_341| 1)) |~prime|) (mod (* |_341| 1) |~prime|)) +(= (mod (* (* |_342| 1) (* |_342| 1)) |~prime|) (mod (* |_342| 1) |~prime|)) +(= (mod (* (* |_343| 1) (* |_343| 1)) |~prime|) (mod (* |_343| 1) |~prime|)) +(= (mod (* (* |_344| 1) (* |_344| 1)) |~prime|) (mod (* |_344| 1) |~prime|)) +(= (mod (* (* |_345| 1) (* |_345| 1)) |~prime|) (mod (* |_345| 1) |~prime|)) +(= (mod (* (* |_346| 1) (* |_346| 1)) |~prime|) (mod (* |_346| 1) |~prime|)) +(= (mod (* (* |_347| 1) (* |_347| 1)) |~prime|) (mod (* |_347| 1) |~prime|)) +(= (mod (* (* |_348| 1) (* |_348| 1)) |~prime|) (mod (* |_348| 1) |~prime|)) +(= (mod (* (* |_349| 1) (* |_349| 1)) |~prime|) (mod (* |_349| 1) |~prime|)) +(= (mod (* (* |_350| 1) (* |_350| 1)) |~prime|) (mod (* |_350| 1) |~prime|)) +(= (mod (* (* |_351| 1) (* |_351| 1)) |~prime|) (mod (* |_351| 1) |~prime|)) +(= (mod (* (* |_352| 1) (* |_352| 1)) |~prime|) (mod (* |_352| 1) |~prime|)) +(= (mod (* (* |_353| 1) (* |_353| 1)) |~prime|) (mod (* |_353| 1) |~prime|)) +(= (mod (* (* |_354| 1) (* |_354| 1)) |~prime|) (mod (* |_354| 1) |~prime|)) +(= (mod (* (* |_355| 1) (* |_355| 1)) |~prime|) (mod (* |_355| 1) |~prime|)) +(= (mod (* (* |_356| 1) (* |_356| 1)) |~prime|) (mod (* |_356| 1) |~prime|)) +(= (mod (* (* |_357| 1) (* |_357| 1)) |~prime|) (mod (* |_357| 1) |~prime|)) +(= (mod (* (* |_358| 1) (* |_358| 1)) |~prime|) (mod (* |_358| 1) |~prime|)) +(= (mod (* (* |_359| 1) (* |_359| 1)) |~prime|) (mod (* |_359| 1) |~prime|)) +(= (mod (* (* |_360| 1) (* |_360| 1)) |~prime|) (mod (* |_360| 1) |~prime|)) +(= (mod (* (* |_361| 1) (* |_361| 1)) |~prime|) (mod (* |_361| 1) |~prime|)) +(= (mod (* (* |_362| 1) (* |_362| 1)) |~prime|) (mod (* |_362| 1) |~prime|)) +(= (mod (* (* |_363| 1) (* |_363| 1)) |~prime|) (mod (* |_363| 1) |~prime|)) +(= (mod (* (* |_364| 1) (* |_364| 1)) |~prime|) (mod (* |_364| 1) |~prime|)) +(= (mod (* (* |_365| 1) (* |_365| 1)) |~prime|) (mod (* |_365| 1) |~prime|)) +(= (mod (* (* |_366| 1) (* |_366| 1)) |~prime|) (mod (* |_366| 1) |~prime|)) +(= (mod (* (* |_367| 1) (* |_367| 1)) |~prime|) (mod (* |_367| 1) |~prime|)) +(= (mod (* (* |_368| 1) (* |_368| 1)) |~prime|) (mod (* |_368| 1) |~prime|)) +(= (mod (* (* |_369| 1) (* |_369| 1)) |~prime|) (mod (* |_369| 1) |~prime|)) +(= (mod (* (* |_370| 1) (* |_370| 1)) |~prime|) (mod (* |_370| 1) |~prime|)) +(= (mod (* (* |_371| 1) (* |_371| 1)) |~prime|) (mod (* |_371| 1) |~prime|)) +(= (mod (* (* |_372| 1) (* |_372| 1)) |~prime|) (mod (* |_372| 1) |~prime|)) +(= (mod (* (* |_373| 1) (* |_373| 1)) |~prime|) (mod (* |_373| 1) |~prime|)) +(= (mod (* (* |_374| 1) (* |_374| 1)) |~prime|) (mod (* |_374| 1) |~prime|)) +(= (mod (* (* |_375| 1) (* |_375| 1)) |~prime|) (mod (* |_375| 1) |~prime|)) +(= (mod (* (* |_376| 1) (* |_376| 1)) |~prime|) (mod (* |_376| 1) |~prime|)) +(= (mod (* (* |_377| 1) (* |_377| 1)) |~prime|) (mod (* |_377| 1) |~prime|)) +(= (mod (* (* |_378| 1) (* |_378| 1)) |~prime|) (mod (* |_378| 1) |~prime|)) +(= (mod (* (* |_379| 1) (* |_379| 1)) |~prime|) (mod (* |_379| 1) |~prime|)) +(= (mod (* (* |_380| 1) (* |_380| 1)) |~prime|) (mod (* |_380| 1) |~prime|)) +(= (mod (* (* |_381| 1) (* |_381| 1)) |~prime|) (mod (* |_381| 1) |~prime|)) +(= (mod (* (* |_382| 1) (* |_382| 1)) |~prime|) (mod (* |_382| 1) |~prime|)) +(= (mod (* (* |_383| 1) (* |_383| 1)) |~prime|) (mod (* |_383| 1) |~prime|)) +(= (mod (* (* |_384| 1) (* |_384| 1)) |~prime|) (mod (* |_384| 1) |~prime|)) +(= (mod (* (* |_385| 1) (* |_385| 1)) |~prime|) (mod (* |_385| 1) |~prime|)) +(= (mod (* (* |_386| 1) (* |_386| 1)) |~prime|) (mod (* |_386| 1) |~prime|)) +(= (mod (* (* |_387| 1) (* |_387| 1)) |~prime|) (mod (* |_387| 1) |~prime|)) +(= (mod (* (* |_388| 1) (* |_388| 1)) |~prime|) (mod (* |_388| 1) |~prime|)) +(= (mod (* (* |_389| 1) (* |_389| 1)) |~prime|) (mod (* |_389| 1) |~prime|)) +(= (mod (* (* |_390| 1) (* |_390| 1)) |~prime|) (mod (* |_390| 1) |~prime|)) +(= (mod (* (* |_391| 1) (* |_391| 1)) |~prime|) (mod (* |_391| 1) |~prime|)) +(= (mod (* (* |_392| 1) (* |_392| 1)) |~prime|) (mod (* |_392| 1) |~prime|)) +(= (mod (* (* |_393| 1) (* |_393| 1)) |~prime|) (mod (* |_393| 1) |~prime|)) +(= (mod (* (* |_394| 1) (* |_394| 1)) |~prime|) (mod (* |_394| 1) |~prime|)) +(= (mod (* (* |_395| 1) (* |_395| 1)) |~prime|) (mod (* |_395| 1) |~prime|)) +(= (mod (* (* |_396| 1) (* |_396| 1)) |~prime|) (mod (* |_396| 1) |~prime|)) +(= (mod (* (* |_397| 1) (* |_397| 1)) |~prime|) (mod (* |_397| 1) |~prime|)) +(= (mod (* (* |_398| 1) (* |_398| 1)) |~prime|) (mod (* |_398| 1) |~prime|)) +(= (mod (* (* |_399| 1) (* |_399| 1)) |~prime|) (mod (* |_399| 1) |~prime|)) +(= (mod (* (* |_400| 1) (* |_400| 1)) |~prime|) (mod (* |_400| 1) |~prime|)) +(= (mod (* (* |_401| 1) (* |_401| 1)) |~prime|) (mod (* |_401| 1) |~prime|)) +(= (mod (* (* |_402| 1) (* |_402| 1)) |~prime|) (mod (* |_402| 1) |~prime|)) +(= (mod (* (* |_403| 1) (* |_403| 1)) |~prime|) (mod (* |_403| 1) |~prime|)) +(= (mod (* (* |_404| 1) (* |_404| 1)) |~prime|) (mod (* |_404| 1) |~prime|)) +(= (mod (* (* |_405| 1) (* |_405| 1)) |~prime|) (mod (* |_405| 1) |~prime|)) +(= (mod (* (* |_406| 1) (* |_406| 1)) |~prime|) (mod (* |_406| 1) |~prime|)) +(= (mod (* (* |_407| 1) (* |_407| 1)) |~prime|) (mod (* |_407| 1) |~prime|)) +(= (mod (* (* |_408| 1) (* |_408| 1)) |~prime|) (mod (* |_408| 1) |~prime|)) +(= (mod (* (* |_409| 1) (* |_409| 1)) |~prime|) (mod (* |_409| 1) |~prime|)) +(= (mod (* (* |_410| 1) (* |_410| 1)) |~prime|) (mod (* |_410| 1) |~prime|)) +(= (mod (* (* |_411| 1) (* |_411| 1)) |~prime|) (mod (* |_411| 1) |~prime|)) +(= (mod (* (* |_412| 1) (* |_412| 1)) |~prime|) (mod (* |_412| 1) |~prime|)) +(= (mod (* (* |_413| 1) (* |_413| 1)) |~prime|) (mod (* |_413| 1) |~prime|)) +(= (mod (* (* |_414| 1) (* |_414| 1)) |~prime|) (mod (* |_414| 1) |~prime|)) +(= (mod (* (* |_415| 1) (* |_415| 1)) |~prime|) (mod (* |_415| 1) |~prime|)) +(= (mod (* (* |_416| 1) (* |_416| 1)) |~prime|) (mod (* |_416| 1) |~prime|)) +(= (mod (* (* |_417| 1) (* |_417| 1)) |~prime|) (mod (* |_417| 1) |~prime|)) +(= (mod (* (* |_418| 1) (* |_418| 1)) |~prime|) (mod (* |_418| 1) |~prime|)) +(= (mod (* (* |_419| 1) (* |_419| 1)) |~prime|) (mod (* |_419| 1) |~prime|)) +(= (mod (* (* |_420| 1) (* |_420| 1)) |~prime|) (mod (* |_420| 1) |~prime|)) +(= (mod (* (* |_421| 1) (* |_421| 1)) |~prime|) (mod (* |_421| 1) |~prime|)) +(= (mod (* (* |_422| 1) (* |_422| 1)) |~prime|) (mod (* |_422| 1) |~prime|)) +(= (mod (* (* |_423| 1) (* |_423| 1)) |~prime|) (mod (* |_423| 1) |~prime|)) +(= (mod (* (* |_424| 1) (* |_424| 1)) |~prime|) (mod (* |_424| 1) |~prime|)) +(= (mod (* (* |_425| 1) (* |_425| 1)) |~prime|) (mod (* |_425| 1) |~prime|)) +(= (mod (* (* |_426| 1) (* |_426| 1)) |~prime|) (mod (* |_426| 1) |~prime|)) +(= (mod (* (* |_427| 1) (* |_427| 1)) |~prime|) (mod (* |_427| 1) |~prime|)) +(= (mod (* (* |_428| 1) (* |_428| 1)) |~prime|) (mod (* |_428| 1) |~prime|)) +(= (mod (* (* |_429| 1) (* |_429| 1)) |~prime|) (mod (* |_429| 1) |~prime|)) +(= (mod (* (* |_430| 1) (* |_430| 1)) |~prime|) (mod (* |_430| 1) |~prime|)) +(= (mod (* (* |_431| 1) (* |_431| 1)) |~prime|) (mod (* |_431| 1) |~prime|)) +(= (mod (* (* |_432| 1) (* |_432| 1)) |~prime|) (mod (* |_432| 1) |~prime|)) +(= (mod (* (* |_433| 1) (* |_433| 1)) |~prime|) (mod (* |_433| 1) |~prime|)) +(= (mod (* (* |_434| 1) (* |_434| 1)) |~prime|) (mod (* |_434| 1) |~prime|)) +(= (mod (* (* |_435| 1) (* |_435| 1)) |~prime|) (mod (* |_435| 1) |~prime|)) +(= (mod (* (* |_436| 1) (* |_436| 1)) |~prime|) (mod (* |_436| 1) |~prime|)) +(= (mod (* (* |_437| 1) (* |_437| 1)) |~prime|) (mod (* |_437| 1) |~prime|)) +(= (mod (* (* |_438| 1) (* |_438| 1)) |~prime|) (mod (* |_438| 1) |~prime|)) +(= (mod (* (* |_439| 1) (* |_439| 1)) |~prime|) (mod (* |_439| 1) |~prime|)) +(= (mod (* (* |_440| 1) (* |_440| 1)) |~prime|) (mod (* |_440| 1) |~prime|)) +(= (mod (* (* |_441| 1) (* |_441| 1)) |~prime|) (mod (* |_441| 1) |~prime|)) +(= (mod (* (* |_442| 1) (* |_442| 1)) |~prime|) (mod (* |_442| 1) |~prime|)) +(= (mod (* (* |_443| 1) (* |_443| 1)) |~prime|) (mod (* |_443| 1) |~prime|)) +(= (mod (* (* |_444| 1) (* |_444| 1)) |~prime|) (mod (* |_444| 1) |~prime|)) +(= (mod (* (* |_445| 1) (* |_445| 1)) |~prime|) (mod (* |_445| 1) |~prime|)) +(= (mod (* (* |_446| 1) (* |_446| 1)) |~prime|) (mod (* |_446| 1) |~prime|)) +(= (mod (* (* |_447| 1) (* |_447| 1)) |~prime|) (mod (* |_447| 1) |~prime|)) +(= (mod (* (* |_448| 1) (* |_448| 1)) |~prime|) (mod (* |_448| 1) |~prime|)) +(= (mod (* (* |_449| 1) (* |_449| 1)) |~prime|) (mod (* |_449| 1) |~prime|)) +(= (mod (* (* |_450| 1) (* |_450| 1)) |~prime|) (mod (* |_450| 1) |~prime|)) +(= (mod (* (* |_451| 1) (* |_451| 1)) |~prime|) (mod (* |_451| 1) |~prime|)) +(= (mod (* (* |_452| 1) (* |_452| 1)) |~prime|) (mod (* |_452| 1) |~prime|)) +(= (mod (* (* |_453| 1) (* |_453| 1)) |~prime|) (mod (* |_453| 1) |~prime|)) +(= (mod (* (* |_454| 1) (* |_454| 1)) |~prime|) (mod (* |_454| 1) |~prime|)) +(= (mod (* (* |_455| 1) (* |_455| 1)) |~prime|) (mod (* |_455| 1) |~prime|)) +(= (mod (* (* |_456| 1) (* |_456| 1)) |~prime|) (mod (* |_456| 1) |~prime|)) +(= (mod (* (* |_457| 1) (* |_457| 1)) |~prime|) (mod (* |_457| 1) |~prime|)) +(= (mod (* (* |_458| 1) (* |_458| 1)) |~prime|) (mod (* |_458| 1) |~prime|)) +(= (mod (* (* |_459| 1) (* |_459| 1)) |~prime|) (mod (* |_459| 1) |~prime|)) +(= (mod (* (* |_460| 1) (* |_460| 1)) |~prime|) (mod (* |_460| 1) |~prime|)) +(= (mod (* (* |_461| 1) (* |_461| 1)) |~prime|) (mod (* |_461| 1) |~prime|)) +(= (mod (* (* |_462| 1) (* |_462| 1)) |~prime|) (mod (* |_462| 1) |~prime|)) +(= (mod (* (* |_463| 1) (* |_463| 1)) |~prime|) (mod (* |_463| 1) |~prime|)) +(= (mod (* (* |_464| 1) (* |_464| 1)) |~prime|) (mod (* |_464| 1) |~prime|)) +(= (mod (* (* |_465| 1) (* |_465| 1)) |~prime|) (mod (* |_465| 1) |~prime|)) +(= (mod (* (* |_466| 1) (* |_466| 1)) |~prime|) (mod (* |_466| 1) |~prime|)) +(= (mod (* (* |_467| 1) (* |_467| 1)) |~prime|) (mod (* |_467| 1) |~prime|)) +(= (mod (* (* |_468| 1) (* |_468| 1)) |~prime|) (mod (* |_468| 1) |~prime|)) +(= (mod (* (* |_469| 1) (* |_469| 1)) |~prime|) (mod (* |_469| 1) |~prime|)) +(= (mod (* (* |_470| 1) (* |_470| 1)) |~prime|) (mod (* |_470| 1) |~prime|)) +(= (mod (* (* |_471| 1) (* |_471| 1)) |~prime|) (mod (* |_471| 1) |~prime|)) +(= (mod (* (* |_472| 1) (* |_472| 1)) |~prime|) (mod (* |_472| 1) |~prime|)) +(= (mod (* (* |_473| 1) (* |_473| 1)) |~prime|) (mod (* |_473| 1) |~prime|)) +(= (mod (* (* |_474| 1) (* |_474| 1)) |~prime|) (mod (* |_474| 1) |~prime|)) +(= (mod (* (* |_475| 1) (* |_475| 1)) |~prime|) (mod (* |_475| 1) |~prime|)) +(= (mod (* (* |_476| 1) (* |_476| 1)) |~prime|) (mod (* |_476| 1) |~prime|)) +(= (mod (* (* |_477| 1) (* |_477| 1)) |~prime|) (mod (* |_477| 1) |~prime|)) +(= (mod (* (* |_478| 1) (* |_478| 1)) |~prime|) (mod (* |_478| 1) |~prime|)) +(= (mod (* (* |_479| 1) (* |_479| 1)) |~prime|) (mod (* |_479| 1) |~prime|)) +(= (mod (* (* |_480| 1) (* |_480| 1)) |~prime|) (mod (* |_480| 1) |~prime|)) +(= (mod (* (* |_481| 1) (* |_481| 1)) |~prime|) (mod (* |_481| 1) |~prime|)) +(= (mod (* (* |_482| 1) (* |_482| 1)) |~prime|) (mod (* |_482| 1) |~prime|)) +(= (mod (* (* |_483| 1) (* |_483| 1)) |~prime|) (mod (* |_483| 1) |~prime|)) +(= (mod (* (* |_484| 1) (* |_484| 1)) |~prime|) (mod (* |_484| 1) |~prime|)) +(= (mod (* (* |_485| 1) (* |_485| 1)) |~prime|) (mod (* |_485| 1) |~prime|)) +(= (mod (* (* |_486| 1) (* |_486| 1)) |~prime|) (mod (* |_486| 1) |~prime|)) +(= (mod (* (* |_487| 1) (* |_487| 1)) |~prime|) (mod (* |_487| 1) |~prime|)) +(= (mod (* (* |_488| 1) (* |_488| 1)) |~prime|) (mod (* |_488| 1) |~prime|)) +(= (mod (* (* |_489| 1) (* |_489| 1)) |~prime|) (mod (* |_489| 1) |~prime|)) +(= (mod (* (* |_490| 1) (* |_490| 1)) |~prime|) (mod (* |_490| 1) |~prime|)) +(= (mod (* (* |_491| 1) (* |_491| 1)) |~prime|) (mod (* |_491| 1) |~prime|)) +(= (mod (* (* |_492| 1) (* |_492| 1)) |~prime|) (mod (* |_492| 1) |~prime|)) +(= (mod (* (* |_493| 1) (* |_493| 1)) |~prime|) (mod (* |_493| 1) |~prime|)) +(= (mod (* (* |_494| 1) (* |_494| 1)) |~prime|) (mod (* |_494| 1) |~prime|)) +(= (mod (* (* |_495| 1) (* |_495| 1)) |~prime|) (mod (* |_495| 1) |~prime|)) +(= (mod (* (* |_496| 1) (* |_496| 1)) |~prime|) (mod (* |_496| 1) |~prime|)) +(= (mod (* (* |_497| 1) (* |_497| 1)) |~prime|) (mod (* |_497| 1) |~prime|)) +(= (mod (* (* |_498| 1) (* |_498| 1)) |~prime|) (mod (* |_498| 1) |~prime|)) +(= (mod (* (* |_499| 1) (* |_499| 1)) |~prime|) (mod (* |_499| 1) |~prime|)) +(= (mod (* (* |_500| 1) (* |_500| 1)) |~prime|) (mod (* |_500| 1) |~prime|)) +(= (mod (* (* |_501| 1) (* |_501| 1)) |~prime|) (mod (* |_501| 1) |~prime|)) +(= (mod (* (* |_502| 1) (* |_502| 1)) |~prime|) (mod (* |_502| 1) |~prime|)) +(= (mod (* (* |_503| 1) (* |_503| 1)) |~prime|) (mod (* |_503| 1) |~prime|)) +(= (mod (* (* |_504| 1) (* |_504| 1)) |~prime|) (mod (* |_504| 1) |~prime|)) +(= (mod (* (* |_505| 1) (* |_505| 1)) |~prime|) (mod (* |_505| 1) |~prime|)) +(= (mod (* (* |_506| 1) (* |_506| 1)) |~prime|) (mod (* |_506| 1) |~prime|)) +(= (mod (* (* |_507| 1) (* |_507| 1)) |~prime|) (mod (* |_507| 1) |~prime|)) +(= (mod (* (* |_508| 1) (* |_508| 1)) |~prime|) (mod (* |_508| 1) |~prime|)) +(= (mod (* (* |_509| 1) (* |_509| 1)) |~prime|) (mod (* |_509| 1) |~prime|)) +(= (mod (* (* |_510| 1) (* |_510| 1)) |~prime|) (mod (* |_510| 1) |~prime|)) +(= (mod (* (* |~one| 1) (+ (* |_259| 3618502788666131106986593281521497120414687020801267626233049500247285301248) (* |_260| 1809251394333065553493296640760748560207343510400633813116524750123642650624) (* |_261| 904625697166532776746648320380374280103671755200316906558262375061821325312) (* |_262| 452312848583266388373324160190187140051835877600158453279131187530910662656) (* |_263| 226156424291633194186662080095093570025917938800079226639565593765455331328) (* |_264| 113078212145816597093331040047546785012958969400039613319782796882727665664) (* |_265| 56539106072908298546665520023773392506479484700019806659891398441363832832) (* |_266| 28269553036454149273332760011886696253239742350009903329945699220681916416) (* |_267| 14134776518227074636666380005943348126619871175004951664972849610340958208) (* |_268| 7067388259113537318333190002971674063309935587502475832486424805170479104) (* |_269| 3533694129556768659166595001485837031654967793751237916243212402585239552) (* |_270| 1766847064778384329583297500742918515827483896875618958121606201292619776) (* |_271| 883423532389192164791648750371459257913741948437809479060803100646309888) (* |_272| 441711766194596082395824375185729628956870974218904739530401550323154944) (* |_273| 220855883097298041197912187592864814478435487109452369765200775161577472) (* |_274| 110427941548649020598956093796432407239217743554726184882600387580788736) (* |_275| 55213970774324510299478046898216203619608871777363092441300193790394368) (* |_276| 27606985387162255149739023449108101809804435888681546220650096895197184) (* |_277| 13803492693581127574869511724554050904902217944340773110325048447598592) (* |_278| 6901746346790563787434755862277025452451108972170386555162524223799296) (* |_279| 3450873173395281893717377931138512726225554486085193277581262111899648) (* |_280| 1725436586697640946858688965569256363112777243042596638790631055949824) (* |_281| 862718293348820473429344482784628181556388621521298319395315527974912) (* |_282| 431359146674410236714672241392314090778194310760649159697657763987456) (* |_283| 215679573337205118357336120696157045389097155380324579848828881993728) (* |_284| 107839786668602559178668060348078522694548577690162289924414440996864) (* |_285| 53919893334301279589334030174039261347274288845081144962207220498432) (* |_286| 26959946667150639794667015087019630673637144422540572481103610249216) (* |_287| 13479973333575319897333507543509815336818572211270286240551805124608) (* |_288| 6739986666787659948666753771754907668409286105635143120275902562304) (* |_289| 3369993333393829974333376885877453834204643052817571560137951281152) (* |_290| 1684996666696914987166688442938726917102321526408785780068975640576) (* |_291| 842498333348457493583344221469363458551160763204392890034487820288) (* |_292| 421249166674228746791672110734681729275580381602196445017243910144) (* |_293| 210624583337114373395836055367340864637790190801098222508621955072) (* |_294| 105312291668557186697918027683670432318895095400549111254310977536) (* |_295| 52656145834278593348959013841835216159447547700274555627155488768) (* |_296| 26328072917139296674479506920917608079723773850137277813577744384) (* |_297| 13164036458569648337239753460458804039861886925068638906788872192) (* |_298| 6582018229284824168619876730229402019930943462534319453394436096) (* |_299| 3291009114642412084309938365114701009965471731267159726697218048) (* |_300| 1645504557321206042154969182557350504982735865633579863348609024) (* |_301| 822752278660603021077484591278675252491367932816789931674304512) (* |_302| 411376139330301510538742295639337626245683966408394965837152256) (* |_303| 205688069665150755269371147819668813122841983204197482918576128) (* |_304| 102844034832575377634685573909834406561420991602098741459288064) (* |_305| 51422017416287688817342786954917203280710495801049370729644032) (* |_306| 25711008708143844408671393477458601640355247900524685364822016) (* |_307| 12855504354071922204335696738729300820177623950262342682411008) (* |_308| 6427752177035961102167848369364650410088811975131171341205504) (* |_309| 3213876088517980551083924184682325205044405987565585670602752) (* |_310| 1606938044258990275541962092341162602522202993782792835301376) (* |_311| 803469022129495137770981046170581301261101496891396417650688) (* |_312| 401734511064747568885490523085290650630550748445698208825344) (* |_313| 200867255532373784442745261542645325315275374222849104412672) (* |_314| 100433627766186892221372630771322662657637687111424552206336) (* |_315| 50216813883093446110686315385661331328818843555712276103168) (* |_316| 25108406941546723055343157692830665664409421777856138051584) (* |_317| 12554203470773361527671578846415332832204710888928069025792) (* |_318| 6277101735386680763835789423207666416102355444464034512896) (* |_319| 3138550867693340381917894711603833208051177722232017256448) (* |_320| 1569275433846670190958947355801916604025588861116008628224) (* |_321| 784637716923335095479473677900958302012794430558004314112) (* |_322| 392318858461667547739736838950479151006397215279002157056) (* |_323| 196159429230833773869868419475239575503198607639501078528) (* |_324| 98079714615416886934934209737619787751599303819750539264) (* |_325| 49039857307708443467467104868809893875799651909875269632) (* |_326| 24519928653854221733733552434404946937899825954937634816) (* |_327| 12259964326927110866866776217202473468949912977468817408) (* |_328| 6129982163463555433433388108601236734474956488734408704) (* |_329| 3064991081731777716716694054300618367237478244367204352) (* |_330| 1532495540865888858358347027150309183618739122183602176) (* |_331| 766247770432944429179173513575154591809369561091801088) (* |_332| 383123885216472214589586756787577295904684780545900544) (* |_333| 191561942608236107294793378393788647952342390272950272) (* |_334| 95780971304118053647396689196894323976171195136475136) (* |_335| 47890485652059026823698344598447161988085597568237568) (* |_336| 23945242826029513411849172299223580994042798784118784) (* |_337| 11972621413014756705924586149611790497021399392059392) (* |_338| 5986310706507378352962293074805895248510699696029696) (* |_339| 2993155353253689176481146537402947624255349848014848) (* |_340| 1496577676626844588240573268701473812127674924007424) (* |_341| 748288838313422294120286634350736906063837462003712) (* |_342| 374144419156711147060143317175368453031918731001856) (* |_343| 187072209578355573530071658587684226515959365500928) (* |_344| 93536104789177786765035829293842113257979682750464) (* |_345| 46768052394588893382517914646921056628989841375232) (* |_346| 23384026197294446691258957323460528314494920687616) (* |_347| 11692013098647223345629478661730264157247460343808) (* |_348| 5846006549323611672814739330865132078623730171904) (* |_349| 2923003274661805836407369665432566039311865085952) (* |_350| 1461501637330902918203684832716283019655932542976) (* |_351| 730750818665451459101842416358141509827966271488) (* |_352| 365375409332725729550921208179070754913983135744) (* |_353| 182687704666362864775460604089535377456991567872) (* |_354| 91343852333181432387730302044767688728495783936) (* |_355| 45671926166590716193865151022383844364247891968) (* |_356| 22835963083295358096932575511191922182123945984) (* |_357| 11417981541647679048466287755595961091061972992) (* |_358| 5708990770823839524233143877797980545530986496) (* |_359| 2854495385411919762116571938898990272765493248) (* |_360| 1427247692705959881058285969449495136382746624) (* |_361| 713623846352979940529142984724747568191373312) (* |_362| 356811923176489970264571492362373784095686656) (* |_363| 178405961588244985132285746181186892047843328) (* |_364| 89202980794122492566142873090593446023921664) (* |_365| 44601490397061246283071436545296723011960832) (* |_366| 22300745198530623141535718272648361505980416) (* |_367| 11150372599265311570767859136324180752990208) (* |_368| 5575186299632655785383929568162090376495104) (* |_369| 2787593149816327892691964784081045188247552) (* |_370| 1393796574908163946345982392040522594123776) (* |_371| 696898287454081973172991196020261297061888) (* |_372| 348449143727040986586495598010130648530944) (* |_373| 174224571863520493293247799005065324265472) (* |_374| 87112285931760246646623899502532662132736) (* |_375| 43556142965880123323311949751266331066368) (* |_376| 21778071482940061661655974875633165533184) (* |_377| 10889035741470030830827987437816582766592) (* |_378| 5444517870735015415413993718908291383296) (* |_379| 2722258935367507707706996859454145691648) (* |_380| 1361129467683753853853498429727072845824) (* |_381| 680564733841876926926749214863536422912) (* |_382| 340282366920938463463374607431768211456) (* |_383| 170141183460469231731687303715884105728) (* |_384| 85070591730234615865843651857942052864) (* |_385| 42535295865117307932921825928971026432) (* |_386| 21267647932558653966460912964485513216) (* |_387| 10633823966279326983230456482242756608) (* |_388| 5316911983139663491615228241121378304) (* |_389| 2658455991569831745807614120560689152) (* |_390| 1329227995784915872903807060280344576) (* |_391| 664613997892457936451903530140172288) (* |_392| 332306998946228968225951765070086144) (* |_393| 166153499473114484112975882535043072) (* |_394| 83076749736557242056487941267521536) (* |_395| 41538374868278621028243970633760768) (* |_396| 20769187434139310514121985316880384) (* |_397| 10384593717069655257060992658440192) (* |_398| 5192296858534827628530496329220096) (* |_399| 2596148429267413814265248164610048) (* |_400| 1298074214633706907132624082305024) (* |_401| 649037107316853453566312041152512) (* |_402| 324518553658426726783156020576256) (* |_403| 162259276829213363391578010288128) (* |_404| 81129638414606681695789005144064) (* |_405| 40564819207303340847894502572032) (* |_406| 20282409603651670423947251286016) (* |_407| 10141204801825835211973625643008) (* |_408| 5070602400912917605986812821504) (* |_409| 2535301200456458802993406410752) (* |_410| 1267650600228229401496703205376) (* |_411| 633825300114114700748351602688) (* |_412| 316912650057057350374175801344) (* |_413| 158456325028528675187087900672) (* |_414| 79228162514264337593543950336) (* |_415| 39614081257132168796771975168) (* |_416| 19807040628566084398385987584) (* |_417| 9903520314283042199192993792) (* |_418| 4951760157141521099596496896) (* |_419| 2475880078570760549798248448) (* |_420| 1237940039285380274899124224) (* |_421| 618970019642690137449562112) (* |_422| 309485009821345068724781056) (* |_423| 154742504910672534362390528) (* |_424| 77371252455336267181195264) (* |_425| 38685626227668133590597632) (* |_426| 19342813113834066795298816) (* |_427| 9671406556917033397649408) (* |_428| 4835703278458516698824704) (* |_429| 2417851639229258349412352) (* |_430| 1208925819614629174706176) (* |_431| 604462909807314587353088) (* |_432| 302231454903657293676544) (* |_433| 151115727451828646838272) (* |_434| 75557863725914323419136) (* |_435| 37778931862957161709568) (* |_436| 18889465931478580854784) (* |_437| 9444732965739290427392) (* |_438| 4722366482869645213696) (* |_439| 2361183241434822606848) (* |_440| 1180591620717411303424) (* |_441| 590295810358705651712) (* |_442| 295147905179352825856) (* |_443| 147573952589676412928) (* |_444| 73786976294838206464) (* |_445| 36893488147419103232) (* |_446| 18446744073709551616) (* |_447| 9223372036854775808) (* |_448| 4611686018427387904) (* |_449| 2305843009213693952) (* |_450| 1152921504606846976) (* |_451| 576460752303423488) (* |_452| 288230376151711744) (* |_453| 144115188075855872) (* |_454| 72057594037927936) (* |_455| 36028797018963968) (* |_456| 18014398509481984) (* |_457| 9007199254740992) (* |_458| 4503599627370496) (* |_459| 2251799813685248) (* |_460| 1125899906842624) (* |_461| 562949953421312) (* |_462| 281474976710656) (* |_463| 140737488355328) (* |_464| 70368744177664) (* |_465| 35184372088832) (* |_466| 17592186044416) (* |_467| 8796093022208) (* |_468| 4398046511104) (* |_469| 2199023255552) (* |_470| 1099511627776) (* |_471| 549755813888) (* |_472| 274877906944) (* |_473| 137438953472) (* |_474| 68719476736) (* |_475| 34359738368) (* |_476| 17179869184) (* |_477| 8589934592) (* |_478| 4294967296) (* |_479| 2147483648) (* |_480| 1073741824) (* |_481| 536870912) (* |_482| 268435456) (* |_483| 134217728) (* |_484| 67108864) (* |_485| 33554432) (* |_486| 16777216) (* |_487| 8388608) (* |_488| 4194304) (* |_489| 2097152) (* |_490| 1048576) (* |_491| 524288) (* |_492| 262144) (* |_493| 131072) (* |_494| 65536) (* |_495| 32768) (* |_496| 16384) (* |_497| 8192) (* |_498| 4096) (* |_499| 2048) (* |_500| 1024) (* |_501| 512) (* |_502| 256) (* |_503| 128) (* |_504| 64) (* |_505| 32) (* |_506| 16) (* |_507| 8) (* |_508| 4) (* |_509| 2) (* |_510| 1))) |~prime|) (mod (* |_1| 1) |~prime|)) + +(= (mod (* (* |_511| 1) (* |_511| 1)) |~prime|) (mod (* |_511| 1) |~prime|)) +(= (mod (* (* |_512| 1) (* |_512| 1)) |~prime|) (mod (* |_512| 1) |~prime|)) +(= (mod (* (* |_513| 1) (* |_513| 1)) |~prime|) (mod (* |_513| 1) |~prime|)) +(= (mod (* (* |_514| 1) (* |_514| 1)) |~prime|) (mod (* |_514| 1) |~prime|)) +(= (mod (* (* |_515| 1) (* |_515| 1)) |~prime|) (mod (* |_515| 1) |~prime|)) +(= (mod (* (* |_516| 1) (* |_516| 1)) |~prime|) (mod (* |_516| 1) |~prime|)) +(= (mod (* (* |_517| 1) (* |_517| 1)) |~prime|) (mod (* |_517| 1) |~prime|)) +(= (mod (* (* |_518| 1) (* |_518| 1)) |~prime|) (mod (* |_518| 1) |~prime|)) +(= (mod (* (* |_519| 1) (* |_519| 1)) |~prime|) (mod (* |_519| 1) |~prime|)) +(= (mod (* (* |_520| 1) (* |_520| 1)) |~prime|) (mod (* |_520| 1) |~prime|)) +(= (mod (* (* |_521| 1) (* |_521| 1)) |~prime|) (mod (* |_521| 1) |~prime|)) +(= (mod (* (* |_522| 1) (* |_522| 1)) |~prime|) (mod (* |_522| 1) |~prime|)) +(= (mod (* (* |_523| 1) (* |_523| 1)) |~prime|) (mod (* |_523| 1) |~prime|)) +(= (mod (* (* |_524| 1) (* |_524| 1)) |~prime|) (mod (* |_524| 1) |~prime|)) +(= (mod (* (* |_525| 1) (* |_525| 1)) |~prime|) (mod (* |_525| 1) |~prime|)) +(= (mod (* (* |_526| 1) (* |_526| 1)) |~prime|) (mod (* |_526| 1) |~prime|)) +(= (mod (* (* |_527| 1) (* |_527| 1)) |~prime|) (mod (* |_527| 1) |~prime|)) +(= (mod (* (* |_528| 1) (* |_528| 1)) |~prime|) (mod (* |_528| 1) |~prime|)) +(= (mod (* (* |_529| 1) (* |_529| 1)) |~prime|) (mod (* |_529| 1) |~prime|)) +(= (mod (* (* |_530| 1) (* |_530| 1)) |~prime|) (mod (* |_530| 1) |~prime|)) +(= (mod (* (* |_531| 1) (* |_531| 1)) |~prime|) (mod (* |_531| 1) |~prime|)) +(= (mod (* (* |_532| 1) (* |_532| 1)) |~prime|) (mod (* |_532| 1) |~prime|)) +(= (mod (* (* |_533| 1) (* |_533| 1)) |~prime|) (mod (* |_533| 1) |~prime|)) +(= (mod (* (* |_534| 1) (* |_534| 1)) |~prime|) (mod (* |_534| 1) |~prime|)) +(= (mod (* (* |_535| 1) (* |_535| 1)) |~prime|) (mod (* |_535| 1) |~prime|)) +(= (mod (* (* |_536| 1) (* |_536| 1)) |~prime|) (mod (* |_536| 1) |~prime|)) +(= (mod (* (* |_537| 1) (* |_537| 1)) |~prime|) (mod (* |_537| 1) |~prime|)) +(= (mod (* (* |_538| 1) (* |_538| 1)) |~prime|) (mod (* |_538| 1) |~prime|)) +(= (mod (* (* |_539| 1) (* |_539| 1)) |~prime|) (mod (* |_539| 1) |~prime|)) +(= (mod (* (* |_540| 1) (* |_540| 1)) |~prime|) (mod (* |_540| 1) |~prime|)) +(= (mod (* (* |_541| 1) (* |_541| 1)) |~prime|) (mod (* |_541| 1) |~prime|)) +(= (mod (* (* |_542| 1) (* |_542| 1)) |~prime|) (mod (* |_542| 1) |~prime|)) +(= (mod (* (* |_543| 1) (* |_543| 1)) |~prime|) (mod (* |_543| 1) |~prime|)) +(= (mod (* (* |_544| 1) (* |_544| 1)) |~prime|) (mod (* |_544| 1) |~prime|)) +(= (mod (* (* |_545| 1) (* |_545| 1)) |~prime|) (mod (* |_545| 1) |~prime|)) +(= (mod (* (* |_546| 1) (* |_546| 1)) |~prime|) (mod (* |_546| 1) |~prime|)) +(= (mod (* (* |_547| 1) (* |_547| 1)) |~prime|) (mod (* |_547| 1) |~prime|)) +(= (mod (* (* |_548| 1) (* |_548| 1)) |~prime|) (mod (* |_548| 1) |~prime|)) +(= (mod (* (* |_549| 1) (* |_549| 1)) |~prime|) (mod (* |_549| 1) |~prime|)) +(= (mod (* (* |_550| 1) (* |_550| 1)) |~prime|) (mod (* |_550| 1) |~prime|)) +(= (mod (* (* |_551| 1) (* |_551| 1)) |~prime|) (mod (* |_551| 1) |~prime|)) +(= (mod (* (* |_552| 1) (* |_552| 1)) |~prime|) (mod (* |_552| 1) |~prime|)) +(= (mod (* (* |_553| 1) (* |_553| 1)) |~prime|) (mod (* |_553| 1) |~prime|)) +(= (mod (* (* |_554| 1) (* |_554| 1)) |~prime|) (mod (* |_554| 1) |~prime|)) +(= (mod (* (* |_555| 1) (* |_555| 1)) |~prime|) (mod (* |_555| 1) |~prime|)) +(= (mod (* (* |_556| 1) (* |_556| 1)) |~prime|) (mod (* |_556| 1) |~prime|)) +(= (mod (* (* |_557| 1) (* |_557| 1)) |~prime|) (mod (* |_557| 1) |~prime|)) +(= (mod (* (* |_558| 1) (* |_558| 1)) |~prime|) (mod (* |_558| 1) |~prime|)) +(= (mod (* (* |_559| 1) (* |_559| 1)) |~prime|) (mod (* |_559| 1) |~prime|)) +(= (mod (* (* |_560| 1) (* |_560| 1)) |~prime|) (mod (* |_560| 1) |~prime|)) +(= (mod (* (* |_561| 1) (* |_561| 1)) |~prime|) (mod (* |_561| 1) |~prime|)) +(= (mod (* (* |_562| 1) (* |_562| 1)) |~prime|) (mod (* |_562| 1) |~prime|)) +(= (mod (* (* |_563| 1) (* |_563| 1)) |~prime|) (mod (* |_563| 1) |~prime|)) +(= (mod (* (* |_564| 1) (* |_564| 1)) |~prime|) (mod (* |_564| 1) |~prime|)) +(= (mod (* (* |_565| 1) (* |_565| 1)) |~prime|) (mod (* |_565| 1) |~prime|)) +(= (mod (* (* |_566| 1) (* |_566| 1)) |~prime|) (mod (* |_566| 1) |~prime|)) +(= (mod (* (* |_567| 1) (* |_567| 1)) |~prime|) (mod (* |_567| 1) |~prime|)) +(= (mod (* (* |_568| 1) (* |_568| 1)) |~prime|) (mod (* |_568| 1) |~prime|)) +(= (mod (* (* |_569| 1) (* |_569| 1)) |~prime|) (mod (* |_569| 1) |~prime|)) +(= (mod (* (* |_570| 1) (* |_570| 1)) |~prime|) (mod (* |_570| 1) |~prime|)) +(= (mod (* (* |_571| 1) (* |_571| 1)) |~prime|) (mod (* |_571| 1) |~prime|)) +(= (mod (* (* |_572| 1) (* |_572| 1)) |~prime|) (mod (* |_572| 1) |~prime|)) +(= (mod (* (* |_573| 1) (* |_573| 1)) |~prime|) (mod (* |_573| 1) |~prime|)) +(= (mod (* (* |_574| 1) (* |_574| 1)) |~prime|) (mod (* |_574| 1) |~prime|)) +(= (mod (* (* |_575| 1) (* |_575| 1)) |~prime|) (mod (* |_575| 1) |~prime|)) +(= (mod (* (* |_576| 1) (* |_576| 1)) |~prime|) (mod (* |_576| 1) |~prime|)) +(= (mod (* (* |_577| 1) (* |_577| 1)) |~prime|) (mod (* |_577| 1) |~prime|)) +(= (mod (* (* |_578| 1) (* |_578| 1)) |~prime|) (mod (* |_578| 1) |~prime|)) +(= (mod (* (* |_579| 1) (* |_579| 1)) |~prime|) (mod (* |_579| 1) |~prime|)) +(= (mod (* (* |_580| 1) (* |_580| 1)) |~prime|) (mod (* |_580| 1) |~prime|)) +(= (mod (* (* |_581| 1) (* |_581| 1)) |~prime|) (mod (* |_581| 1) |~prime|)) +(= (mod (* (* |_582| 1) (* |_582| 1)) |~prime|) (mod (* |_582| 1) |~prime|)) +(= (mod (* (* |_583| 1) (* |_583| 1)) |~prime|) (mod (* |_583| 1) |~prime|)) +(= (mod (* (* |_584| 1) (* |_584| 1)) |~prime|) (mod (* |_584| 1) |~prime|)) +(= (mod (* (* |_585| 1) (* |_585| 1)) |~prime|) (mod (* |_585| 1) |~prime|)) +(= (mod (* (* |_586| 1) (* |_586| 1)) |~prime|) (mod (* |_586| 1) |~prime|)) +(= (mod (* (* |_587| 1) (* |_587| 1)) |~prime|) (mod (* |_587| 1) |~prime|)) +(= (mod (* (* |_588| 1) (* |_588| 1)) |~prime|) (mod (* |_588| 1) |~prime|)) +(= (mod (* (* |_589| 1) (* |_589| 1)) |~prime|) (mod (* |_589| 1) |~prime|)) +(= (mod (* (* |_590| 1) (* |_590| 1)) |~prime|) (mod (* |_590| 1) |~prime|)) +(= (mod (* (* |_591| 1) (* |_591| 1)) |~prime|) (mod (* |_591| 1) |~prime|)) +(= (mod (* (* |_592| 1) (* |_592| 1)) |~prime|) (mod (* |_592| 1) |~prime|)) +(= (mod (* (* |_593| 1) (* |_593| 1)) |~prime|) (mod (* |_593| 1) |~prime|)) +(= (mod (* (* |_594| 1) (* |_594| 1)) |~prime|) (mod (* |_594| 1) |~prime|)) +(= (mod (* (* |_595| 1) (* |_595| 1)) |~prime|) (mod (* |_595| 1) |~prime|)) +(= (mod (* (* |_596| 1) (* |_596| 1)) |~prime|) (mod (* |_596| 1) |~prime|)) +(= (mod (* (* |_597| 1) (* |_597| 1)) |~prime|) (mod (* |_597| 1) |~prime|)) +(= (mod (* (* |_598| 1) (* |_598| 1)) |~prime|) (mod (* |_598| 1) |~prime|)) +(= (mod (* (* |_599| 1) (* |_599| 1)) |~prime|) (mod (* |_599| 1) |~prime|)) +(= (mod (* (* |_600| 1) (* |_600| 1)) |~prime|) (mod (* |_600| 1) |~prime|)) +(= (mod (* (* |_601| 1) (* |_601| 1)) |~prime|) (mod (* |_601| 1) |~prime|)) +(= (mod (* (* |_602| 1) (* |_602| 1)) |~prime|) (mod (* |_602| 1) |~prime|)) +(= (mod (* (* |_603| 1) (* |_603| 1)) |~prime|) (mod (* |_603| 1) |~prime|)) +(= (mod (* (* |_604| 1) (* |_604| 1)) |~prime|) (mod (* |_604| 1) |~prime|)) +(= (mod (* (* |_605| 1) (* |_605| 1)) |~prime|) (mod (* |_605| 1) |~prime|)) +(= (mod (* (* |_606| 1) (* |_606| 1)) |~prime|) (mod (* |_606| 1) |~prime|)) +(= (mod (* (* |_607| 1) (* |_607| 1)) |~prime|) (mod (* |_607| 1) |~prime|)) +(= (mod (* (* |_608| 1) (* |_608| 1)) |~prime|) (mod (* |_608| 1) |~prime|)) +(= (mod (* (* |_609| 1) (* |_609| 1)) |~prime|) (mod (* |_609| 1) |~prime|)) +(= (mod (* (* |_610| 1) (* |_610| 1)) |~prime|) (mod (* |_610| 1) |~prime|)) +(= (mod (* (* |_611| 1) (* |_611| 1)) |~prime|) (mod (* |_611| 1) |~prime|)) +(= (mod (* (* |_612| 1) (* |_612| 1)) |~prime|) (mod (* |_612| 1) |~prime|)) +(= (mod (* (* |_613| 1) (* |_613| 1)) |~prime|) (mod (* |_613| 1) |~prime|)) +(= (mod (* (* |_614| 1) (* |_614| 1)) |~prime|) (mod (* |_614| 1) |~prime|)) +(= (mod (* (* |_615| 1) (* |_615| 1)) |~prime|) (mod (* |_615| 1) |~prime|)) +(= (mod (* (* |_616| 1) (* |_616| 1)) |~prime|) (mod (* |_616| 1) |~prime|)) +(= (mod (* (* |_617| 1) (* |_617| 1)) |~prime|) (mod (* |_617| 1) |~prime|)) +(= (mod (* (* |_618| 1) (* |_618| 1)) |~prime|) (mod (* |_618| 1) |~prime|)) +(= (mod (* (* |_619| 1) (* |_619| 1)) |~prime|) (mod (* |_619| 1) |~prime|)) +(= (mod (* (* |_620| 1) (* |_620| 1)) |~prime|) (mod (* |_620| 1) |~prime|)) +(= (mod (* (* |_621| 1) (* |_621| 1)) |~prime|) (mod (* |_621| 1) |~prime|)) +(= (mod (* (* |_622| 1) (* |_622| 1)) |~prime|) (mod (* |_622| 1) |~prime|)) +(= (mod (* (* |_623| 1) (* |_623| 1)) |~prime|) (mod (* |_623| 1) |~prime|)) +(= (mod (* (* |_624| 1) (* |_624| 1)) |~prime|) (mod (* |_624| 1) |~prime|)) +(= (mod (* (* |_625| 1) (* |_625| 1)) |~prime|) (mod (* |_625| 1) |~prime|)) +(= (mod (* (* |_626| 1) (* |_626| 1)) |~prime|) (mod (* |_626| 1) |~prime|)) +(= (mod (* (* |_627| 1) (* |_627| 1)) |~prime|) (mod (* |_627| 1) |~prime|)) +(= (mod (* (* |_628| 1) (* |_628| 1)) |~prime|) (mod (* |_628| 1) |~prime|)) +(= (mod (* (* |_629| 1) (* |_629| 1)) |~prime|) (mod (* |_629| 1) |~prime|)) +(= (mod (* (* |_630| 1) (* |_630| 1)) |~prime|) (mod (* |_630| 1) |~prime|)) +(= (mod (* (* |_631| 1) (* |_631| 1)) |~prime|) (mod (* |_631| 1) |~prime|)) +(= (mod (* (* |_632| 1) (* |_632| 1)) |~prime|) (mod (* |_632| 1) |~prime|)) +(= (mod (* (* |_633| 1) (* |_633| 1)) |~prime|) (mod (* |_633| 1) |~prime|)) +(= (mod (* (* |_634| 1) (* |_634| 1)) |~prime|) (mod (* |_634| 1) |~prime|)) +(= (mod (* (* |_635| 1) (* |_635| 1)) |~prime|) (mod (* |_635| 1) |~prime|)) +(= (mod (* (* |_636| 1) (* |_636| 1)) |~prime|) (mod (* |_636| 1) |~prime|)) +(= (mod (* (* |_637| 1) (* |_637| 1)) |~prime|) (mod (* |_637| 1) |~prime|)) +(= (mod (* (* |_638| 1) (* |_638| 1)) |~prime|) (mod (* |_638| 1) |~prime|)) +(= (mod (* (* |_639| 1) (* |_639| 1)) |~prime|) (mod (* |_639| 1) |~prime|)) +(= (mod (* (* |_640| 1) (* |_640| 1)) |~prime|) (mod (* |_640| 1) |~prime|)) +(= (mod (* (* |_641| 1) (* |_641| 1)) |~prime|) (mod (* |_641| 1) |~prime|)) +(= (mod (* (* |_642| 1) (* |_642| 1)) |~prime|) (mod (* |_642| 1) |~prime|)) +(= (mod (* (* |_643| 1) (* |_643| 1)) |~prime|) (mod (* |_643| 1) |~prime|)) +(= (mod (* (* |_644| 1) (* |_644| 1)) |~prime|) (mod (* |_644| 1) |~prime|)) +(= (mod (* (* |_645| 1) (* |_645| 1)) |~prime|) (mod (* |_645| 1) |~prime|)) +(= (mod (* (* |_646| 1) (* |_646| 1)) |~prime|) (mod (* |_646| 1) |~prime|)) +(= (mod (* (* |_647| 1) (* |_647| 1)) |~prime|) (mod (* |_647| 1) |~prime|)) +(= (mod (* (* |_648| 1) (* |_648| 1)) |~prime|) (mod (* |_648| 1) |~prime|)) +(= (mod (* (* |_649| 1) (* |_649| 1)) |~prime|) (mod (* |_649| 1) |~prime|)) +(= (mod (* (* |_650| 1) (* |_650| 1)) |~prime|) (mod (* |_650| 1) |~prime|)) +(= (mod (* (* |_651| 1) (* |_651| 1)) |~prime|) (mod (* |_651| 1) |~prime|)) +(= (mod (* (* |_652| 1) (* |_652| 1)) |~prime|) (mod (* |_652| 1) |~prime|)) +(= (mod (* (* |_653| 1) (* |_653| 1)) |~prime|) (mod (* |_653| 1) |~prime|)) +(= (mod (* (* |_654| 1) (* |_654| 1)) |~prime|) (mod (* |_654| 1) |~prime|)) +(= (mod (* (* |_655| 1) (* |_655| 1)) |~prime|) (mod (* |_655| 1) |~prime|)) +(= (mod (* (* |_656| 1) (* |_656| 1)) |~prime|) (mod (* |_656| 1) |~prime|)) +(= (mod (* (* |_657| 1) (* |_657| 1)) |~prime|) (mod (* |_657| 1) |~prime|)) +(= (mod (* (* |_658| 1) (* |_658| 1)) |~prime|) (mod (* |_658| 1) |~prime|)) +(= (mod (* (* |_659| 1) (* |_659| 1)) |~prime|) (mod (* |_659| 1) |~prime|)) +(= (mod (* (* |_660| 1) (* |_660| 1)) |~prime|) (mod (* |_660| 1) |~prime|)) +(= (mod (* (* |_661| 1) (* |_661| 1)) |~prime|) (mod (* |_661| 1) |~prime|)) +(= (mod (* (* |_662| 1) (* |_662| 1)) |~prime|) (mod (* |_662| 1) |~prime|)) +(= (mod (* (* |_663| 1) (* |_663| 1)) |~prime|) (mod (* |_663| 1) |~prime|)) +(= (mod (* (* |_664| 1) (* |_664| 1)) |~prime|) (mod (* |_664| 1) |~prime|)) +(= (mod (* (* |_665| 1) (* |_665| 1)) |~prime|) (mod (* |_665| 1) |~prime|)) +(= (mod (* (* |_666| 1) (* |_666| 1)) |~prime|) (mod (* |_666| 1) |~prime|)) +(= (mod (* (* |_667| 1) (* |_667| 1)) |~prime|) (mod (* |_667| 1) |~prime|)) +(= (mod (* (* |_668| 1) (* |_668| 1)) |~prime|) (mod (* |_668| 1) |~prime|)) +(= (mod (* (* |_669| 1) (* |_669| 1)) |~prime|) (mod (* |_669| 1) |~prime|)) +(= (mod (* (* |_670| 1) (* |_670| 1)) |~prime|) (mod (* |_670| 1) |~prime|)) +(= (mod (* (* |_671| 1) (* |_671| 1)) |~prime|) (mod (* |_671| 1) |~prime|)) +(= (mod (* (* |_672| 1) (* |_672| 1)) |~prime|) (mod (* |_672| 1) |~prime|)) +(= (mod (* (* |_673| 1) (* |_673| 1)) |~prime|) (mod (* |_673| 1) |~prime|)) +(= (mod (* (* |_674| 1) (* |_674| 1)) |~prime|) (mod (* |_674| 1) |~prime|)) +(= (mod (* (* |_675| 1) (* |_675| 1)) |~prime|) (mod (* |_675| 1) |~prime|)) +(= (mod (* (* |_676| 1) (* |_676| 1)) |~prime|) (mod (* |_676| 1) |~prime|)) +(= (mod (* (* |_677| 1) (* |_677| 1)) |~prime|) (mod (* |_677| 1) |~prime|)) +(= (mod (* (* |_678| 1) (* |_678| 1)) |~prime|) (mod (* |_678| 1) |~prime|)) +(= (mod (* (* |_679| 1) (* |_679| 1)) |~prime|) (mod (* |_679| 1) |~prime|)) +(= (mod (* (* |_680| 1) (* |_680| 1)) |~prime|) (mod (* |_680| 1) |~prime|)) +(= (mod (* (* |_681| 1) (* |_681| 1)) |~prime|) (mod (* |_681| 1) |~prime|)) +(= (mod (* (* |_682| 1) (* |_682| 1)) |~prime|) (mod (* |_682| 1) |~prime|)) +(= (mod (* (* |_683| 1) (* |_683| 1)) |~prime|) (mod (* |_683| 1) |~prime|)) +(= (mod (* (* |_684| 1) (* |_684| 1)) |~prime|) (mod (* |_684| 1) |~prime|)) +(= (mod (* (* |_685| 1) (* |_685| 1)) |~prime|) (mod (* |_685| 1) |~prime|)) +(= (mod (* (* |_686| 1) (* |_686| 1)) |~prime|) (mod (* |_686| 1) |~prime|)) +(= (mod (* (* |_687| 1) (* |_687| 1)) |~prime|) (mod (* |_687| 1) |~prime|)) +(= (mod (* (* |_688| 1) (* |_688| 1)) |~prime|) (mod (* |_688| 1) |~prime|)) +(= (mod (* (* |_689| 1) (* |_689| 1)) |~prime|) (mod (* |_689| 1) |~prime|)) +(= (mod (* (* |_690| 1) (* |_690| 1)) |~prime|) (mod (* |_690| 1) |~prime|)) +(= (mod (* (* |_691| 1) (* |_691| 1)) |~prime|) (mod (* |_691| 1) |~prime|)) +(= (mod (* (* |_692| 1) (* |_692| 1)) |~prime|) (mod (* |_692| 1) |~prime|)) +(= (mod (* (* |_693| 1) (* |_693| 1)) |~prime|) (mod (* |_693| 1) |~prime|)) +(= (mod (* (* |_694| 1) (* |_694| 1)) |~prime|) (mod (* |_694| 1) |~prime|)) +(= (mod (* (* |_695| 1) (* |_695| 1)) |~prime|) (mod (* |_695| 1) |~prime|)) +(= (mod (* (* |_696| 1) (* |_696| 1)) |~prime|) (mod (* |_696| 1) |~prime|)) +(= (mod (* (* |_697| 1) (* |_697| 1)) |~prime|) (mod (* |_697| 1) |~prime|)) +(= (mod (* (* |_698| 1) (* |_698| 1)) |~prime|) (mod (* |_698| 1) |~prime|)) +(= (mod (* (* |_699| 1) (* |_699| 1)) |~prime|) (mod (* |_699| 1) |~prime|)) +(= (mod (* (* |_700| 1) (* |_700| 1)) |~prime|) (mod (* |_700| 1) |~prime|)) +(= (mod (* (* |_701| 1) (* |_701| 1)) |~prime|) (mod (* |_701| 1) |~prime|)) +(= (mod (* (* |_702| 1) (* |_702| 1)) |~prime|) (mod (* |_702| 1) |~prime|)) +(= (mod (* (* |_703| 1) (* |_703| 1)) |~prime|) (mod (* |_703| 1) |~prime|)) +(= (mod (* (* |_704| 1) (* |_704| 1)) |~prime|) (mod (* |_704| 1) |~prime|)) +(= (mod (* (* |_705| 1) (* |_705| 1)) |~prime|) (mod (* |_705| 1) |~prime|)) +(= (mod (* (* |_706| 1) (* |_706| 1)) |~prime|) (mod (* |_706| 1) |~prime|)) +(= (mod (* (* |_707| 1) (* |_707| 1)) |~prime|) (mod (* |_707| 1) |~prime|)) +(= (mod (* (* |_708| 1) (* |_708| 1)) |~prime|) (mod (* |_708| 1) |~prime|)) +(= (mod (* (* |_709| 1) (* |_709| 1)) |~prime|) (mod (* |_709| 1) |~prime|)) +(= (mod (* (* |_710| 1) (* |_710| 1)) |~prime|) (mod (* |_710| 1) |~prime|)) +(= (mod (* (* |_711| 1) (* |_711| 1)) |~prime|) (mod (* |_711| 1) |~prime|)) +(= (mod (* (* |_712| 1) (* |_712| 1)) |~prime|) (mod (* |_712| 1) |~prime|)) +(= (mod (* (* |_713| 1) (* |_713| 1)) |~prime|) (mod (* |_713| 1) |~prime|)) +(= (mod (* (* |_714| 1) (* |_714| 1)) |~prime|) (mod (* |_714| 1) |~prime|)) +(= (mod (* (* |_715| 1) (* |_715| 1)) |~prime|) (mod (* |_715| 1) |~prime|)) +(= (mod (* (* |_716| 1) (* |_716| 1)) |~prime|) (mod (* |_716| 1) |~prime|)) +(= (mod (* (* |_717| 1) (* |_717| 1)) |~prime|) (mod (* |_717| 1) |~prime|)) +(= (mod (* (* |_718| 1) (* |_718| 1)) |~prime|) (mod (* |_718| 1) |~prime|)) +(= (mod (* (* |_719| 1) (* |_719| 1)) |~prime|) (mod (* |_719| 1) |~prime|)) +(= (mod (* (* |_720| 1) (* |_720| 1)) |~prime|) (mod (* |_720| 1) |~prime|)) +(= (mod (* (* |_721| 1) (* |_721| 1)) |~prime|) (mod (* |_721| 1) |~prime|)) +(= (mod (* (* |_722| 1) (* |_722| 1)) |~prime|) (mod (* |_722| 1) |~prime|)) +(= (mod (* (* |_723| 1) (* |_723| 1)) |~prime|) (mod (* |_723| 1) |~prime|)) +(= (mod (* (* |_724| 1) (* |_724| 1)) |~prime|) (mod (* |_724| 1) |~prime|)) +(= (mod (* (* |_725| 1) (* |_725| 1)) |~prime|) (mod (* |_725| 1) |~prime|)) +(= (mod (* (* |_726| 1) (* |_726| 1)) |~prime|) (mod (* |_726| 1) |~prime|)) +(= (mod (* (* |_727| 1) (* |_727| 1)) |~prime|) (mod (* |_727| 1) |~prime|)) +(= (mod (* (* |_728| 1) (* |_728| 1)) |~prime|) (mod (* |_728| 1) |~prime|)) +(= (mod (* (* |_729| 1) (* |_729| 1)) |~prime|) (mod (* |_729| 1) |~prime|)) +(= (mod (* (* |_730| 1) (* |_730| 1)) |~prime|) (mod (* |_730| 1) |~prime|)) +(= (mod (* (* |_731| 1) (* |_731| 1)) |~prime|) (mod (* |_731| 1) |~prime|)) +(= (mod (* (* |_732| 1) (* |_732| 1)) |~prime|) (mod (* |_732| 1) |~prime|)) +(= (mod (* (* |_733| 1) (* |_733| 1)) |~prime|) (mod (* |_733| 1) |~prime|)) +(= (mod (* (* |_734| 1) (* |_734| 1)) |~prime|) (mod (* |_734| 1) |~prime|)) +(= (mod (* (* |_735| 1) (* |_735| 1)) |~prime|) (mod (* |_735| 1) |~prime|)) +(= (mod (* (* |_736| 1) (* |_736| 1)) |~prime|) (mod (* |_736| 1) |~prime|)) +(= (mod (* (* |_737| 1) (* |_737| 1)) |~prime|) (mod (* |_737| 1) |~prime|)) +(= (mod (* (* |_738| 1) (* |_738| 1)) |~prime|) (mod (* |_738| 1) |~prime|)) +(= (mod (* (* |_739| 1) (* |_739| 1)) |~prime|) (mod (* |_739| 1) |~prime|)) +(= (mod (* (* |_740| 1) (* |_740| 1)) |~prime|) (mod (* |_740| 1) |~prime|)) +(= (mod (* (* |_741| 1) (* |_741| 1)) |~prime|) (mod (* |_741| 1) |~prime|)) +(= (mod (* (* |_742| 1) (* |_742| 1)) |~prime|) (mod (* |_742| 1) |~prime|)) +(= (mod (* (* |_743| 1) (* |_743| 1)) |~prime|) (mod (* |_743| 1) |~prime|)) +(= (mod (* (* |_744| 1) (* |_744| 1)) |~prime|) (mod (* |_744| 1) |~prime|)) +(= (mod (* (* |_745| 1) (* |_745| 1)) |~prime|) (mod (* |_745| 1) |~prime|)) +(= (mod (* (* |_746| 1) (* |_746| 1)) |~prime|) (mod (* |_746| 1) |~prime|)) +(= (mod (* (* |_747| 1) (* |_747| 1)) |~prime|) (mod (* |_747| 1) |~prime|)) +(= (mod (* (* |_748| 1) (* |_748| 1)) |~prime|) (mod (* |_748| 1) |~prime|)) +(= (mod (* (* |_749| 1) (* |_749| 1)) |~prime|) (mod (* |_749| 1) |~prime|)) +(= (mod (* (* |_750| 1) (* |_750| 1)) |~prime|) (mod (* |_750| 1) |~prime|)) +(= (mod (* (* |_751| 1) (* |_751| 1)) |~prime|) (mod (* |_751| 1) |~prime|)) +(= (mod (* (* |_752| 1) (* |_752| 1)) |~prime|) (mod (* |_752| 1) |~prime|)) +(= (mod (* (* |_753| 1) (* |_753| 1)) |~prime|) (mod (* |_753| 1) |~prime|)) +(= (mod (* (* |_754| 1) (* |_754| 1)) |~prime|) (mod (* |_754| 1) |~prime|)) +(= (mod (* (* |_755| 1) (* |_755| 1)) |~prime|) (mod (* |_755| 1) |~prime|)) +(= (mod (* (* |_756| 1) (* |_756| 1)) |~prime|) (mod (* |_756| 1) |~prime|)) +(= (mod (* (* |_757| 1) (* |_757| 1)) |~prime|) (mod (* |_757| 1) |~prime|)) +(= (mod (* (* |_758| 1) (* |_758| 1)) |~prime|) (mod (* |_758| 1) |~prime|)) +(= (mod (* (* |_759| 1) (* |_759| 1)) |~prime|) (mod (* |_759| 1) |~prime|)) +(= (mod (* (* |_760| 1) (* |_760| 1)) |~prime|) (mod (* |_760| 1) |~prime|)) +(= (mod (* (* |_761| 1) (* |_761| 1)) |~prime|) (mod (* |_761| 1) |~prime|)) +(= (mod (* (* |_762| 1) (* |_762| 1)) |~prime|) (mod (* |_762| 1) |~prime|)) +(= (mod (* (* |~one| 1) (+ (* |_511| 3618502788666131106986593281521497120414687020801267626233049500247285301248) (* |_512| 1809251394333065553493296640760748560207343510400633813116524750123642650624) (* |_513| 904625697166532776746648320380374280103671755200316906558262375061821325312) (* |_514| 452312848583266388373324160190187140051835877600158453279131187530910662656) (* |_515| 226156424291633194186662080095093570025917938800079226639565593765455331328) (* |_516| 113078212145816597093331040047546785012958969400039613319782796882727665664) (* |_517| 56539106072908298546665520023773392506479484700019806659891398441363832832) (* |_518| 28269553036454149273332760011886696253239742350009903329945699220681916416) (* |_519| 14134776518227074636666380005943348126619871175004951664972849610340958208) (* |_520| 7067388259113537318333190002971674063309935587502475832486424805170479104) (* |_521| 3533694129556768659166595001485837031654967793751237916243212402585239552) (* |_522| 1766847064778384329583297500742918515827483896875618958121606201292619776) (* |_523| 883423532389192164791648750371459257913741948437809479060803100646309888) (* |_524| 441711766194596082395824375185729628956870974218904739530401550323154944) (* |_525| 220855883097298041197912187592864814478435487109452369765200775161577472) (* |_526| 110427941548649020598956093796432407239217743554726184882600387580788736) (* |_527| 55213970774324510299478046898216203619608871777363092441300193790394368) (* |_528| 27606985387162255149739023449108101809804435888681546220650096895197184) (* |_529| 13803492693581127574869511724554050904902217944340773110325048447598592) (* |_530| 6901746346790563787434755862277025452451108972170386555162524223799296) (* |_531| 3450873173395281893717377931138512726225554486085193277581262111899648) (* |_532| 1725436586697640946858688965569256363112777243042596638790631055949824) (* |_533| 862718293348820473429344482784628181556388621521298319395315527974912) (* |_534| 431359146674410236714672241392314090778194310760649159697657763987456) (* |_535| 215679573337205118357336120696157045389097155380324579848828881993728) (* |_536| 107839786668602559178668060348078522694548577690162289924414440996864) (* |_537| 53919893334301279589334030174039261347274288845081144962207220498432) (* |_538| 26959946667150639794667015087019630673637144422540572481103610249216) (* |_539| 13479973333575319897333507543509815336818572211270286240551805124608) (* |_540| 6739986666787659948666753771754907668409286105635143120275902562304) (* |_541| 3369993333393829974333376885877453834204643052817571560137951281152) (* |_542| 1684996666696914987166688442938726917102321526408785780068975640576) (* |_543| 842498333348457493583344221469363458551160763204392890034487820288) (* |_544| 421249166674228746791672110734681729275580381602196445017243910144) (* |_545| 210624583337114373395836055367340864637790190801098222508621955072) (* |_546| 105312291668557186697918027683670432318895095400549111254310977536) (* |_547| 52656145834278593348959013841835216159447547700274555627155488768) (* |_548| 26328072917139296674479506920917608079723773850137277813577744384) (* |_549| 13164036458569648337239753460458804039861886925068638906788872192) (* |_550| 6582018229284824168619876730229402019930943462534319453394436096) (* |_551| 3291009114642412084309938365114701009965471731267159726697218048) (* |_552| 1645504557321206042154969182557350504982735865633579863348609024) (* |_553| 822752278660603021077484591278675252491367932816789931674304512) (* |_554| 411376139330301510538742295639337626245683966408394965837152256) (* |_555| 205688069665150755269371147819668813122841983204197482918576128) (* |_556| 102844034832575377634685573909834406561420991602098741459288064) (* |_557| 51422017416287688817342786954917203280710495801049370729644032) (* |_558| 25711008708143844408671393477458601640355247900524685364822016) (* |_559| 12855504354071922204335696738729300820177623950262342682411008) (* |_560| 6427752177035961102167848369364650410088811975131171341205504) (* |_561| 3213876088517980551083924184682325205044405987565585670602752) (* |_562| 1606938044258990275541962092341162602522202993782792835301376) (* |_563| 803469022129495137770981046170581301261101496891396417650688) (* |_564| 401734511064747568885490523085290650630550748445698208825344) (* |_565| 200867255532373784442745261542645325315275374222849104412672) (* |_566| 100433627766186892221372630771322662657637687111424552206336) (* |_567| 50216813883093446110686315385661331328818843555712276103168) (* |_568| 25108406941546723055343157692830665664409421777856138051584) (* |_569| 12554203470773361527671578846415332832204710888928069025792) (* |_570| 6277101735386680763835789423207666416102355444464034512896) (* |_571| 3138550867693340381917894711603833208051177722232017256448) (* |_572| 1569275433846670190958947355801916604025588861116008628224) (* |_573| 784637716923335095479473677900958302012794430558004314112) (* |_574| 392318858461667547739736838950479151006397215279002157056) (* |_575| 196159429230833773869868419475239575503198607639501078528) (* |_576| 98079714615416886934934209737619787751599303819750539264) (* |_577| 49039857307708443467467104868809893875799651909875269632) (* |_578| 24519928653854221733733552434404946937899825954937634816) (* |_579| 12259964326927110866866776217202473468949912977468817408) (* |_580| 6129982163463555433433388108601236734474956488734408704) (* |_581| 3064991081731777716716694054300618367237478244367204352) (* |_582| 1532495540865888858358347027150309183618739122183602176) (* |_583| 766247770432944429179173513575154591809369561091801088) (* |_584| 383123885216472214589586756787577295904684780545900544) (* |_585| 191561942608236107294793378393788647952342390272950272) (* |_586| 95780971304118053647396689196894323976171195136475136) (* |_587| 47890485652059026823698344598447161988085597568237568) (* |_588| 23945242826029513411849172299223580994042798784118784) (* |_589| 11972621413014756705924586149611790497021399392059392) (* |_590| 5986310706507378352962293074805895248510699696029696) (* |_591| 2993155353253689176481146537402947624255349848014848) (* |_592| 1496577676626844588240573268701473812127674924007424) (* |_593| 748288838313422294120286634350736906063837462003712) (* |_594| 374144419156711147060143317175368453031918731001856) (* |_595| 187072209578355573530071658587684226515959365500928) (* |_596| 93536104789177786765035829293842113257979682750464) (* |_597| 46768052394588893382517914646921056628989841375232) (* |_598| 23384026197294446691258957323460528314494920687616) (* |_599| 11692013098647223345629478661730264157247460343808) (* |_600| 5846006549323611672814739330865132078623730171904) (* |_601| 2923003274661805836407369665432566039311865085952) (* |_602| 1461501637330902918203684832716283019655932542976) (* |_603| 730750818665451459101842416358141509827966271488) (* |_604| 365375409332725729550921208179070754913983135744) (* |_605| 182687704666362864775460604089535377456991567872) (* |_606| 91343852333181432387730302044767688728495783936) (* |_607| 45671926166590716193865151022383844364247891968) (* |_608| 22835963083295358096932575511191922182123945984) (* |_609| 11417981541647679048466287755595961091061972992) (* |_610| 5708990770823839524233143877797980545530986496) (* |_611| 2854495385411919762116571938898990272765493248) (* |_612| 1427247692705959881058285969449495136382746624) (* |_613| 713623846352979940529142984724747568191373312) (* |_614| 356811923176489970264571492362373784095686656) (* |_615| 178405961588244985132285746181186892047843328) (* |_616| 89202980794122492566142873090593446023921664) (* |_617| 44601490397061246283071436545296723011960832) (* |_618| 22300745198530623141535718272648361505980416) (* |_619| 11150372599265311570767859136324180752990208) (* |_620| 5575186299632655785383929568162090376495104) (* |_621| 2787593149816327892691964784081045188247552) (* |_622| 1393796574908163946345982392040522594123776) (* |_623| 696898287454081973172991196020261297061888) (* |_624| 348449143727040986586495598010130648530944) (* |_625| 174224571863520493293247799005065324265472) (* |_626| 87112285931760246646623899502532662132736) (* |_627| 43556142965880123323311949751266331066368) (* |_628| 21778071482940061661655974875633165533184) (* |_629| 10889035741470030830827987437816582766592) (* |_630| 5444517870735015415413993718908291383296) (* |_631| 2722258935367507707706996859454145691648) (* |_632| 1361129467683753853853498429727072845824) (* |_633| 680564733841876926926749214863536422912) (* |_634| 340282366920938463463374607431768211456) (* |_635| 170141183460469231731687303715884105728) (* |_636| 85070591730234615865843651857942052864) (* |_637| 42535295865117307932921825928971026432) (* |_638| 21267647932558653966460912964485513216) (* |_639| 10633823966279326983230456482242756608) (* |_640| 5316911983139663491615228241121378304) (* |_641| 2658455991569831745807614120560689152) (* |_642| 1329227995784915872903807060280344576) (* |_643| 664613997892457936451903530140172288) (* |_644| 332306998946228968225951765070086144) (* |_645| 166153499473114484112975882535043072) (* |_646| 83076749736557242056487941267521536) (* |_647| 41538374868278621028243970633760768) (* |_648| 20769187434139310514121985316880384) (* |_649| 10384593717069655257060992658440192) (* |_650| 5192296858534827628530496329220096) (* |_651| 2596148429267413814265248164610048) (* |_652| 1298074214633706907132624082305024) (* |_653| 649037107316853453566312041152512) (* |_654| 324518553658426726783156020576256) (* |_655| 162259276829213363391578010288128) (* |_656| 81129638414606681695789005144064) (* |_657| 40564819207303340847894502572032) (* |_658| 20282409603651670423947251286016) (* |_659| 10141204801825835211973625643008) (* |_660| 5070602400912917605986812821504) (* |_661| 2535301200456458802993406410752) (* |_662| 1267650600228229401496703205376) (* |_663| 633825300114114700748351602688) (* |_664| 316912650057057350374175801344) (* |_665| 158456325028528675187087900672) (* |_666| 79228162514264337593543950336) (* |_667| 39614081257132168796771975168) (* |_668| 19807040628566084398385987584) (* |_669| 9903520314283042199192993792) (* |_670| 4951760157141521099596496896) (* |_671| 2475880078570760549798248448) (* |_672| 1237940039285380274899124224) (* |_673| 618970019642690137449562112) (* |_674| 309485009821345068724781056) (* |_675| 154742504910672534362390528) (* |_676| 77371252455336267181195264) (* |_677| 38685626227668133590597632) (* |_678| 19342813113834066795298816) (* |_679| 9671406556917033397649408) (* |_680| 4835703278458516698824704) (* |_681| 2417851639229258349412352) (* |_682| 1208925819614629174706176) (* |_683| 604462909807314587353088) (* |_684| 302231454903657293676544) (* |_685| 151115727451828646838272) (* |_686| 75557863725914323419136) (* |_687| 37778931862957161709568) (* |_688| 18889465931478580854784) (* |_689| 9444732965739290427392) (* |_690| 4722366482869645213696) (* |_691| 2361183241434822606848) (* |_692| 1180591620717411303424) (* |_693| 590295810358705651712) (* |_694| 295147905179352825856) (* |_695| 147573952589676412928) (* |_696| 73786976294838206464) (* |_697| 36893488147419103232) (* |_698| 18446744073709551616) (* |_699| 9223372036854775808) (* |_700| 4611686018427387904) (* |_701| 2305843009213693952) (* |_702| 1152921504606846976) (* |_703| 576460752303423488) (* |_704| 288230376151711744) (* |_705| 144115188075855872) (* |_706| 72057594037927936) (* |_707| 36028797018963968) (* |_708| 18014398509481984) (* |_709| 9007199254740992) (* |_710| 4503599627370496) (* |_711| 2251799813685248) (* |_712| 1125899906842624) (* |_713| 562949953421312) (* |_714| 281474976710656) (* |_715| 140737488355328) (* |_716| 70368744177664) (* |_717| 35184372088832) (* |_718| 17592186044416) (* |_719| 8796093022208) (* |_720| 4398046511104) (* |_721| 2199023255552) (* |_722| 1099511627776) (* |_723| 549755813888) (* |_724| 274877906944) (* |_725| 137438953472) (* |_726| 68719476736) (* |_727| 34359738368) (* |_728| 17179869184) (* |_729| 8589934592) (* |_730| 4294967296) (* |_731| 2147483648) (* |_732| 1073741824) (* |_733| 536870912) (* |_734| 268435456) (* |_735| 134217728) (* |_736| 67108864) (* |_737| 33554432) (* |_738| 16777216) (* |_739| 8388608) (* |_740| 4194304) (* |_741| 2097152) (* |_742| 1048576) (* |_743| 524288) (* |_744| 262144) (* |_745| 131072) (* |_746| 65536) (* |_747| 32768) (* |_748| 16384) (* |_749| 8192) (* |_750| 4096) (* |_751| 2048) (* |_752| 1024) (* |_753| 512) (* |_754| 256) (* |_755| 128) (* |_756| 64) (* |_757| 32) (* |_758| 16) (* |_759| 8) (* |_760| 4) (* |_761| 2) (* |_762| 1))) |~prime|) (mod (* |_0| 1) |~prime|)) +(= (mod (* (* |_2| 1) (+ (* |_0| 21888242871839275222246405745257275088548364400416034343698204186575808495616) (* |_1| 1))) |~prime|) (mod (* |_768| 1) |~prime|)) +(= (mod (* (* |~one| 1) (* |_768| 1)) |~prime|) (mod (* |~out_0| 1) |~prime|)) )) \ No newline at end of file diff --git a/zokrates_codegen/src/lib.rs b/zokrates_codegen/src/lib.rs index 685c78d31..c5a306294 100644 --- a/zokrates_codegen/src/lib.rs +++ b/zokrates_codegen/src/lib.rs @@ -841,7 +841,7 @@ impl<'ast, T: Field> Flattener<'ast, T> { let lhs_id = self.define(lhs_flattened, statements_flattened); let rhs_id = self.define(rhs_flattened, statements_flattened); - // shifted_sub := 2**safe_width + lhs - rhs + // shifted_sub := 2**bit_width + lhs - rhs let shifted_sub = FlatExpression::add( FlatExpression::value(T::from(2).pow(bit_width)), FlatExpression::sub( @@ -857,7 +857,7 @@ impl<'ast, T: Field> Flattener<'ast, T> { sub_width, sub_width, statements_flattened, - RuntimeError::IncompleteDynamicRange, + RuntimeError::Sum, ); FlatExpression::sub( @@ -898,19 +898,42 @@ impl<'ast, T: Field> Flattener<'ast, T> { .flatten_select_expression(statements_flattened, e) .get_field_unchecked(), BooleanExpression::FieldLt(e) => { - // Get the bit width to know the size of the binary decompositions for this Field - let bit_width = T::get_required_bits(); - - let safe_width = bit_width - 2; // dynamic comparison is not complete, it only applies to field elements whose difference is strictly smaller than 2**(bitwidth - 2) - let lhs_flattened = self.flatten_field_expression(statements_flattened, *e.left); let rhs_flattened = self.flatten_field_expression(statements_flattened, *e.right); - self.lt_check( - statements_flattened, - lhs_flattened, - rhs_flattened, - safe_width, - ) + + match (lhs_flattened, rhs_flattened) { + (e, FlatExpression::Value(c)) => { + self.constant_lt_check(statements_flattened, e, c.value) + } + (FlatExpression::Value(c), e) => self.constant_lt_check( + statements_flattened, + FlatExpression::sub(T::max_value().into(), e), + T::max_value() - c.value, + ), + (lhs, rhs) => { + // Get the bit width to know the size of the binary decompositions for this Field + let bit_width = T::get_required_bits(); + let safe_width = bit_width - 2; // dynamic comparison is not complete, it only applies to field elements whose difference is strictly smaller than 2**(bitwidth - 2) + let safe_max = T::from(2).pow(safe_width); + + // enforce that lhs and rhs are in the correct range + self.enforce_constant_lt_check( + statements_flattened, + lhs.clone(), + safe_max, + RuntimeError::IncompleteDynamicRange, + ); + + self.enforce_constant_lt_check( + statements_flattened, + rhs.clone(), + safe_max, + RuntimeError::IncompleteDynamicRange, + ); + + self.lt_check(statements_flattened, lhs, rhs, safe_width) + } + } } BooleanExpression::BoolEq(e) => { // lhs and rhs are booleans, they flatten to 0 or 1 @@ -1980,7 +2003,8 @@ impl<'ast, T: Field> Flattener<'ast, T> { /// /// # Notes /// * `from` and `to` must be smaller or equal to `T::get_required_bits()`, the bitwidth of the prime field - /// * the result is not checked to be in range. This is fine for `to < T::get_required_bits()`, but otherwise it is the caller's responsibility to add that check + /// * The result is not checked to be in range unless the bits of the expression were already decomposed with a higher bitwidth than `to` + /// * This is fine for `to < T::get_required_bits()`, but otherwise it is the caller's responsibility to add that check fn get_bits_unchecked( &mut self, e: &FlatUExpression, @@ -2015,19 +2039,30 @@ impl<'ast, T: Field> Flattener<'ast, T> { let from = std::cmp::max(from, to); let res = match self.bits_cache.entry(e.field.clone().unwrap()) { Entry::Occupied(entry) => { - let res: Vec<_> = entry.get().clone(); - // if we already know a decomposition, its number of elements has to be smaller or equal to `to` + let mut res: Vec<_> = entry.get().clone(); + + // only keep the last `to` values and return the sum of the others + let sum = res + .drain(0..res.len().saturating_sub(to)) + .fold(FlatExpression::from(T::zero()), |acc, e| { + FlatExpression::add(acc, e) + }); + + // force the sum to be 0 + statements_flattened.push_back(FlatStatement::condition( + FlatExpression::value(T::from(0)), + sum, + error, + )); + + // sanity check that we have at most `to` values assert!(res.len() <= to); - // we then pad it with zeroes on the left (big endian) to return `to` bits - if res.len() == to { - res - } else { - (0..to - res.len()) - .map(|_| FlatExpression::value(T::zero())) - .chain(res) - .collect() - } + // return the result left-padded to `to` values + std::iter::repeat(FlatExpression::value(T::zero())) + .take(to - res.len()) + .chain(res.clone()) + .collect() } Entry::Vacant(_) => { let bits = (0..from).map(|_| self.use_sym()).collect::>(); @@ -2553,7 +2588,23 @@ impl<'ast, T: Field> Flattener<'ast, T> { ), (lhs, rhs) => { let bit_width = T::get_required_bits(); - let safe_width = bit_width - 2; // dynamic comparison is not complete + let safe_width = bit_width - 2; // dynamic comparison is not complete, it only applies to field elements whose difference is strictly smaller than 2**(bitwidth - 2) + let safe_max = T::from(2).pow(safe_width); + + self.enforce_constant_lt_check( + statements_flattened, + lhs.clone(), + safe_max, + RuntimeError::IncompleteDynamicRange, + ); + + self.enforce_constant_lt_check( + statements_flattened, + rhs.clone(), + safe_max, + RuntimeError::IncompleteDynamicRange, + ); + let e = self.lt_check(statements_flattened, lhs, rhs, safe_width); statements_flattened.push_back(FlatStatement::condition( e, @@ -2583,7 +2634,23 @@ impl<'ast, T: Field> Flattener<'ast, T> { ), (lhs, rhs) => { let bit_width = T::get_required_bits(); - let safe_width = bit_width - 2; // dynamic comparison is not complete + let safe_width = bit_width - 2; // dynamic comparison is not complete, it only applies to field elements whose difference is strictly smaller than 2**(bitwidth - 2) + + let safe_max = T::from(2).pow(safe_width); + self.enforce_constant_lt_check( + statements_flattened, + lhs.clone(), + safe_max, + RuntimeError::IncompleteDynamicRange, + ); + + self.enforce_constant_lt_check( + statements_flattened, + rhs.clone(), + safe_max, + RuntimeError::IncompleteDynamicRange, + ); + let e = self.le_check(statements_flattened, lhs, rhs, safe_width); statements_flattened.push_back(FlatStatement::condition( e, @@ -2593,32 +2660,72 @@ impl<'ast, T: Field> Flattener<'ast, T> { } } } - BooleanExpression::UintLe(e) => { + BooleanExpression::UintLt(e) => { + let bitwidth = e.left.bitwidth as usize; let lhs = self .flatten_uint_expression(statements_flattened, *e.left) .get_field_unchecked(); + let rhs = self .flatten_uint_expression(statements_flattened, *e.right) .get_field_unchecked(); match (lhs, rhs) { - (e, FlatExpression::Value(c)) => self.enforce_constant_le_check( + (e, FlatExpression::Value(c)) => self.enforce_constant_lt_check( statements_flattened, e, c.value, error.into(), ), - // c <= e <=> p - 1 - e <= p - 1 - c - (FlatExpression::Value(c), e) => self.enforce_constant_le_check( + // c < e <=> 2^bw - 1 - e < 2^bw - 1 - c + (FlatExpression::Value(c), e) => { + let max = T::from(2u32).pow(bitwidth) - T::one(); + self.enforce_constant_lt_check( + statements_flattened, + FlatExpression::sub(max.into(), e), + max - c.value, + error.into(), + ) + } + (lhs, rhs) => { + let e = self.lt_check(statements_flattened, lhs, rhs, bitwidth); + statements_flattened.push_back(FlatStatement::condition( + e, + FlatExpression::value(T::one()), + error.into(), + )); + } + } + } + BooleanExpression::UintLe(e) => { + let bitwidth = e.left.bitwidth as usize; + let lhs = self + .flatten_uint_expression(statements_flattened, *e.left) + .get_field_unchecked(); + + let rhs = self + .flatten_uint_expression(statements_flattened, *e.right) + .get_field_unchecked(); + + match (lhs, rhs) { + (e, FlatExpression::Value(c)) => self.enforce_constant_le_check( statements_flattened, - FlatExpression::sub(T::max_value().into(), e), - T::max_value() - c.value, + e, + c.value, error.into(), ), + // c <= e <=> 2^bw - 1 - e <= 2^bw - 1 - c + (FlatExpression::Value(c), e) => { + let max = T::from(2u32).pow(bitwidth) - T::one(); + self.enforce_constant_le_check( + statements_flattened, + FlatExpression::sub(max.into(), e), + max - c.value, + error.into(), + ) + } (lhs, rhs) => { - let bit_width = T::get_required_bits(); - let safe_width = bit_width - 2; // dynamic comparison is not complete - let e = self.le_check(statements_flattened, lhs, rhs, safe_width); + let e = self.le_check(statements_flattened, lhs, rhs, bitwidth); statements_flattened.push_back(FlatStatement::condition( e, FlatExpression::value(T::one()), diff --git a/zokrates_core_test/tests/tests/compare_min_to_max.json b/zokrates_core_test/tests/tests/compare_min_to_max.json deleted file mode 100644 index e1402336e..000000000 --- a/zokrates_core_test/tests/tests/compare_min_to_max.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "entry_point": "./tests/tests/compare_min_to_max.zok", - "curves": ["Bn128", "Bls12_381", "Bls12_377", "Bw6_761"], - "tests": [ - { - "input": { - "values": ["0"] - }, - "output": { - "Ok": { - "value": false - } - } - } - ] -} diff --git a/zokrates_core_test/tests/tests/compare_min_to_max.zok b/zokrates_core_test/tests/tests/compare_min_to_max.zok deleted file mode 100644 index cd17242b0..000000000 --- a/zokrates_core_test/tests/tests/compare_min_to_max.zok +++ /dev/null @@ -1,10 +0,0 @@ -from "field" import FIELD_MAX; - -// /!\ should be called with a = 0 -// as `|a - FIELD_MAX| < 2**(N-2)` the comparison should succeed - -def main(field a) -> bool { - field p = FIELD_MAX + a; - // we added a = 0 to prevent the condition to be evaluated at compile time - return a < p; -} \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/range_check/assert_ge_big_constant.json b/zokrates_core_test/tests/tests/range_check/assert_ge_big_constant.json new file mode 100644 index 000000000..23198947f --- /dev/null +++ b/zokrates_core_test/tests/tests/range_check/assert_ge_big_constant.json @@ -0,0 +1,73 @@ +{ + "entry_point": "./tests/tests/range_check/assert_ge_big_constant.zok", + "max_constraint_count": 2, + "curves": ["Bn128"], + "tests": [ + { + "input": { + "values": ["0"] + }, + "output": { + "Err": { + "UnsatisfiedConstraint": { + "error": { + "SourceAssertion": { + "file": "./tests/tests/range_check/assert_ge_big_constant.zok", + "position": { + "line": 4, + "col": 5 + } + } + } + } + } + } + }, + { + "input": { + "values": [ + "21888242871839275222246405745257275088548364400416034343698204186575808495614" + ] + }, + "output": { + "Err": { + "UnsatisfiedConstraint": { + "error": { + "SourceAssertion": { + "file": "./tests/tests/range_check/assert_ge_big_constant.zok", + "position": { + "line": 4, + "col": 5 + } + } + } + } + } + } + }, + { + "input": { + "values": [ + "21888242871839275222246405745257275088548364400416034343698204186575808495615" + ] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": [ + "21888242871839275222246405745257275088548364400416034343698204186575808495616" + ] + }, + "output": { + "Ok": { + "value": [] + } + } + } + ] +} diff --git a/zokrates_core_test/tests/tests/range_check/assert_ge_big_constant.zok b/zokrates_core_test/tests/tests/range_check/assert_ge_big_constant.zok new file mode 100644 index 000000000..5bf61eaeb --- /dev/null +++ b/zokrates_core_test/tests/tests/range_check/assert_ge_big_constant.zok @@ -0,0 +1,5 @@ +from "field" import FIELD_MAX; + +def main(field x) { + assert(x >= FIELD_MAX - 1); +} \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/range_check/assert_ge.json b/zokrates_core_test/tests/tests/range_check/assert_ge_constant.json similarity index 82% rename from zokrates_core_test/tests/tests/range_check/assert_ge.json rename to zokrates_core_test/tests/tests/range_check/assert_ge_constant.json index 21f8219b0..feaae4e8b 100644 --- a/zokrates_core_test/tests/tests/range_check/assert_ge.json +++ b/zokrates_core_test/tests/tests/range_check/assert_ge_constant.json @@ -1,5 +1,5 @@ { - "entry_point": "./tests/tests/range_check/assert_ge.zok", + "entry_point": "./tests/tests/range_check/assert_ge_constant.zok", "max_constraint_count": 509, "curves": ["Bn128"], "tests": [ @@ -12,7 +12,7 @@ "UnsatisfiedConstraint": { "error": { "SourceAssertion": { - "file": "./tests/tests/range_check/assert_ge.zok", + "file": "./tests/tests/range_check/assert_ge_constant.zok", "position": { "line": 2, "col": 5 @@ -32,7 +32,7 @@ "UnsatisfiedConstraint": { "error": { "SourceAssertion": { - "file": "./tests/tests/range_check/assert_ge.zok", + "file": "./tests/tests/range_check/assert_ge_constant.zok", "position": { "line": 2, "col": 5 diff --git a/zokrates_core_test/tests/tests/range_check/assert_ge.zok b/zokrates_core_test/tests/tests/range_check/assert_ge_constant.zok similarity index 77% rename from zokrates_core_test/tests/tests/range_check/assert_ge.zok rename to zokrates_core_test/tests/tests/range_check/assert_ge_constant.zok index db5af3ea3..93e8f4eed 100644 --- a/zokrates_core_test/tests/tests/range_check/assert_ge.zok +++ b/zokrates_core_test/tests/tests/range_check/assert_ge_constant.zok @@ -1,4 +1,3 @@ def main(field x) { assert(x >= 2); - return; } \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/range_check/assert_gt_big_constant.zok b/zokrates_core_test/tests/tests/range_check/assert_gt_big_constant.zok index c3c5a123c..1767bd87f 100644 --- a/zokrates_core_test/tests/tests/range_check/assert_gt_big_constant.zok +++ b/zokrates_core_test/tests/tests/range_check/assert_gt_big_constant.zok @@ -2,5 +2,4 @@ from "field" import FIELD_MAX; def main(field x) { assert(x > FIELD_MAX - 1); - return; } \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/range_check/assert_gt.json b/zokrates_core_test/tests/tests/range_check/assert_gt_constant.json similarity index 81% rename from zokrates_core_test/tests/tests/range_check/assert_gt.json rename to zokrates_core_test/tests/tests/range_check/assert_gt_constant.json index 7e800f8bb..aed5724f7 100644 --- a/zokrates_core_test/tests/tests/range_check/assert_gt.json +++ b/zokrates_core_test/tests/tests/range_check/assert_gt_constant.json @@ -1,5 +1,5 @@ { - "entry_point": "./tests/tests/range_check/assert_gt.zok", + "entry_point": "./tests/tests/range_check/assert_gt_constant.zok", "max_constraint_count": 508, "curves": ["Bn128"], "tests": [ @@ -12,7 +12,7 @@ "UnsatisfiedConstraint": { "error": { "SourceAssertion": { - "file": "./tests/tests/range_check/assert_gt.zok", + "file": "./tests/tests/range_check/assert_gt_constant.zok", "position": { "line": 2, "col": 5 @@ -32,7 +32,7 @@ "UnsatisfiedConstraint": { "error": { "SourceAssertion": { - "file": "./tests/tests/range_check/assert_gt.zok", + "file": "./tests/tests/range_check/assert_gt_constant.zok", "position": { "line": 2, "col": 5 @@ -52,7 +52,7 @@ "UnsatisfiedConstraint": { "error": { "SourceAssertion": { - "file": "./tests/tests/range_check/assert_gt.zok", + "file": "./tests/tests/range_check/assert_gt_constant.zok", "position": { "line": 2, "col": 5 diff --git a/zokrates_core_test/tests/tests/range_check/assert_gt.zok b/zokrates_core_test/tests/tests/range_check/assert_gt_constant.zok similarity index 76% rename from zokrates_core_test/tests/tests/range_check/assert_gt.zok rename to zokrates_core_test/tests/tests/range_check/assert_gt_constant.zok index 0e4dfee82..fcf042b62 100644 --- a/zokrates_core_test/tests/tests/range_check/assert_gt.zok +++ b/zokrates_core_test/tests/tests/range_check/assert_gt_constant.zok @@ -1,4 +1,3 @@ def main(field x) { assert(x > 2); - return; } \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/range_check/assert_le.json b/zokrates_core_test/tests/tests/range_check/assert_le.json index 694379525..54cbda366 100644 --- a/zokrates_core_test/tests/tests/range_check/assert_le.json +++ b/zokrates_core_test/tests/tests/range_check/assert_le.json @@ -1,11 +1,11 @@ { "entry_point": "./tests/tests/range_check/assert_le.zok", - "max_constraint_count": 5, + "max_constraint_count": 763, "curves": ["Bn128"], "tests": [ { "input": { - "values": ["1"] + "values": ["1", "2"] }, "output": { "Ok": { @@ -15,7 +15,7 @@ }, { "input": { - "values": ["2"] + "values": ["2", "2"] }, "output": { "Ok": { @@ -25,7 +25,23 @@ }, { "input": { - "values": ["3"] + "values": [ + "1", + "7237005577332262213973186563042994240829374041602535252466099000494570602495" + ] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": [ + "7237005577332262213973186563042994240829374041602535252466099000494570602495", + "1" + ] }, "output": { "Err": { @@ -45,20 +61,30 @@ }, { "input": { - "values": ["15"] + "values": [ + "1", + "7237005577332262213973186563042994240829374041602535252466099000494570602496" + ] }, "output": { "Err": { "UnsatisfiedConstraint": { - "error": { - "SourceAssertion": { - "file": "./tests/tests/range_check/assert_le.zok", - "position": { - "line": 2, - "col": 5 - } - } - } + "error": "IncompleteDynamicRange" + } + } + } + }, + { + "input": { + "values": [ + "7237005577332262213973186563042994240829374041602535252466099000494570602496", + "1" + ] + }, + "output": { + "Err": { + "UnsatisfiedConstraint": { + "error": "IncompleteDynamicRange" } } } diff --git a/zokrates_core_test/tests/tests/range_check/assert_le.zok b/zokrates_core_test/tests/tests/range_check/assert_le.zok index c86524015..106ff4a0f 100644 --- a/zokrates_core_test/tests/tests/range_check/assert_le.zok +++ b/zokrates_core_test/tests/tests/range_check/assert_le.zok @@ -1,4 +1,3 @@ -def main(field x) { - assert(x <= 2); - return; +def main(field a, field b) { + assert(a <= b); } \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/range_check/assert_le_big_constant.json b/zokrates_core_test/tests/tests/range_check/assert_le_big_constant.json new file mode 100644 index 000000000..b4fef5d5d --- /dev/null +++ b/zokrates_core_test/tests/tests/range_check/assert_le_big_constant.json @@ -0,0 +1,63 @@ +{ + "entry_point": "./tests/tests/range_check/assert_le_big_constant.zok", + "max_constraint_count": 508, + "curves": ["Bn128"], + "tests": [ + { + "input": { + "values": ["0"] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": [ + "21888242871839275222246405745257275088548364400416034343698204186575808495614" + ] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": [ + "21888242871839275222246405745257275088548364400416034343698204186575808495615" + ] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": [ + "21888242871839275222246405745257275088548364400416034343698204186575808495616" + ] + }, + "output": { + "Err": { + "UnsatisfiedConstraint": { + "error": { + "SourceAssertion": { + "file": "./tests/tests/range_check/assert_le_big_constant.zok", + "position": { + "line": 4, + "col": 5 + } + } + } + } + } + } + } + ] +} diff --git a/zokrates_core_test/tests/tests/range_check/assert_le_big_constant.zok b/zokrates_core_test/tests/tests/range_check/assert_le_big_constant.zok new file mode 100644 index 000000000..1ebbe6742 --- /dev/null +++ b/zokrates_core_test/tests/tests/range_check/assert_le_big_constant.zok @@ -0,0 +1,5 @@ +from "field" import FIELD_MAX; + +def main(field x) { + assert(x <= FIELD_MAX - 1); +} \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/range_check/assert_le_constant.json b/zokrates_core_test/tests/tests/range_check/assert_le_constant.json new file mode 100644 index 000000000..485a7e08e --- /dev/null +++ b/zokrates_core_test/tests/tests/range_check/assert_le_constant.json @@ -0,0 +1,67 @@ +{ + "entry_point": "./tests/tests/range_check/assert_le_constant.zok", + "max_constraint_count": 5, + "curves": ["Bn128"], + "tests": [ + { + "input": { + "values": ["1"] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": ["2"] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": ["3"] + }, + "output": { + "Err": { + "UnsatisfiedConstraint": { + "error": { + "SourceAssertion": { + "file": "./tests/tests/range_check/assert_le_constant.zok", + "position": { + "line": 2, + "col": 5 + } + } + } + } + } + } + }, + { + "input": { + "values": ["15"] + }, + "output": { + "Err": { + "UnsatisfiedConstraint": { + "error": { + "SourceAssertion": { + "file": "./tests/tests/range_check/assert_le_constant.zok", + "position": { + "line": 2, + "col": 5 + } + } + } + } + } + } + } + ] +} diff --git a/zokrates_core_test/tests/tests/range_check/assert_le_constant.zok b/zokrates_core_test/tests/tests/range_check/assert_le_constant.zok new file mode 100644 index 000000000..5046efe5a --- /dev/null +++ b/zokrates_core_test/tests/tests/range_check/assert_le_constant.zok @@ -0,0 +1,3 @@ +def main(field x) { + assert(x <= 2); +} \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/range_check/assert_le_u8.json b/zokrates_core_test/tests/tests/range_check/assert_le_u8.json new file mode 100644 index 000000000..c4c746b06 --- /dev/null +++ b/zokrates_core_test/tests/tests/range_check/assert_le_u8.json @@ -0,0 +1,47 @@ +{ + "entry_point": "./tests/tests/range_check/assert_le_u8.zok", + "max_constraint_count": 31, + "curves": ["Bn128"], + "tests": [ + { + "input": { + "values": ["0x01", "0x02"] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": ["0x02", "0x02"] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": ["0x04", "0x02"] + }, + "output": { + "Err": { + "UnsatisfiedConstraint": { + "error": { + "SourceAssertion": { + "file": "./tests/tests/range_check/assert_le_u8.zok", + "position": { + "line": 2, + "col": 5 + } + } + } + } + } + } + } + ] +} diff --git a/zokrates_core_test/tests/tests/range_check/assert_le_u8.zok b/zokrates_core_test/tests/tests/range_check/assert_le_u8.zok new file mode 100644 index 000000000..3f2edab47 --- /dev/null +++ b/zokrates_core_test/tests/tests/range_check/assert_le_u8.zok @@ -0,0 +1,3 @@ +def main(u8 a, u8 b) { + assert(a <= b); +} \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/range_check/assert_le_u8_constant.json b/zokrates_core_test/tests/tests/range_check/assert_le_u8_constant.json new file mode 100644 index 000000000..74f8867d0 --- /dev/null +++ b/zokrates_core_test/tests/tests/range_check/assert_le_u8_constant.json @@ -0,0 +1,57 @@ +{ + "entry_point": "./tests/tests/range_check/assert_le_u8_constant.zok", + "max_constraint_count": 12, + "curves": ["Bn128"], + "tests": [ + { + "input": { + "values": ["0x00"] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": ["0x01"] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": ["0x02"] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": ["0x0f"] + }, + "output": { + "Err": { + "UnsatisfiedConstraint": { + "error": { + "SourceAssertion": { + "file": "./tests/tests/range_check/assert_le_u8_constant.zok", + "position": { + "line": 2, + "col": 5 + } + } + } + } + } + } + } + ] +} diff --git a/zokrates_core_test/tests/tests/range_check/assert_le_u8_constant.zok b/zokrates_core_test/tests/tests/range_check/assert_le_u8_constant.zok new file mode 100644 index 000000000..7c02e7214 --- /dev/null +++ b/zokrates_core_test/tests/tests/range_check/assert_le_u8_constant.zok @@ -0,0 +1,3 @@ +def main(u8 x) { + assert(x <= 2); +} \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/range_check/assert_lt.json b/zokrates_core_test/tests/tests/range_check/assert_lt.json index 05c0e90eb..a788b6ee0 100644 --- a/zokrates_core_test/tests/tests/range_check/assert_lt.json +++ b/zokrates_core_test/tests/tests/range_check/assert_lt.json @@ -1,11 +1,11 @@ { "entry_point": "./tests/tests/range_check/assert_lt.zok", - "max_constraint_count": 4, + "max_constraint_count": 764, "curves": ["Bn128"], "tests": [ { "input": { - "values": ["0"] + "values": ["1", "2"] }, "output": { "Ok": { @@ -15,7 +15,10 @@ }, { "input": { - "values": ["1"] + "values": [ + "1", + "7237005577332262213973186563042994240829374041602535252466099000494570602495" + ] }, "output": { "Ok": { @@ -25,7 +28,10 @@ }, { "input": { - "values": ["2"] + "values": [ + "7237005577332262213973186563042994240829374041602535252466099000494570602495", + "1" + ] }, "output": { "Err": { @@ -45,20 +51,30 @@ }, { "input": { - "values": ["15"] + "values": [ + "1", + "7237005577332262213973186563042994240829374041602535252466099000494570602496" + ] }, "output": { "Err": { "UnsatisfiedConstraint": { - "error": { - "SourceAssertion": { - "file": "./tests/tests/range_check/assert_lt.zok", - "position": { - "line": 2, - "col": 5 - } - } - } + "error": "IncompleteDynamicRange" + } + } + } + }, + { + "input": { + "values": [ + "7237005577332262213973186563042994240829374041602535252466099000494570602496", + "1" + ] + }, + "output": { + "Err": { + "UnsatisfiedConstraint": { + "error": "IncompleteDynamicRange" } } } diff --git a/zokrates_core_test/tests/tests/range_check/assert_lt.zok b/zokrates_core_test/tests/tests/range_check/assert_lt.zok index cba29894b..cce1a6a7c 100644 --- a/zokrates_core_test/tests/tests/range_check/assert_lt.zok +++ b/zokrates_core_test/tests/tests/range_check/assert_lt.zok @@ -1,4 +1,3 @@ -def main(field x) { - assert(x < 2); - return; +def main(field a, field b) { + assert(a < b); } \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/range_check/assert_lt_big_constant.zok b/zokrates_core_test/tests/tests/range_check/assert_lt_big_constant.zok index 5e05a8c07..f8f804442 100644 --- a/zokrates_core_test/tests/tests/range_check/assert_lt_big_constant.zok +++ b/zokrates_core_test/tests/tests/range_check/assert_lt_big_constant.zok @@ -2,5 +2,4 @@ from "field" import FIELD_MAX; def main(field x) { assert(x < FIELD_MAX - 1); - return; } \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/range_check/assert_lt_constant.json b/zokrates_core_test/tests/tests/range_check/assert_lt_constant.json new file mode 100644 index 000000000..19b100024 --- /dev/null +++ b/zokrates_core_test/tests/tests/range_check/assert_lt_constant.json @@ -0,0 +1,67 @@ +{ + "entry_point": "./tests/tests/range_check/assert_lt_constant.zok", + "max_constraint_count": 4, + "curves": ["Bn128"], + "tests": [ + { + "input": { + "values": ["0"] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": ["1"] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": ["2"] + }, + "output": { + "Err": { + "UnsatisfiedConstraint": { + "error": { + "SourceAssertion": { + "file": "./tests/tests/range_check/assert_lt_constant.zok", + "position": { + "line": 2, + "col": 5 + } + } + } + } + } + } + }, + { + "input": { + "values": ["15"] + }, + "output": { + "Err": { + "UnsatisfiedConstraint": { + "error": { + "SourceAssertion": { + "file": "./tests/tests/range_check/assert_lt_constant.zok", + "position": { + "line": 2, + "col": 5 + } + } + } + } + } + } + } + ] +} diff --git a/zokrates_core_test/tests/tests/range_check/assert_lt_constant.zok b/zokrates_core_test/tests/tests/range_check/assert_lt_constant.zok new file mode 100644 index 000000000..bbbe9adf7 --- /dev/null +++ b/zokrates_core_test/tests/tests/range_check/assert_lt_constant.zok @@ -0,0 +1,3 @@ +def main(field x) { + assert(x < 2); +} \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/range_check/assert_lt_u8.json b/zokrates_core_test/tests/tests/range_check/assert_lt_u8.json index cad68703b..6126fe637 100644 --- a/zokrates_core_test/tests/tests/range_check/assert_lt_u8.json +++ b/zokrates_core_test/tests/tests/range_check/assert_lt_u8.json @@ -1,11 +1,11 @@ { "entry_point": "./tests/tests/range_check/assert_lt_u8.zok", - "max_constraint_count": 9, + "max_constraint_count": 29, "curves": ["Bn128"], "tests": [ { "input": { - "values": ["0x00"] + "values": ["0x01", "0x02"] }, "output": { "Ok": { @@ -15,17 +15,7 @@ }, { "input": { - "values": ["0x01"] - }, - "output": { - "Ok": { - "value": [] - } - } - }, - { - "input": { - "values": ["0x02"] + "values": ["0x02", "0x02"] }, "output": { "Err": { @@ -45,7 +35,7 @@ }, { "input": { - "values": ["0x0f"] + "values": ["0x04", "0x02"] }, "output": { "Err": { diff --git a/zokrates_core_test/tests/tests/range_check/assert_lt_u8.zok b/zokrates_core_test/tests/tests/range_check/assert_lt_u8.zok index cba29894b..f71b1b82e 100644 --- a/zokrates_core_test/tests/tests/range_check/assert_lt_u8.zok +++ b/zokrates_core_test/tests/tests/range_check/assert_lt_u8.zok @@ -1,4 +1,3 @@ -def main(field x) { - assert(x < 2); - return; +def main(u8 a, u8 b) { + assert(a < b); } \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/range_check/assert_lt_u8_constant.json b/zokrates_core_test/tests/tests/range_check/assert_lt_u8_constant.json new file mode 100644 index 000000000..c1f497ea9 --- /dev/null +++ b/zokrates_core_test/tests/tests/range_check/assert_lt_u8_constant.json @@ -0,0 +1,67 @@ +{ + "entry_point": "./tests/tests/range_check/assert_lt_u8_constant.zok", + "max_constraint_count": 10, + "curves": ["Bn128"], + "tests": [ + { + "input": { + "values": ["0x00"] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": ["0x01"] + }, + "output": { + "Ok": { + "value": [] + } + } + }, + { + "input": { + "values": ["0x02"] + }, + "output": { + "Err": { + "UnsatisfiedConstraint": { + "error": { + "SourceAssertion": { + "file": "./tests/tests/range_check/assert_lt_u8_constant.zok", + "position": { + "line": 2, + "col": 5 + } + } + } + } + } + } + }, + { + "input": { + "values": ["0x0f"] + }, + "output": { + "Err": { + "UnsatisfiedConstraint": { + "error": { + "SourceAssertion": { + "file": "./tests/tests/range_check/assert_lt_u8_constant.zok", + "position": { + "line": 2, + "col": 5 + } + } + } + } + } + } + } + ] +} diff --git a/zokrates_core_test/tests/tests/range_check/assert_lt_u8_constant.zok b/zokrates_core_test/tests/tests/range_check/assert_lt_u8_constant.zok new file mode 100644 index 000000000..7b52a6dee --- /dev/null +++ b/zokrates_core_test/tests/tests/range_check/assert_lt_u8_constant.zok @@ -0,0 +1,3 @@ +def main(u8 x) { + assert(x < 2); +} \ No newline at end of file