From 79874623cf86d92325c26ccafc31413d12e9d248 Mon Sep 17 00:00:00 2001 From: DaysSky <88261516+DaysSky@users.noreply.github.com> Date: Sun, 11 Oct 2026 14:42:56 +0900 Subject: [PATCH] e8-seven-stage-halving-two: complex idle climbs at halving degree two, kappa 9.5424356568133e-4 PR #373's seven-stage E8 bit and complex suppliers, with the complex supplier's two longest idle climbs left unsplit (max child 38 of m = 63, halving degree two: 63^2 > 2 * 38^2). The complex finite guard computes the least halving degree t and charges t times the stock logarithm in the external row coefficient (2 * 1903 + 9909 + 252 = 13967 < 20161), keeping m <= 72; t = 1 is the original guard. Complex b = 119394377245827/(125 * 10^15) (+2.40 % over the split B_3); complex-bound kappa = 95424356568133/10^17 (+2.40 % over PR #373). B_2, the split B_3 and PR #373's kappa are regressions. --- .gitattributes | 2 + .../workflows/e8-seven-stage-halving-two.yml | 39 + research/e8-seven-stage-halving-two/LICENSE | 201 + .../MANIFEST.sha256 | 163 + .../NOTICE-PR352.md | 33 + research/e8-seven-stage-halving-two/NOTICE.md | 57 + research/e8-seven-stage-halving-two/README.md | 168 + .../SOURCE-pr363.json | 14 + .../SOURCE-pr370.json | 152 + .../SOURCE-pr373.json | 24 + .../code/bit/checkers/certify_bit_g.py | 46 + .../code/bit/checkers/certify_bit_k.py | 54 + .../code/bit/checkers/columns_h.cpp | 48 + .../code/bit/checkers/columns_k.cpp | 62 + .../code/bit/checkers/cost.py | 62 + .../code/bit/checkers/exactnd_h.py | 44 + .../code/bit/checkers/finite_g.py | 146 + .../code/bit/checkers/finite_k.py | 152 + .../code/bit/checkers/geometry_g.py | 137 + .../code/bit/checkers/geometry_k.py | 157 + .../code/bit/checkers/gram_frames.py | 54 + .../code/bit/checkers/json.hpp | 25526 ++++++++++++++++ .../code/bit/checkers/legality_h.cpp | 13 + .../code/bit/checkers/tile_g.py | 40 + .../code/bit/checkers/tile_k.py | 41 + .../code/bit/export_records.py | 72 + .../code/bit/independent/centres_sat.py | 34 + .../code/bit/independent/checkword.py | 143 + .../code/bit/independent/mutate.py | 31 + .../code/bit/mutate_records.py | 34 + .../code/bit/producer/compile.py | 201 + .../code/bit/producer/compile2.py | 142 + .../code/bit/producer/e8lib.py | 79 + .../code/bit/producer/frames.py | 45 + .../code/bit/producer/fullword.py | 75 + .../code/bit/producer/ham1.py | 81 + .../code/bit/producer/ham2.py | 131 + .../code/bit/producer/params-r865.json | 2082 ++ .../code/bit/producer/price.py | 23 + .../code/bit/producer/search2.py | 44 + .../code/bit/receipts_e8.py | 23 + .../code/bit/receipts_k.py | 24 + .../code/bit/regression/certify_bit.py | 45 + .../code/bit/regression/columns_h_pr346.cpp | 42 + .../code/bit/regression/cost.py | 62 + .../code/bit/regression/json.hpp | 25526 ++++++++++++++++ .../code/bit/regression/legality_h_pr346.cpp | 7 + .../code/bit/regression/prime_new.py | 23 + .../code/bit/regression/prime_witnesses.py | 99 + .../code/bit/regression/stage_cohort.py | 12 + .../code/bit/regression/tile_check.py | 38 + .../code/certify_b3.py | 83 + .../code/complex/code/bridged.py | 105 + .../code/complex/code/complex_basis.py | 35 + .../code/complex/code/complex_gx.py | 77 + .../code/complex/code/complex_labels.py | 185 + .../code/complex/code/complex_scalars.py | 219 + .../code/complex/code/complex_splice.py | 284 + .../code/complex/code/p10pins.py | 15 + .../code/complex/code/scatter.py | 33 + .../code/complex/inputs/complex/LICENSE | 201 + .../code/complex/inputs/complex/NOTICE | 290 + .../inputs/complex/retained/FINITE_BRIDGE.txt | 141 + .../retained/compact-control-layout.tex | 118 + .../retained/compact-control-movement.tex | 167 + .../retained/copied-centers-assembly.tex | 118 + .../complex/retained/copied-centers-lemma.tex | 103 + .../retained/endpoint-gauge-complex.tex | 225 + .../retained/general-clifford-frames.tex | 102 + .../retained/stopped-product-complex.tex | 137 + .../complex/inputs/complex/source-pins.json | 482 + .../complex/sources/Work__Bridge__Cert.lean | 241 + .../complex/sources/Work__Bridge__Net.lean | 345 + .../complex/sources/Work__Carrier__Live.lean | 232 + .../sources/Work__Carrier__Phases.lean | 192 + .../complex/sources/Work__Fourier__Main.lean | 176 + .../sources/Work__GCert__Chain__Geom.lean | 210 + .../sources/Work__GCert__Chain__InvThm.lean | 164 + .../sources/Work__GCert__Chain__NetCert.lean | 157 + .../sources/Work__GCert__Chain__NetDef.lean | 157 + .../sources/Work__GCert__Chain__NetStage.lean | 186 + .../sources/Work__GCert__Chain__Phased.lean | 199 + .../sources/Work__GCert__Chain__WinB.lean | 132 + .../Work__GCert__Data__B2Gp193Main.lean | 33 + .../sources/Work__GCert__Data__Glue.lean | 97 + .../Work__GCert__Data__InstB2Gp193.lean | 55 + .../sources/Work__GCert__Data__P193Cert.lean | 81 + .../sources/Work__GCert__Data__P193Price.lean | 54 + .../Work__GCert__Data__P193ScalOK.lean | 17 + .../Work__GCert__Data__RateB2Gp193x.lean | 327 + .../sources/Work__GCert__Data__Raw.lean | 93 + .../Work__GCert__Data__SolutionB2Gp193x.lean | 38 + .../sources/Work__GFrame__Engine__Adapt.lean | 183 + .../Work__GFrame__Engine__Letters.lean | 199 + .../sources/Work__GFrame__Engine__Level.lean | 163 + .../complex/sources/tools__gx__ORIGIN.md | 64 + .../inputs/complex/sources/tools__gx__gx.py | 296 + .../complex/sources/tools__gx__gxbind.py | 438 + .../complex/sources/tools__gx__gxconv.py | 131 + .../complex/sources/tools__gx__gxcore.py | 375 + .../code/complex/inputs/e8/LICENSE | 201 + .../code/complex/inputs/e8/NOTICE | 489 + .../inputs/e8/Work/GCert/Data/B2Ge8.lean | 103 + .../inputs/e8/Work/GCert/Data/B2Ge8Main.lean | 33 + .../e8/Work/GCert/Data/ChallengeB2Ge8x.lean | 331 + .../inputs/e8/Work/GCert/Data/E8Cert.lean | 78 + .../inputs/e8/Work/GCert/Data/E8Price.lean | 54 + .../inputs/e8/Work/GCert/Data/E8ScalOK.lean | 15 + .../inputs/e8/Work/GCert/Data/Gen/E8.lean | 12 + .../inputs/e8/Work/GCert/Data/Gen/E8/S0.lean | 128 + .../inputs/e8/Work/GCert/Data/Gen/E8End.lean | 10 + .../inputs/e8/Work/GCert/Data/Gen/E8Hist.lean | 46 + .../inputs/e8/Work/GCert/Data/Gen/E8Par.lean | 8 + .../e8/Work/GCert/Data/Gen/E8Scal0.lean | 10 + .../inputs/e8/Work/GCert/Data/Gen/E8Seg0.lean | 9 + .../inputs/e8/Work/GCert/Data/Gen/E8Seg1.lean | 9 + .../inputs/e8/Work/GCert/Data/Gen/E8SegF.lean | 9 + .../inputs/e8/Work/GCert/Data/Gen/E8Tab0.lean | 10 + .../inputs/e8/Work/GCert/Data/Gen/E8Tab1.lean | 10 + .../inputs/e8/Work/GCert/Data/Gen/E8Tab2.lean | 10 + .../inputs/e8/Work/GCert/Data/Gen/E8Tab3.lean | 10 + .../inputs/e8/Work/GCert/Data/Gen/E8YChk.lean | 10 + .../inputs/e8/Work/GCert/Data/InstB2Ge8.lean | 55 + .../inputs/e8/Work/GCert/Data/RateB2Ge8.lean | 207 + .../inputs/e8/Work/GCert/Data/RateB2Ge8x.lean | 207 + .../e8/Work/GCert/Data/SolutionB2Ge8x.lean | 38 + .../complex/inputs/e8/comparator/B2Ge8x.json | 14 + .../tools/certificate/gcert1-e8-r783.json.gz | Bin 0 -> 21883 bytes .../code/complex/inputs/e8/tools/e8/replay.py | 797 + .../complex/inputs/e8/tools/gen/foldgen.py | 128 + .../complex/inputs/e8/tools/gen/foldlib.py | 146 + .../complex/inputs/e8/tools/gen/gen_rates.py | 30 + .../complex/inputs/e8/tools/gen/gen_sharp.py | 33 + .../gen/templates/ChallengeB2L16x.lean.txt | 331 + .../gen/templates/SolutionB2L16x.lean.txt | 38 + .../complex/inputs/e8/tools/gx/gsmirror.py | 332 + .../code/complex/inputs/e8/tools/gx/gxbind.py | 438 + .../code/complex/inputs/e8/tools/gx/gxcore.py | 375 + .../code/complex/inputs/e8/tools/gx/gxgen.py | 256 + .../complex/inputs/e8/tools/gx/gxpaths.py | 21 + .../code/complex/inputs/e8/tools/gx/gxrate.py | 195 + .../code/complex/inputs/e8/tools/gx/gxunit.py | 47 + .../complex/inputs/e8/tools/gx/regen_check.py | 80 + .../inputs/e8/tools/gx/regen_check_e8.py | 41 + .../code/complex/pins-e8-b3.json | 59 + .../code/complex/pins-e8-b3h.json | 60 + .../code/complex/pins-e8.json | 58 + .../code/complex/portable_complex.py | 170 + .../code/pricing/base_two_moment.py | 63 + .../code/pricing/moment.py | 113 + .../code/pricing/outer.py | 58 + .../code/pricing/prime_witnesses.py | 99 + .../code/provenance.py | 13 + .../data/bit/RECORD-SHA256SUMS | 3 + .../data/bit/bitE8-r865.json.gz | Bin 0 -> 33865 bytes .../data/regression-p10/BASE-RECORDS.bin.gz | Bin 0 -> 1466081 bytes .../data/regression-p10/BASE-frames.json.gz | Bin 0 -> 311369 bytes .../data/regression-p10/BASE-states.json.gz | Bin 0 -> 61146 bytes .../receipts-loans/banks.json.gz | Bin 0 -> 4563 bytes .../receipts-loans/finite.json.gz | Bin 0 -> 2176 bytes .../receipts-loans/global_result.json.gz | Bin 0 -> 1267 bytes .../receipts-loans/math.json.gz | Bin 0 -> 3710 bytes .../regression-p10/receipts-loans/raw.json.gz | Bin 0 -> 115683 bytes .../receipts-loans/scalar.json.gz | Bin 0 -> 1505 bytes .../requirements.txt | 3 + research/e8-seven-stage-halving-two/verify.sh | 121 + 166 files changed, 70932 insertions(+) create mode 100644 .github/workflows/e8-seven-stage-halving-two.yml create mode 100644 research/e8-seven-stage-halving-two/LICENSE create mode 100644 research/e8-seven-stage-halving-two/MANIFEST.sha256 create mode 100644 research/e8-seven-stage-halving-two/NOTICE-PR352.md create mode 100644 research/e8-seven-stage-halving-two/NOTICE.md create mode 100644 research/e8-seven-stage-halving-two/README.md create mode 100644 research/e8-seven-stage-halving-two/SOURCE-pr363.json create mode 100644 research/e8-seven-stage-halving-two/SOURCE-pr370.json create mode 100644 research/e8-seven-stage-halving-two/SOURCE-pr373.json create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/certify_bit_g.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/certify_bit_k.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/columns_h.cpp create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/columns_k.cpp create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/cost.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/exactnd_h.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/finite_g.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/finite_k.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/geometry_g.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/geometry_k.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/gram_frames.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/json.hpp create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/legality_h.cpp create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/tile_g.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/checkers/tile_k.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/export_records.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/independent/centres_sat.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/independent/checkword.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/independent/mutate.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/mutate_records.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/producer/compile.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/producer/compile2.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/producer/e8lib.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/producer/frames.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/producer/fullword.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/producer/ham1.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/producer/ham2.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/producer/params-r865.json create mode 100644 research/e8-seven-stage-halving-two/code/bit/producer/price.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/producer/search2.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/receipts_e8.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/receipts_k.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/regression/certify_bit.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/regression/columns_h_pr346.cpp create mode 100644 research/e8-seven-stage-halving-two/code/bit/regression/cost.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/regression/json.hpp create mode 100644 research/e8-seven-stage-halving-two/code/bit/regression/legality_h_pr346.cpp create mode 100644 research/e8-seven-stage-halving-two/code/bit/regression/prime_new.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/regression/prime_witnesses.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/regression/stage_cohort.py create mode 100644 research/e8-seven-stage-halving-two/code/bit/regression/tile_check.py create mode 100644 research/e8-seven-stage-halving-two/code/certify_b3.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/code/bridged.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/code/complex_basis.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/code/complex_gx.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/code/complex_labels.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/code/complex_scalars.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/code/complex_splice.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/code/p10pins.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/code/scatter.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/LICENSE create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/NOTICE create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/retained/FINITE_BRIDGE.txt create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/retained/compact-control-layout.tex create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/retained/compact-control-movement.tex create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/retained/copied-centers-assembly.tex create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/retained/copied-centers-lemma.tex create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/retained/endpoint-gauge-complex.tex create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/retained/general-clifford-frames.tex create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/retained/stopped-product-complex.tex create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/source-pins.json create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__Bridge__Cert.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__Bridge__Net.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__Carrier__Live.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__Carrier__Phases.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__Fourier__Main.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Chain__Geom.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Chain__InvThm.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Chain__NetCert.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Chain__NetDef.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Chain__NetStage.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Chain__Phased.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Chain__WinB.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Data__B2Gp193Main.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Data__Glue.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Data__InstB2Gp193.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Data__P193Cert.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Data__P193Price.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Data__P193ScalOK.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Data__RateB2Gp193x.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Data__Raw.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GCert__Data__SolutionB2Gp193x.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GFrame__Engine__Adapt.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GFrame__Engine__Letters.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/Work__GFrame__Engine__Level.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/tools__gx__ORIGIN.md create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/tools__gx__gx.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/tools__gx__gxbind.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/tools__gx__gxconv.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/complex/sources/tools__gx__gxcore.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/LICENSE create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/NOTICE create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/B2Ge8.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/B2Ge8Main.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/ChallengeB2Ge8x.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/E8Cert.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/E8Price.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/E8ScalOK.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/Gen/E8.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/Gen/E8/S0.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/Gen/E8End.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/Gen/E8Hist.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/Gen/E8Par.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/Gen/E8Scal0.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/Gen/E8Seg0.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/Gen/E8Seg1.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/Gen/E8SegF.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/Gen/E8Tab0.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/Gen/E8Tab1.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/Gen/E8Tab2.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/Gen/E8Tab3.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/Gen/E8YChk.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/InstB2Ge8.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/RateB2Ge8.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/RateB2Ge8x.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/Work/GCert/Data/SolutionB2Ge8x.lean create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/comparator/B2Ge8x.json create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/certificate/gcert1-e8-r783.json.gz create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/e8/replay.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gen/foldgen.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gen/foldlib.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gen/gen_rates.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gen/gen_sharp.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gen/templates/ChallengeB2L16x.lean.txt create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gen/templates/SolutionB2L16x.lean.txt create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gx/gsmirror.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gx/gxbind.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gx/gxcore.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gx/gxgen.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gx/gxpaths.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gx/gxrate.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gx/gxunit.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gx/regen_check.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/inputs/e8/tools/gx/regen_check_e8.py create mode 100644 research/e8-seven-stage-halving-two/code/complex/pins-e8-b3.json create mode 100644 research/e8-seven-stage-halving-two/code/complex/pins-e8-b3h.json create mode 100644 research/e8-seven-stage-halving-two/code/complex/pins-e8.json create mode 100644 research/e8-seven-stage-halving-two/code/complex/portable_complex.py create mode 100644 research/e8-seven-stage-halving-two/code/pricing/base_two_moment.py create mode 100644 research/e8-seven-stage-halving-two/code/pricing/moment.py create mode 100644 research/e8-seven-stage-halving-two/code/pricing/outer.py create mode 100644 research/e8-seven-stage-halving-two/code/pricing/prime_witnesses.py create mode 100644 research/e8-seven-stage-halving-two/code/provenance.py create mode 100644 research/e8-seven-stage-halving-two/data/bit/RECORD-SHA256SUMS create mode 100644 research/e8-seven-stage-halving-two/data/bit/bitE8-r865.json.gz create mode 100644 research/e8-seven-stage-halving-two/data/regression-p10/BASE-RECORDS.bin.gz create mode 100644 research/e8-seven-stage-halving-two/data/regression-p10/BASE-frames.json.gz create mode 100644 research/e8-seven-stage-halving-two/data/regression-p10/BASE-states.json.gz create mode 100644 research/e8-seven-stage-halving-two/data/regression-p10/receipts-loans/banks.json.gz create mode 100644 research/e8-seven-stage-halving-two/data/regression-p10/receipts-loans/finite.json.gz create mode 100644 research/e8-seven-stage-halving-two/data/regression-p10/receipts-loans/global_result.json.gz create mode 100644 research/e8-seven-stage-halving-two/data/regression-p10/receipts-loans/math.json.gz create mode 100644 research/e8-seven-stage-halving-two/data/regression-p10/receipts-loans/raw.json.gz create mode 100644 research/e8-seven-stage-halving-two/data/regression-p10/receipts-loans/scalar.json.gz create mode 100644 research/e8-seven-stage-halving-two/requirements.txt create mode 100644 research/e8-seven-stage-halving-two/verify.sh diff --git a/.gitattributes b/.gitattributes index 6825630198..6e1a67dae4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -18,3 +18,5 @@ research/coordinated-frames-and-entrance-banks/** -text -whitespace # Frozen PR210 package and round-nine evidence retain their audited bytes. research/five-stage-source527-banks/** -text -whitespace research/community-round9-audit/** -text -whitespace +# E8 bit word and E8 complex unit in the seven-stage word, complex halving degree two: MANIFEST.sha256 and the provenance files pin exact bytes. +research/e8-seven-stage-halving-two/** -text -whitespace diff --git a/.github/workflows/e8-seven-stage-halving-two.yml b/.github/workflows/e8-seven-stage-halving-two.yml new file mode 100644 index 0000000000..c2cfc11dcb --- /dev/null +++ b/.github/workflows/e8-seven-stage-halving-two.yml @@ -0,0 +1,39 @@ +name: e8-seven-stage-halving-two + +on: + pull_request: + paths: + - 'research/e8-seven-stage-halving-two/**' + - '.github/workflows/e8-seven-stage-halving-two.yml' + push: + paths: + - 'research/e8-seven-stage-halving-two/**' + - '.github/workflows/e8-seven-stage-halving-two.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + verify: + runs-on: ubuntu-24.04 + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + python-version: ['3.12', '3.14'] + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 + with: + python-version: ${{ matrix.python-version }} + - name: Install the pinned dependencies and the Boost headers + run: | + python -m pip install --disable-pip-version-check -r research/e8-seven-stage-halving-two/requirements.txt + sudo apt-get install -y --no-install-recommends libboost-dev + - name: E8 bit word and E8 complex unit in the seven-stage bridged word (with the five-stage regressions) + run: bash research/e8-seven-stage-halving-two/verify.sh "$RUNNER_TEMP/e8-seven-stage-halving-two-verify" + - name: Require committed files to remain unchanged + run: git diff --exit-code diff --git a/research/e8-seven-stage-halving-two/LICENSE b/research/e8-seven-stage-halving-two/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/research/e8-seven-stage-halving-two/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/research/e8-seven-stage-halving-two/MANIFEST.sha256 b/research/e8-seven-stage-halving-two/MANIFEST.sha256 new file mode 100644 index 0000000000..f09444eaff --- /dev/null +++ b/research/e8-seven-stage-halving-two/MANIFEST.sha256 @@ -0,0 +1,163 @@ +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 ./LICENSE +967e6d7e76e216e4898cf543c75b527e8d397ec1ddba3800cb20701f24c89524 ./NOTICE-PR352.md +949fafcf2c993d0a719ee24adacabbf2d578bd657f234b38ba0464cd0d9dd759 ./NOTICE.md +378ab6a356cdc604204f9caf6c262fe7d29258db317435e6c65f0b2d0d59178e ./README.md +8d44d9d894c70ef195d44468f6093e797f8757a969bda93b508f65bf334e6ade ./SOURCE-pr363.json +ba19bc388a7da6f91a7eb85ed4ee98f309eda557d1206fc3b55c3fa070ca23b5 ./SOURCE-pr370.json +20e7c346d38cabed0555586fc99f96d497ae80d9e7b26286e84eed33a56db6e1 ./SOURCE-pr373.json +c9a31508126f34e7ac95d802c39e8919a872cd705314de5bf3538de1636ce8ce ./code/bit/checkers/certify_bit_g.py +97b07eb2e2664522f672fb520d188520a3a2967ecefd6700667994614d478e0c ./code/bit/checkers/certify_bit_k.py +d1297f9052be4f2496e1ff2a77e4db2c0cdbd7d460d489b4c03e50bf317238ce ./code/bit/checkers/columns_h.cpp +1c344d18fcd494eeca93e259f10cafae7705780e6592f6dcb35b34752dab9bc2 ./code/bit/checkers/columns_k.cpp +d55d2b865d1c3d35e343e1a38c592b9172ed8e2596d1107e34d92e2a80c7d03f ./code/bit/checkers/cost.py +28a0d8ee29ac75b8a789705454987f07d618f135ed1f1bd45b97f18bcc4163e3 ./code/bit/checkers/exactnd_h.py +a591d8caa9ab50a4c7ec6934c71c93fc18fd14680180b43071e8d9d704f7ac9a ./code/bit/checkers/finite_g.py +f93207e50f1e07237d8c29ecef6b7be89f7c35e3f0c0f2449da8f7c66f6442e1 ./code/bit/checkers/finite_k.py +b9fa3cd05f36f5fcebfdebfb4a86fb90e92ed3c1d9157c52918ee8c5b563b54f ./code/bit/checkers/geometry_g.py +0609920cffe790e927a4106bb82e63b3f8078c647ac9156fe0d22624634e759f ./code/bit/checkers/geometry_k.py +223a5a07731fc315a90a3e48177796babc155c1d9985c7ae5017eff6af2a0608 ./code/bit/checkers/gram_frames.py +aaf127c04cb31c406e5b04a63f1ae89369fccde6d8fa7cdda1ed4f32dfc5de63 ./code/bit/checkers/json.hpp +6c1ef2b24e57781d6951c172a1024fc4300e6fd392c9d6672079a7806ab663b3 ./code/bit/checkers/legality_h.cpp +8140eec180e42202f2c6a9f11f5c92885e60861c38a7611dd805c524e3438138 ./code/bit/checkers/tile_g.py +64255088821f601ede2c3006f08cb97c39a4fa10dbbeb93a8a71fcfa0e1d8d77 ./code/bit/checkers/tile_k.py +8a5999601f917dbb492bb9ae9a344611f18cc7cedc53dc3c76496a369e530eb3 ./code/bit/export_records.py +f69379968367544807db2f0cf14359977e56299383b3edcc4469ddea7c7ecb40 ./code/bit/independent/centres_sat.py +11bf9620ca9db16d52d9fe806b814fc9ec9a89c4d7645354d1861d96f6e805ad ./code/bit/independent/checkword.py +0ff65aace5da4b57d96235bf830f8f11969322e75134d498aeb70e9753ec6b0d ./code/bit/independent/mutate.py +b0e75d6550412a7be4017695e6b237392b611bb852ad8ff309d6682c9f166a4e ./code/bit/mutate_records.py +60fea6a9d6617a3f87376d3fda040642e9cb70e7c179015e03ede8d289f30357 ./code/bit/producer/compile.py +0e23d4282ceb75768e82631da016aaff9818aec53c7d75a6b2a28ee1b1160dc3 ./code/bit/producer/compile2.py +4f8a6843e83bc4f7055d7337f33dbe12ce499051f46bee1b81bbf6b34c652574 ./code/bit/producer/e8lib.py +ba71f77dd3e3c1c54f361c066cebe9faadbc78db46376046e7af625bf1de8c24 ./code/bit/producer/frames.py +0daf87599e9e48646b985ad87351c56c1b73cfc99cdf9eca081483846ddbfa90 ./code/bit/producer/fullword.py +359040fb432fd392472af6b8f5dca0234dd6c2be744a791df27ba62bc5da5175 ./code/bit/producer/ham1.py +fdf0af785ce697bd7f80b4e75f7163735f3b599d9dc42f652f0ffdbdf18ea8bf ./code/bit/producer/ham2.py +1256c54debe0a551da8e24896ab73ef0bd4a5233ff8e6fedf21a9e6301d6e6f3 ./code/bit/producer/params-r865.json +46c858e60ba0a117bf8227b864abf55e85ebee2d56a0dce64472b706499ac405 ./code/bit/producer/price.py +4999c5d6bac9757e4236c45435201631eae21f644dc9543d8c0b6e3cc8360daf ./code/bit/producer/search2.py +935ea65d9c6739e868ccf1aa439bd3c246657dfc887e4a0222a8f0901a5b41a5 ./code/bit/receipts_e8.py +67f714e10a846e9cc62996342f825cd715055031e0b12591abdafd225717e195 ./code/bit/receipts_k.py +fc03e8f7bf73d7d70346b87c835d44508b0581c9ff9aec708fbbd4f0121e0394 ./code/bit/regression/certify_bit.py +26f5c9be3a7f545d50be458e3d17403921b5542a7dcd2986c848664a774977a8 ./code/bit/regression/columns_h_pr346.cpp +d55d2b865d1c3d35e343e1a38c592b9172ed8e2596d1107e34d92e2a80c7d03f ./code/bit/regression/cost.py +aaf127c04cb31c406e5b04a63f1ae89369fccde6d8fa7cdda1ed4f32dfc5de63 ./code/bit/regression/json.hpp +5661d0b91e07d95736bde4c1824f27bebaecce0a84e38403f5391ebc51a52056 ./code/bit/regression/legality_h_pr346.cpp +7bd5cb48537621f1217d174274d42483da4e2d02feec238643c798c36b30366a ./code/bit/regression/prime_new.py +98cd03bc9582e7bd0ab194c191ea8eea940539e510051443ab9fd3e572a364ab ./code/bit/regression/prime_witnesses.py +6c288f6f234b528c1a7c0a4adfb724e91e0fe6b18c8dffad96af3f973de1829a ./code/bit/regression/stage_cohort.py +38c3f78daac118395565a65fa3543b1c349638ff2519ce7fda0dad2d788e90ae ./code/bit/regression/tile_check.py +616bf82b56077c9e575791a70715047a5e01932649c3feb3e4c8ec56b39c9fab ./code/certify_b3.py +5fe7174cd3a6580a74e4c1bf8fa7b426e8673f1c285603bf3076d4e758d70731 ./code/complex/code/bridged.py +52d68781eaf6d9decf02446a532a7336fcf15924a9f6781ba0833d038decb9f8 ./code/complex/code/complex_basis.py +ccc924537db0c0d55f0c1934e79b8cf4d85b4fb336473d7b42d69e12557aa9f2 ./code/complex/code/complex_gx.py +e000ee131389fec427388b85f632879cbaaf10e5e5d979a47d6307d64ce58982 ./code/complex/code/complex_labels.py +c617b0fd2e18adcff15f6bf6cb3d54cc31f8432993be048b3442a5729eeff410 ./code/complex/code/complex_scalars.py +dfb4c9108bfea4a09f3e38f12b9dbe6164abab1a4fef8442ca593e2110d38ef4 ./code/complex/code/complex_splice.py +93b78a2e038b23264d04836928c78b6ebf33b87ff3dcc0e43ba0f1748fadd143 ./code/complex/code/p10pins.py +dfd1afbbb3ff86f54db6a0313916403ec8ee6f939caa62f3edcc9d7a151bff95 ./code/complex/code/scatter.py +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 ./code/complex/inputs/complex/LICENSE +9419dd03a2f52cf8bdfc4d18216ce29f263ab583b27f01ced8e420985bcb7c81 ./code/complex/inputs/complex/NOTICE +66d8f4ea8752abd89952d6674a636575a0db16e18b1c16e293f48f64242f0c46 ./code/complex/inputs/complex/retained/FINITE_BRIDGE.txt +2bc28e50f3eb092195294cafa81213e520f6d42e7935e9905ad8a6199e2a7c87 ./code/complex/inputs/complex/retained/compact-control-layout.tex +b963c3d2f4e1b7059aa289bb4b4ac89b688920bcf42f5b20d7698cdef0132cc6 ./code/complex/inputs/complex/retained/compact-control-movement.tex +00117892971ae766188ace0af03030c44164fda105e42b70d84f52c3339a7dcb ./code/complex/inputs/complex/retained/copied-centers-assembly.tex +d0ce6d3d504996aadb098227885224e48df46101daec8893523a0a8b7364d8fe ./code/complex/inputs/complex/retained/copied-centers-lemma.tex +dfee33b0281e5551bb6927f757ff0240abade60ae1800f715afd88853ae0191e ./code/complex/inputs/complex/retained/endpoint-gauge-complex.tex +c9bb9655b594583c6b4bab8cb485233f1d1e588f83858cf1e4c3530cee8fed54 ./code/complex/inputs/complex/retained/general-clifford-frames.tex +4738089103a4b263b3b0ef458f5ef35519c696f1ea871ae79e508d3720f5870a ./code/complex/inputs/complex/retained/stopped-product-complex.tex +0d76527bf9c259b9532466a7b056ad6ff118867a96e044ff8e1a24aca12e1dbb ./code/complex/inputs/complex/source-pins.json +5c24746a6330907b9b37d6064095035a58575d64ce793d6d7c9881121fdc3980 ./code/complex/inputs/complex/sources/Work__Bridge__Cert.lean +cf7d7d330b1bffe2e66712c873e647b13dc32db1ccfc0e0f4cd62ee6caf584f0 ./code/complex/inputs/complex/sources/Work__Bridge__Net.lean +6d0649eb62589e66057f044e1e2103fc42f3f57a1498f82a26565bd8eb4026d0 ./code/complex/inputs/complex/sources/Work__Carrier__Live.lean +71dc3dda23dfe510d5d53cbada3a6c540cd1dc2825503fda618a5bd6cfc3e812 ./code/complex/inputs/complex/sources/Work__Carrier__Phases.lean +2e8e88efd4dcbdf0b1a6e39ce7eea8c5fd5ffee2faf360a8c0c9cba84c0e4ef3 ./code/complex/inputs/complex/sources/Work__Fourier__Main.lean +c302f5834287421f11f3b0da7112fcde876cbc702896f2af4145b2d72ee393a2 ./code/complex/inputs/complex/sources/Work__GCert__Chain__Geom.lean +ade7e7873da75ca63a4b5ce2f562dde9c12bfbb69d87d7ae831039ff790e5adb ./code/complex/inputs/complex/sources/Work__GCert__Chain__InvThm.lean +22ae34809466b4ac2a2c5cdde526f51ff246f5189f7c142b38aa4c0dcffb04a4 ./code/complex/inputs/complex/sources/Work__GCert__Chain__NetCert.lean +6e17a68b1e988969f6eb77000028f7ed877e687b8ad3976ec1707fcfe1d2f520 ./code/complex/inputs/complex/sources/Work__GCert__Chain__NetDef.lean +c122bc01392a6fdcc0bee918fed81804d3c9b1d3e071016dab65a4ed804ef0b6 ./code/complex/inputs/complex/sources/Work__GCert__Chain__NetStage.lean +0de429c80231334f1ce92575c1e8ac382ca2d5e7d956767b547639a8941d9a8c ./code/complex/inputs/complex/sources/Work__GCert__Chain__Phased.lean +c33ec3fce09c0971c32ddcbb86d9383ffbe4c6d05cf36f20460005e6547bb845 ./code/complex/inputs/complex/sources/Work__GCert__Chain__WinB.lean +cb61f304da51f1dd0a2ec25bca4b63eb095eeb2863289e1e2bdee7c82beff48b ./code/complex/inputs/complex/sources/Work__GCert__Data__B2Gp193Main.lean +d5314f2b93a7f0e1c949fb502331825bfc6d9d8762d35f865443e7c95b6c7ef7 ./code/complex/inputs/complex/sources/Work__GCert__Data__Glue.lean +9587ddb9961f44938032b609307ab91c0b0e757e3991f1ad95480dd50fd4f72b ./code/complex/inputs/complex/sources/Work__GCert__Data__InstB2Gp193.lean +d92ee6889be4753fc99f467bd84039743325123a1165128378b9c906a04f2703 ./code/complex/inputs/complex/sources/Work__GCert__Data__P193Cert.lean +0299bcd0fe255960eec682eef0f045f7e5cb1e4711af2aab4393526eae2caea3 ./code/complex/inputs/complex/sources/Work__GCert__Data__P193Price.lean +479434815822e98f015e335361089c3788d00dc3dd39c2944f75410aa0c158fe ./code/complex/inputs/complex/sources/Work__GCert__Data__P193ScalOK.lean +6b40cac1481c931d47b1a092e382d04716ede0e785c492a2f2983e886a257c3f ./code/complex/inputs/complex/sources/Work__GCert__Data__RateB2Gp193x.lean +aba94a004c94dcae7cf3047c88a6da9561555f4ebe8ab92e299e6ce09ee7aa66 ./code/complex/inputs/complex/sources/Work__GCert__Data__Raw.lean +45c768c9d71a7cc18bd6db74cb036db880d89580ca60557bb4a492280296b169 ./code/complex/inputs/complex/sources/Work__GCert__Data__SolutionB2Gp193x.lean +feec0a3828867968a5c7c2c30b86ed70449abc3c660a60ada67203a75bae2ef7 ./code/complex/inputs/complex/sources/Work__GFrame__Engine__Adapt.lean +34906dbf5ae16b5174db00b4881a5cc1d2e583b8c8806db6523a5e2f86565f09 ./code/complex/inputs/complex/sources/Work__GFrame__Engine__Letters.lean +80fb3daa9a45de0ed6da570eb4476b9104734be65d0116f58bcfcbcd67f771d0 ./code/complex/inputs/complex/sources/Work__GFrame__Engine__Level.lean +6ba897a9495ddadcf8558b93133fdfaf66fc35ce7fa2c53e2d5667335c315e0b ./code/complex/inputs/complex/sources/tools__gx__ORIGIN.md +6f3dc8bb639933227a8dae181ec4a542e85c7276be9c9e330f49518e7b630b95 ./code/complex/inputs/complex/sources/tools__gx__gx.py +9c9dcfac47f0535bf3aa8ebf7c662cdef0ebda50a9f0a9282b8f3cf34809f835 ./code/complex/inputs/complex/sources/tools__gx__gxbind.py +dab7fec9f44c2d368ed334055d7126e202017feb46e41a8d86e2d998720f67c2 ./code/complex/inputs/complex/sources/tools__gx__gxconv.py +eb972c06fe8c322db2d9a8d9a7d05596e8f40c4ca8e5f42eb6df3c7361b5d517 ./code/complex/inputs/complex/sources/tools__gx__gxcore.py +c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 ./code/complex/inputs/e8/LICENSE +557c9ad4660eebd14a00583736c4d12d2c45f3fc9bc148845f9f3efec72c9434 ./code/complex/inputs/e8/NOTICE +842b217147cf84e8042d6ef1c33104d5444b6587b594664bc9eb89b237ab4ad0 ./code/complex/inputs/e8/Work/GCert/Data/B2Ge8.lean +987103107d5586c096016f0a702d0de35b74398dbb50ac66f5886a43a5ca0d05 ./code/complex/inputs/e8/Work/GCert/Data/B2Ge8Main.lean +a59db9d54b83adc73391916f7c1ef5e381ff073027781c26cb350f43b79839e3 ./code/complex/inputs/e8/Work/GCert/Data/ChallengeB2Ge8x.lean +13a243c7d7be31ae429d19b5ecd5d428d60c41b7cca8a330f0c4179b110ba7ea ./code/complex/inputs/e8/Work/GCert/Data/E8Cert.lean +cd250dd72406dde37765c501f666ceeedcc18f831070b26369bcb154c1f99a8e ./code/complex/inputs/e8/Work/GCert/Data/E8Price.lean +6bd5e68effe8913a3f73e25ea59142cd9928ddf81e94250a6ea28aa7317388b3 ./code/complex/inputs/e8/Work/GCert/Data/E8ScalOK.lean +5c7fb23df2c10b690f638a19bf066905b5b620b8a2ad0ffde76cc9348d8aa2b4 ./code/complex/inputs/e8/Work/GCert/Data/Gen/E8.lean +36de82f6969c23082876a4d6848428623d1c65d2df3fc917f23ecba003189dd2 ./code/complex/inputs/e8/Work/GCert/Data/Gen/E8/S0.lean +6ea83365afe01664b2132a630511b4de65f938dc328744ce7f77a01fad97f32d ./code/complex/inputs/e8/Work/GCert/Data/Gen/E8End.lean +cce81699abe1f85a870dcf64edd395d2cf5a586da7700af565b557093095ab51 ./code/complex/inputs/e8/Work/GCert/Data/Gen/E8Hist.lean +a343219b419f30f8ac4dd3a0a98bf53550c5fec6b2cbd245320a95977c319016 ./code/complex/inputs/e8/Work/GCert/Data/Gen/E8Par.lean +78036e5443775ade5bde46a77ba3e0433fe22160da11b5b6c96c7f1075ecfbbd ./code/complex/inputs/e8/Work/GCert/Data/Gen/E8Scal0.lean +f6b248dc4c3b2c94db95989b6bd5ad3c3f0d7ece3a511e5b69069550b821b138 ./code/complex/inputs/e8/Work/GCert/Data/Gen/E8Seg0.lean +79d16ccceb61391446ea97f77fddadafa9150e9dea97919e775f6c78daa71839 ./code/complex/inputs/e8/Work/GCert/Data/Gen/E8Seg1.lean +924340aebc6f68b5a6526311ce33341af0a0a5a8375416762f08c1914ec08abe ./code/complex/inputs/e8/Work/GCert/Data/Gen/E8SegF.lean +650600b631a21221956f9abbab9abebcc9cca628512d3e9a017e2373e2649b17 ./code/complex/inputs/e8/Work/GCert/Data/Gen/E8Tab0.lean +60036fa4deeb19d39fc0dddf31359d2b6d2407ff66070f145b111bff16190eb0 ./code/complex/inputs/e8/Work/GCert/Data/Gen/E8Tab1.lean +c8a248da3eb770ba55ef267d118b29d49983311087ef789398d555e2c44b3a41 ./code/complex/inputs/e8/Work/GCert/Data/Gen/E8Tab2.lean +41975d430ec0095ad465a36d4903e90c01bc891d3abe5e2c372ef786c029a7ed ./code/complex/inputs/e8/Work/GCert/Data/Gen/E8Tab3.lean +a290360c175544cb85edffe1b92fcf7d447cba09128e19de8dc87e0a1ff0c524 ./code/complex/inputs/e8/Work/GCert/Data/Gen/E8YChk.lean +c1fee298187ea19b5d70fcfccef7d4fd4161be70c0adda19a89ca9933a759954 ./code/complex/inputs/e8/Work/GCert/Data/InstB2Ge8.lean +7b6e59724c0f140e714afba237d5a1a91b22da70abc096ce274690140b39a3a6 ./code/complex/inputs/e8/Work/GCert/Data/RateB2Ge8.lean +7c56d865ed6bfcb6919dabc1a6e53f8744ff4824a2f78335787485f3090970d1 ./code/complex/inputs/e8/Work/GCert/Data/RateB2Ge8x.lean +dd52f1fe0a372480edaf5e6c64903d6257c410e43d406f8acb6bf8f60a1ee28f ./code/complex/inputs/e8/Work/GCert/Data/SolutionB2Ge8x.lean +ddad06c37f9268986f3ec8ce43da5230ee2bd887da2480328413a0dc58f2a926 ./code/complex/inputs/e8/comparator/B2Ge8x.json +4b92f00fc7454b9b15e6d71a3b05062792eacca0a0ca4efee46f87827d57c8aa ./code/complex/inputs/e8/tools/certificate/gcert1-e8-r783.json.gz +be41ee310f28121c3e424cc8637d8fa02ef7c47fc8945e9bbd3856138fd800d6 ./code/complex/inputs/e8/tools/e8/replay.py +a0f16e2c9e078ffbfb2174281ee93a48c18593aefb880318fc105ec85a205932 ./code/complex/inputs/e8/tools/gen/foldgen.py +7a3c38a698c129e13a767da75926a1305eb0c031b908450afc6feb185505c59a ./code/complex/inputs/e8/tools/gen/foldlib.py +ef8c869e4cf8da33a4c10b96f7f6faafd46e15d66766238070a60315aa169994 ./code/complex/inputs/e8/tools/gen/gen_rates.py +1b5eb3730cb16cf516e760879951fdfb9b065efc55f78c29a5c6404fcca57a78 ./code/complex/inputs/e8/tools/gen/gen_sharp.py +0488b7a2442c795414f103df912d1e6cc66d37b5be270940ea9564b7f2b666be ./code/complex/inputs/e8/tools/gen/templates/ChallengeB2L16x.lean.txt +d414a890dfe126916374c1afc804b90e5081b7760f894b9ccdcf23d83a12f9ee ./code/complex/inputs/e8/tools/gen/templates/SolutionB2L16x.lean.txt +0e22bbe5924284e2fb916337ccefc8e41f6e54469749986ad15b3b81cfaec534 ./code/complex/inputs/e8/tools/gx/gsmirror.py +9c9dcfac47f0535bf3aa8ebf7c662cdef0ebda50a9f0a9282b8f3cf34809f835 ./code/complex/inputs/e8/tools/gx/gxbind.py +eb972c06fe8c322db2d9a8d9a7d05596e8f40c4ca8e5f42eb6df3c7361b5d517 ./code/complex/inputs/e8/tools/gx/gxcore.py +ce9151054370c2210ed08f54c249a19dcb6946d182cdf934dee1a3781b53040f ./code/complex/inputs/e8/tools/gx/gxgen.py +f00802d48ef3fedb00278f0b1c7bde074cc49dd30f202d7f32a9d2aebb3be443 ./code/complex/inputs/e8/tools/gx/gxpaths.py +514a5719f970fe36b1273cf59df0396db0e042dd7864c2eea53ab2a2fd1e2ad6 ./code/complex/inputs/e8/tools/gx/gxrate.py +3cc09a9c1a2db681c0f2016bc821af5b674d34834dbd6f195b9d482ce7c0ff58 ./code/complex/inputs/e8/tools/gx/gxunit.py +b6172d58749c0b3b9138570c74827bcb23bf5db4ff9643740768cd7782ac4ca6 ./code/complex/inputs/e8/tools/gx/regen_check.py +ad8fe9811c6ea0d89c795caef48686cfca600f5d540ebfd5d1251d6777cec7cf ./code/complex/inputs/e8/tools/gx/regen_check_e8.py +9e2d5b8e1f5f5d1c3113ed563ace88a3e5a605e1f053af350f1cec4d4791a4c4 ./code/complex/pins-e8-b3.json +bffda4be2ef3ba7a1072029779cfa448e3d19a986eae444c7970b87f48b294c6 ./code/complex/pins-e8-b3h.json +bf66f785878f636616ceab193e5a222143945ea06fc2f13dfb99b204ebba82ff ./code/complex/pins-e8.json +a28cfd37ce5da0e97e03f225629f17f31e0278142b3757345ed47d7a66560cbf ./code/complex/portable_complex.py +aee70c242a2f1d225528fabe2002e1564d1dc884797c07d28a831c7878ee9098 ./code/pricing/base_two_moment.py +81cbc864e106418fc7854322746f72180cb8110ff39f74450a3b8d55a82c1482 ./code/pricing/moment.py +c1ebb52163a7219504c728a5c2b098bf1e50bf20148a2879c5a74c3cadc7c03c ./code/pricing/outer.py +98cd03bc9582e7bd0ab194c191ea8eea940539e510051443ab9fd3e572a364ab ./code/pricing/prime_witnesses.py +e509d08cd82d078df86f491f83a312516cae26c5528ad073b924c73f53b34edd ./code/provenance.py +cfc30216f441a1c44a533f2f26954f90e454136af8842c497de4e2da9bd32d8d ./data/bit/RECORD-SHA256SUMS +1fb726ea3818fe0837cceb0dd22a71a0814f064e5e781628104610d6468e0e55 ./data/bit/bitE8-r865.json.gz +caabc13126e8f87d08f7697f51512cb3431ff52861f4190149251d8e19224430 ./data/regression-p10/BASE-RECORDS.bin.gz +35070b83d12ebc60003ed344315328713134a43bdb04217c2c5cbc39e101391f ./data/regression-p10/BASE-frames.json.gz +1e37ae5001447dd78a8287d8aa23d73a1d5862c4017f44db49af327f58d7cf22 ./data/regression-p10/BASE-states.json.gz +0bd464f873b0f59622026793affb308bf087833de6f3197202adc7a36d9d0782 ./data/regression-p10/receipts-loans/banks.json.gz +82b21b4e6bb4b20e0ecbca44f59941362f57a26a019f179e19b5b7b86262a116 ./data/regression-p10/receipts-loans/finite.json.gz +7dccea4b8c4a81597779dc0944297d5f60efd9e2e5b19469417712e2192c6cca ./data/regression-p10/receipts-loans/global_result.json.gz +c4074b86171c5bde8fbbff6df0022a116f17e11f0d2116ae3dfe75c8b2a18c64 ./data/regression-p10/receipts-loans/math.json.gz +505c13c667230e946e708d7c9086de34d1c5e259a557f6685765054001e29981 ./data/regression-p10/receipts-loans/raw.json.gz +e7bb691b741227ce389ff6341fa0548ff8f638cc492a06be40fcd829fac0bed9 ./data/regression-p10/receipts-loans/scalar.json.gz +1939ad706e192fb3781e8a0018880b1c6291ded07d40edc4048ab1a0e48f71ee ./requirements.txt +f00ebcfa36f95e45b79b636c826cc8a390a3e4b724b24644231014c8d74a5663 ./verify.sh diff --git a/research/e8-seven-stage-halving-two/NOTICE-PR352.md b/research/e8-seven-stage-halving-two/NOTICE-PR352.md new file mode 100644 index 0000000000..4f9a0194a3 --- /dev/null +++ b/research/e8-seven-stage-halving-two/NOTICE-PR352.md @@ -0,0 +1,33 @@ +# Attribution and provenance + +Prepared by DaysSky, assisted with Claude. Apache-2.0 (see `LICENSE`) applies to the new code and to the inherited Apache-2.0 +code below; third-party notices are preserved where files are vendored. + +- **Complex supplier: the E8 unit** (`code/complex/inputs/e8/`): Jacob Sussman, jacobalansussman/wht-power-saving-lean + at `9c94857bbaee886f8649edee0bc2d3c738f9555e` (Apache-2.0, Copyright 2026 Jacob Sussman; his `LICENSE` and `NOTICE` + are vendored beside the files). The certificate `tools/certificate/gcert1-e8-r783.json.gz`, the 24 Lean modules and + the comparator configuration of his kernel-checked theorem `wht_main_block_B2Ge8x`, his Lean-data generators + (`tools/gx/{gxgen,gxrate,gxbind,gxunit,gxcore,gsmirror,gxpaths,regen_check,regen_check_e8}.py`, + `tools/gen/{foldlib,foldgen,gen_rates,gen_sharp}.py` and templates) and his stand-alone `tools/e8/replay.py` are + vendored byte-identical and sha-pinned in `code/complex/inputs/complex/source-pins.json`. His README credits + devices from this repository in the unit: slot reuse with a compensating read (jamesyc #124, eumemic #143), late + pairing (Chafik Boukhalfa #200/#233), the in-place pair (icekylinx #184, carried in ikeboy's #191/#193). +- **Bit word, Design T, twin condensation, checkers and engines** (`data/bit/`, `code/builders/`, `code/checkers/`, + `code/pricing/`, `code/export_p10.py`, `code/stage_cohort.py`): unchanged from LJH-217's PR #346 at + `11b4de5ff8ed5fccf55d4af1043358d257308e8e`, which builds on DreamingOfClouds' PR #325 p10b word and PR #315 engines + (#285/#276 gen5/gen4 lineage on eumemic's PR168 generator and source527 package, PR #200's physical rules, hcg890 + and Jacob Sussman's five-stage architecture, Evan McKinney's completed banks), utcorvusvolat-dotcom's w3 Design T, + twin condensation and verifier (PR #310) and PR #266's official checkers. See PR #346's notice for detail. + `json.hpp`: Niels Lohmann, MIT license in its header. +- **Complex checks** (`code/complex/portable_complex.py`, `code/complex/code/`, `code/complex/inputs/complex/`): + PR #315's portable complex checks as ported to p = 10 in PR #346 (#256/#233/#202/#200/#194/#184 lineage: + icekylinx, Chafik Boukhalfa, Avi Eisenberg, eumemic and others). Jacob Sussman's `gx.check1`, `gxcore` and pinned + Lean chain sources under `code/complex/inputs/complex/sources` are unchanged from PR #346 (byte-identical at + `9c94857` except his `ORIGIN.md`, kept at `f010392`). +- **New here**: `code/complex/code/scatter.py` and the generalization of the label, scalar, splice and guard checks + from the paired-cube star scatter with h centres of rank h − 2 to any gx scatter (table or star) with any number + of retained totals of any rank (regression: on PR #346's p = 10 program the generalized checks give byte-identical + scalar schedules, splice programs, primitive expansions, ledger and precision guard); the generalized final-climb + partition; the E8 pins; the Lean-binding and replay steps of `certify_complex.py`; `verify.sh` changes. + +Credits do not imply endorsement or review by the credited authors. diff --git a/research/e8-seven-stage-halving-two/NOTICE.md b/research/e8-seven-stage-halving-two/NOTICE.md new file mode 100644 index 0000000000..235facfadc --- /dev/null +++ b/research/e8-seven-stage-halving-two/NOTICE.md @@ -0,0 +1,57 @@ +# Attribution and provenance + +Prepared by DaysSky, assisted with Claude. Apache-2.0 (see `LICENSE`) applies to the new code and to the inherited +Apache-2.0 code; third-party notices are preserved where files are vendored. `SOURCE-pr370.json`, `SOURCE-pr363.json` +and `SOURCE-pr373.json` record, by git blob id, every file taken unchanged from those three pull requests. + +## Vendored + +- **The E8 bit word and its bit-side checks** (`data/`, `code/bit/` except the files listed as new below, + `code/pricing/`, `NOTICE-PR352.md`, `LICENSE`): unchanged from PR #370 (Dylan Crow, utcorvusvolat-dotcom) at + `b7fe9cdf2da009c947ff6b334c562bc190b30373`: + - the word `bitE8-r865`, its producer, the record exporter, the independent checker and its controls, the centre-count + CP-SAT proof; + - the generalized checkers `legality_h.cpp`, `columns_h.cpp`, `gram_frames.py`, `geometry_g.py`, `tile_g.py`, + `certify_bit_g.py`, `finite_g.py` and the receipt assembler `receipts_e8.py`; + - the unmodified PR #346/#352 sources in `code/bit/regression/` and the regression data in `data/regression-p10/`. + + PR #370's notice gives the lineage of these checkers: PR #266's official cohort checkers as generalized by LJH-217's + PR #346; the source527/p10 packages' `finite_check.py`, `geometry527.py` and `global_lowering.py` (eumemic's source527 + package; PR #200, Chafik Boukhalfa; PR234, hcg890 / Henry Grant, on Jacob Sussman's five-stage architecture; Evan + McKinney's completed banks; the p = 10 ports by DreamingOfClouds and Chafik Boukhalfa); PR #315's engines + (`moment.py`, `base_two_moment.py`, `outer.py`, `prime_witnesses.py`). `json.hpp`: Niels Lohmann, MIT license in its + header. +- **The complex supplier** (`code/complex/`, `code/certify_b3.py`): unchanged from PR #363 (DaysSky) at + `9df55dad6ddd05c3458793dfd82d1c2fe0ddbbb4`: Jacob Sussman's E8 unit, Lean data, generators and replay + (jacobalansussman/wht-power-saving-lean at `9c94857`, Apache-2.0, Copyright 2026 Jacob Sussman; his `LICENSE` and + `NOTICE` are beside the files), PR #352's portable complex checks with the layout as a parameter, and `bridged.py`, + which generalizes Sussman's bridged five-stage word to B_K. See `NOTICE-PR352.md` for the complex-check lineage. + +## From PR #373 + +Everything above was vendored by PR #373 (DaysSky) at `3ff87b5dc0b22a57958547ee347d5da25b7f9401`. That PR also added the +K-parameterized bit-side checkers `columns_k.cpp`, `geometry_k.py`, `tile_k.py`, `certify_bit_k.py`, `finite_k.py` +and `receipts_k.py` (`SOURCE-pr373.json`). + +## New in this package (halving degree two) + +- `code/complex/portable_complex.py`: the finite guard computes the least halving degree and charges it in the + external row coefficient (t = 1 is the original). It keeps m <= 72, and the idle-climb split is read from the pins. +- `code/complex/pins-e8-b3h.json` (unsplit B_3) and the third guard run and exact b in `code/certify_b3.py`. +- `verify.sh`, `code/provenance.py`, `README.md`, this notice, `MANIFEST.sha256`, the provenance files, the workflow. + +## New in PR #373 (kept) + +- `code/bit/checkers/columns_k.cpp`: `columns_h.cpp` with the bank schedule, twin bridges and terminal exchange + generated for B_K (`-DKPAIRS`, default 2 = the five-stage tables). +- `code/bit/checkers/geometry_k.py`: `geometry_g.py`'s routes, chained stage boundaries, idle pairs and entrance + completion on 2K + 1 blocks, with the idle chronology of `bridged.py` and explicit dyadic intermediate frames for + the half-shrink splits. +- `code/bit/checkers/tile_k.py`, `certify_bit_k.py`, `finite_k.py` and `code/bit/receipts_k.py`: the bank width, the + one-level histogram, the stage counts of the finite bill and the receipt assembly for B_K. +- `verify.sh`, `code/provenance.py`, `README.md`, this notice, `MANIFEST.sha256`, the two provenance files, the + workflow. + +Each new checker reproduces the PR #370 checker it generalizes at K = 2; `verify.sh` compares the receipts. + +Credits do not imply endorsement or review by the credited authors. diff --git a/research/e8-seven-stage-halving-two/README.md b/research/e8-seven-stage-halving-two/README.md new file mode 100644 index 0000000000..bafeeaab56 --- /dev/null +++ b/research/e8-seven-stage-halving-two/README.md @@ -0,0 +1,168 @@ +κ = 9.5424356568133e-4 + +# Seven-stage E8 bit and complex suppliers, with the complex idle climbs at halving degree two + +This package gives a conditional finite construction with **κ = 95424356568133/10¹⁷ ≈ 9.5424356568133·10⁻⁴**: + +- +2.40 % over PR #373 (9.3191395651209e-4), which it extends; +- +9.00 % over PR #370 (8.75481145306751e-4). + +Everything is PR #373's, with one change on the complex side. PR #363 split the complex supplier's two longest idle +climbs below m/2, 38 → 31 + 7 and 32 → 31 + 1, to meet the half-shrink guard of the inherited finite bridge +(2 · max child < m). Here they are **left whole**. The largest complex child is then 38 of m = 63, so one recursion level +no longer halves the size, but two do: 63² = 3969 > 2 · 38² = 2888, which is **halving degree two**. + +| side | supplier | layout | coarse saving | +| --- | --- | --- | ---: | +| bit | PR #370's E8 bit word `bitE8-r865`, unchanged (PR #373) | B₃, split (max child 27 of 56, degree 1) | c = 968197503705007/10¹⁸ ≈ 9.68197503705007·10⁻⁴ | +| complex | Sussman's E8 unit `gcert1-e8-r783`, unchanged | B₃, **unsplit** (max child 38 of 63, degree 2) | b = 119394377245827/(125·10¹⁵) ≈ **9.55155017966616·10⁻⁴** | + +The bit side is 1.4 % above the complex side, so **the complex side binds**. κ is the complex-bound assembly of PR +#315's `outer.assembly`: all 47 constraints hold, the complex leaf cap itself is rejected, and the adjacent 10⁻¹⁸ grid +point is rejected. The bit word, its seven-stage checks and the circuit of the complex unit are unchanged from PR #373. +That includes the Lean binding of Sussman's `wht_main_block_B2Ge8x`. + +## Halving degree two + +The half-shrink guard is used once in the inherited complex finite bridge +(`code/complex/inputs/complex/retained/FINITE_BRIDGE.txt`, section 4): "The complex child maximum below m/2 gives +halving degree 1, while log2 W < 5208 < 10000". The external row coefficient is then bounded by +A = 10000 + 9909 + 252 = 20161. With halving degree t the recursion depth is t·⌈log₂ n⌉, and the row term becomes +t·log₂ W. The guard (`code/complex/portable_complex.py`) now: + +- computes the least t with mᵗ > 2·(max child)ᵗ; +- charges t times the actual physical stock logarithm, 2 · 1903 + 9909 + 252 = 13,967 < 20,161, so A and the outer + assembly are unchanged; +- keeps the cover bound m ≤ 72 and the completed-child induction gap, now 49·B > 0. + +At t = 1 it is the original guard. The B₂ run (PR #352's pins) and the split B₃ run (PR #363's pins) are +regressions in `verify.sh`. + +This is the generalization the repository already uses elsewhere: + +- **PR #144's integration review** (`research/pr-review-20261009/check_paired_cube_arithmetic.py`): a complex child of + 60 at m = 72, halving degree 4, and the row coefficient 4·2571 + 9909 + 252. +- **The copied-centers assembly** (`copied-centers-assembly.tex`, with `research/copied-fixed-reversed/balanced_assembly.py`): + halving degrees 9 and 20, a row reserve D_j(e) = t_j⌈log₂ e⌉, and coefficient Σ t_j·w_j. +- **PR234 on the bit side** (`research/five-stage-source527-banks/UPSTREAM-PR234-PROOF.md`): "The proper child ratio 5/6 + requires halving degree four. The one-level weighted recurrence is retained; its histogram is not multiplied by four." + +The moment equation is the one-level histogram either way. Only the finite row constant depends on t. + +**Why not further.** Unsplit complex B₄ prices at 9.5673·10⁻⁴, but m = 81 exceeds the cover bound m ≤ 72. Unsplit B₅ +needs halving degree three and prices lower (9.3708·10⁻⁴). The bit side keeps PR #373's split layout because it does +not bind. Unsplit, at halving degree two, it would give 9.9123·10⁻⁴. + +## The layout + +PR #370's bit word uses the five-stage bridged word: two bank pairs per class, five invocations, three layers of twin +bridges, then the terminal exchange. In B_K (PR #363, `code/complex/code/bridged.py`) pair p borrows its first forward +invocation from pair p − 1 in the same way: + + stage 0, 1, 2 pair 1: forward, backward, forward + stage 2p-1, 2p pair p: backward, forward (p = 2..K) + after stage 2p-3 X(p-1) += Xp, Yp -= Y(p-1) + after stage 2p-2 Yp += Y(p-1), X(p-1) -= Xp + at the end Y(p-1) -= Yp, Xp += X(p-1) (p = K..2) + +So K pairs are exchanged by 2K + 1 invocations on H ⊕ 2K·H, with m = (2K+1)h, W = 2Kv + R and D = 2Kv − (2K+1)·L for copy +loss L per invocation. With L = 72, both E8 units have D = 120 in five stages and D = 216 in seven. One invocation of +the bit word is unchanged. Only the word around it changes: + +- **Idle climbs of the bit word in B₃** (h = 8): pair 1 [34], pair 2 [14, 7, 20], pair 3 [28, 7, 6]. The two climbs + above m/2 are split at explicit intermediate frames, 34 → 27 + 7 and 28 → 27 + 1. The largest paid child is then + 27, and 2 · 27 < 56 satisfies the half-shrink guard. +- **Banks.** Every helper starts at frame 0, so all 865 residuals have width 8. Width-56 banks hold 7 of them, and 7 ∤ 865, + so the bank tiling uses **T = 7 literal replicas**: 865 exact width-56 banks. The moment arithmetic is invariant + under this normalization. + +## What is checked (`bash research/e8-seven-stage-halving-two/verify.sh `, about 4 min) + +Every step of PR #373's verification runs: PR #370's steps and their B₃ versions, each with its K = 2 regression. +Steps 8 and 9 add the halving-degree-two complex supplier and keep PR #373's values as regressions. + +0. **Manifest and provenance.** 142 files have the git blob ids of PR #370 at `b7fe9cd`, 4 those of PR #363 at + `9df55da`, and 7 those of PR #373 at `3ff87b5` (`SOURCE-pr370.json`, `SOURCE-pr363.json`, `SOURCE-pr373.json`). + The edited files are `portable_complex.py` (the halving degree), `certify_b3.py`, `verify.sh`, `provenance.py`, + README and NOTICE. The new file is `pins-e8-b3h.json`. +1. **The word** (PR #370) is regenerated from its producer parameters, and the PR249 records are exported. +2. **One invocation** (PR #370): the independent all-column checker and its 6 word-level controls. +3. **Legality and formal columns.** Legality of one invocation uses PR #266's checker (NCOPY = 9). + `columns_k.cpp -DKPAIRS=3` is PR #370's all-column F₂ check of the whole bridged word, extended to seven stages: + - all 1,585 physical columns, dirty helpers included, through 7 invocations, 12 twin bridges and the terminal + exchange; + - all 12 omitted-bridge controls rejected; + - PR #370's 6 record-level controls rejected. + + At K = 2 the receipt equals `columns_h`'s. On the PR #325 p10b word it equals PR #346's unmodified checker. +4. **Exact nondegeneracy** under the E8 Gram, and prime witnesses, on every frame (PR #370; the only prime is 2). +5. **PR234's route and idle geometry**, on all 120 ports, with W(E8) reflection words as port isometries. + `geometry_k.py 3` uses 7 blocks: + - routes involutive, 6 stage boundaries chained; + - every idle climb a commuting nested pair whose gap rank equals `bridged.py`'s; + - the two splits at dyadic intermediate frames Q = b − D, where D is a sum of orthogonal E8 root projectors, so + the prime set stays {2}; + - the 7-window entrance completion exact, and a duplicated window rejected. + + At K = 2 it gives PR #370's idle ranks (14, 14, 7, 7, 18, 18, 4, 4). +6. **Banks.** `tile_k.py`: an exact zero-padding width-56 tiling with 7 replicas. At K = 2 it is byte-identical to + `tile_g.py`. +7. **Copied centres.** 9 retained totals at the full frame. This is PR #370's admission, and it is charged as NCOPY = 9 + per invocation everywhere. +8. **Complex supplier** (`certify_b3.py`): + - the B₂ regression reproduces PR #352's pins and b (halving degree 1); + - the split B₃ regression reproduces PR #363's pins and b₃ = 932783231884153/10¹⁸ (halving degree 1); + - **unsplit B₃**, against `pins-e8-b3h.json`, runs PR #352's portable checks at m = 63: max child 38, halving degree + 2, rows 2·1903 + 9909 + 252 = 13,967 < 20,161, induction gap 49·B, m ≤ 72; + - Sussman's Lean data regenerated byte for byte, and his replay accepts; + - b₃ = 119394377245827/(125·10¹⁵), with two engines and the 10⁻¹⁶ fallback, and the adjacent grid point rejected. +9. **Bit coarse saving and outer assembly.** `certify_bit_k.py 3 8 7` takes the one-level histogram + 7 × (one invocation) + 240 × (B₃ idle blocks), with W = 7 · 1,585, m = 56 and deficit 7 · 216. It uses PR #315's + two engines with the 10⁻¹⁶ fallback, and rejects the adjacent grid point. The outer assembly gives 47 positive + constraints and κ. + + At K = 2, T = 1 the receipt fields equal PR #370's (κ = 8.75481145306751e-4). With the split b₃ it gives PR #373's + κ = 93191395651209/10¹⁷. With the halving-degree-two b₃ it gives κ = 95424356568133/10¹⁷. +10. **Finite bill at m = 56** (`finite_k.py`). The original formulas with the stage counts of B₃: + - 7 invocations' additions plus 12v bridge additions; + - route families 2·7·(2v + R) + 6v; + - 7·NCOPY·T copy/erase episodes; + - the selector bill 2·7·T·(…). + + The coefficient is 57,685,376,070,645 (46 bits) < 2⁸⁰, with q-power bound q³¹³⁷. All 120 port routes are exact + elementary programs with denominators {1, 2, 4}. At K = 2 the bill is byte-identical to PR #370's, and the p = 10 + regression reproduces the original coefficient. + +## Open obligations + +- **No Lean proof of the bridged word B₃**, on either side. Sussman's `bridge2_certificate` covers B₂. Here B₃ rests on: + - the all-column F₂ check of the whole seven-stage bit word (step 3); + - PR234's exact rational geometry on 7 blocks (step 5); + - PR #363's coordinate-frame check and exchange identity for the complex side. +- **Everything PR #370 admits**, unchanged: + - the 9 retained totals at h = 8, a layout pin of the paired-cube words; + - PR234's bank construction for a non-paired-cube family, checked on the exact matrices and not re-proved; + - the inherited bit-supplier interfaces. +- **Everything PR #363 / #352 / #346 / #315 admit on the complex side:** + - the complex symbolic correctness; + - the precision/recovery and row interfaces, including the additive row constants; + - the analytic transfer. +- **Halving degree two on the complex side.** The inherited finite bridge text states half-shrink (degree 1). Here + its row term is charged at degree 2 as in the repository's degree-4 and degree-9/20 precedents (above), with the + precision/recovery interface inherited at that depth. The outer assembly's constants are unchanged. +- The finite bill takes PR #370's formulas with the counts of seven stages (above). Its proof text is PR #370's and the + source527/p10 lineage's, not re-derived here. +- This is a conditional finite construction, not a formal verification of the multiplication theorem. + +## Credits + +- **Dylan Crow (utcorvusvolat-dotcom), PR #370:** the E8 bit word, its producer, its independent checker, and the + generalized bit-side checkers this package extends. +- **Jacob Sussman:** the E8 family and the E8 complex unit; the bridged five-stage word and its geometry, which B₃ + generalizes. +- **PR #363 / PR #373 (DaysSky):** B_K, the seven-stage complex unit and the seven-stage bit construction. +- The halving-degree generalization follows PR #144's integration review, the copied-centers assembly and PR234 (hcg890 + / Henry Grant). +- **PR #352 / #346 / #315 / #266 / source527 / PR234 lineage:** see `NOTICE.md` and `NOTICE-PR352.md`. + +Prepared by DaysSky, assisted with Claude. diff --git a/research/e8-seven-stage-halving-two/SOURCE-pr363.json b/research/e8-seven-stage-halving-two/SOURCE-pr363.json new file mode 100644 index 0000000000..cebdf46b6a --- /dev/null +++ b/research/e8-seven-stage-halving-two/SOURCE-pr363.json @@ -0,0 +1,14 @@ +{ + "schema": "pr363-provenance/1", + "source": "https://github.com/CrocSwap/integer-mult-bounds/pull/363", + "commit": "9df55dad6ddd05c3458793dfd82d1c2fe0ddbbb4", + "source_root": "research/e8-seven-stage", + "note": "Every file under \"identical\" has, in this package, the git blob id it has in PR #363 at the commit above (git ls-tree -r 9df55dad6ddd05c3458793dfd82d1c2fe0ddbbb4 -- research/e8-seven-stage). Files under \"changed\" exist there under the same path and were edited here.", + "identical": { + "code/complex/code/bridged.py": "626a28614b07066528fd5f189d87cffa5015ac60", + "code/complex/code/complex_scalars.py": "129252a0236c401bb52c7f55d01734172906ce56", + "code/complex/code/complex_splice.py": "bad0ec651f87890a46f314598cd72e762854a3ff", + "code/complex/pins-e8-b3.json": "4dcc074355e26fe978aa34e9f14199bb21ebafea" + }, + "changed": [] +} \ No newline at end of file diff --git a/research/e8-seven-stage-halving-two/SOURCE-pr370.json b/research/e8-seven-stage-halving-two/SOURCE-pr370.json new file mode 100644 index 0000000000..29ab7abc35 --- /dev/null +++ b/research/e8-seven-stage-halving-two/SOURCE-pr370.json @@ -0,0 +1,152 @@ +{ + "schema": "pr370-provenance/1", + "source": "https://github.com/CrocSwap/integer-mult-bounds/pull/370", + "commit": "b7fe9cdf2da009c947ff6b334c562bc190b30373", + "source_root": "research/e8-bit", + "note": "Every file under \"identical\" has, in this package, the git blob id it has in PR #370 at the commit above (git ls-tree -r b7fe9cdf2da009c947ff6b334c562bc190b30373 -- research/e8-bit). Files under \"changed\" exist there under the same path and were edited here.", + "identical": { + "LICENSE": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "NOTICE-PR352.md": "4f9a0194a34a6b3b431d5b452655a2bc787fdb95", + "code/bit/checkers/certify_bit_g.py": "d257992e31129ef761e7ff5b4fda71fd590dd60e", + "code/bit/checkers/columns_h.cpp": "00c5a3a5d81d083582f60f33dd2e7bea5049c37f", + "code/bit/checkers/cost.py": "677584c1c6b0e959c19f58521b68d4b3e847f97e", + "code/bit/checkers/exactnd_h.py": "fa90b5089f53cbd1f98ec026391cf9375eb6a11d", + "code/bit/checkers/finite_g.py": "d1aa38980a164b7c8070c24a30560e90c1dbb721", + "code/bit/checkers/geometry_g.py": "74eb5822479153bd87e1ac1044161e8997d0bb6f", + "code/bit/checkers/gram_frames.py": "b740d47295c02692260d7cc01874a49fe48f78ab", + "code/bit/checkers/json.hpp": "82d69f7c5d044c9887c96b90c97f5639083ecd14", + "code/bit/checkers/legality_h.cpp": "cb1233c7e96b1aa8bbf4d2e4165d75ab0dca64b9", + "code/bit/checkers/tile_g.py": "d897054811144048dd08598dcd02560f7d7c62ee", + "code/bit/export_records.py": "3632d370486a02f5456f7643ced03f8c925b2350", + "code/bit/independent/centres_sat.py": "efbcef69dda1f2331237c0888a0f18e7f89fab3e", + "code/bit/independent/checkword.py": "da4e0fe05067184d4dab1e130ae1384c1fa983f5", + "code/bit/independent/mutate.py": "eba592fd468e0d7e7e5100fe99da6eb548c5906b", + "code/bit/mutate_records.py": "6794516f665d36eac189894e350a5ad01113cb4c", + "code/bit/producer/compile.py": "86b12507ef86308336833a208a989d56072096d1", + "code/bit/producer/compile2.py": "a7bdfdfbe417c793b2a8c515f5432bdd10472259", + "code/bit/producer/e8lib.py": "8464b956f6a5aa5061695990a14b7a385d370c2e", + "code/bit/producer/frames.py": "b28c3b2413b9767e7ffe0a8b2db93836f3455494", + "code/bit/producer/fullword.py": "104f01b7803481b623809bc8a57682d28f09b5c3", + "code/bit/producer/ham1.py": "8086649a5f71c16698db7059bbada7187d781b56", + "code/bit/producer/ham2.py": "842f76b245a1bfb4150c53a853f6f472511f5a2f", + "code/bit/producer/params-r865.json": "110b4d94d884f03d4d37be22672ab27d836f1275", + "code/bit/producer/price.py": "9014d97d519eea1f8c96e4bfc75afa0febd5903f", + "code/bit/producer/search2.py": "b653f4b52ac743e7b6280bb1a5e3954ac1ad84bc", + "code/bit/receipts_e8.py": "f514db37ab4c265b9546c8c0fe02e3faf9667a4e", + "code/bit/regression/certify_bit.py": "b8a6c4be5931daa83921e23ee5ad3ab263ca8ce8", + "code/bit/regression/columns_h_pr346.cpp": "07b7fd220c1742eb9c634e8572bef2df8d1f2aa6", + "code/bit/regression/cost.py": "677584c1c6b0e959c19f58521b68d4b3e847f97e", + "code/bit/regression/json.hpp": "82d69f7c5d044c9887c96b90c97f5639083ecd14", + "code/bit/regression/legality_h_pr346.cpp": "f4501be83a229cac1f3050993a204d8f75b86108", + "code/bit/regression/prime_new.py": "372ce0958a23c0312209a0a0c6ea11af34e8a92d", + "code/bit/regression/prime_witnesses.py": "7f16d930302ae879c562dd58e085d9747fcac077", + "code/bit/regression/stage_cohort.py": "f6d7afe3e623208c4207b6a683a1e3e49249e31c", + "code/bit/regression/tile_check.py": "1e537bd2e48b93bbfdcbdec42672075a2441b584", + "code/complex/code/complex_basis.py": "8c400798a5f25d366747b35cb55e985222039083", + "code/complex/code/complex_gx.py": "0986cc810e1d72ffb2b9ea70d1fe40517bbf2d76", + "code/complex/code/complex_labels.py": "5f1c9a65f1b0f096455805dc07832a38ca6eac7b", + "code/complex/code/p10pins.py": "8fd60cd9171d1c06f3ed93617612d7d8acc10cbb", + "code/complex/code/scatter.py": "20142c9851b9c10392bdcf0dd042a2cf8705f945", + "code/complex/inputs/complex/LICENSE": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "code/complex/inputs/complex/NOTICE": "63aa295646734f62c4270e653811530f9a570d3a", + "code/complex/inputs/complex/retained/FINITE_BRIDGE.txt": "c1a88436113a1351f80c72bd08f6406ed5faa51d", + "code/complex/inputs/complex/retained/compact-control-layout.tex": "16f4d233471a7d189163ae7e7902becadecbba64", + "code/complex/inputs/complex/retained/compact-control-movement.tex": "06b6a9ef24245ac7b724c53a204635415b402357", + "code/complex/inputs/complex/retained/copied-centers-assembly.tex": "b0c69166c3048d27518355995e3e5b622722c696", + "code/complex/inputs/complex/retained/copied-centers-lemma.tex": "8933aaf508aa9d4c75ba1290913e02f6868d351d", + "code/complex/inputs/complex/retained/endpoint-gauge-complex.tex": "907a0ceda8df0317ddc7f2b71df5af2aa4d47dfc", + "code/complex/inputs/complex/retained/general-clifford-frames.tex": "0367eeb005298601f28a673861d6f71bf1d0ebbb", + "code/complex/inputs/complex/retained/stopped-product-complex.tex": "4a9037137cd3158dbeca6d9e3b1881a599ebfcb5", + "code/complex/inputs/complex/source-pins.json": "c555ff203f493b10c87f51feeeabb26c92544064", + "code/complex/inputs/complex/sources/Work__Bridge__Cert.lean": "f7bdc3d903341a9546056cde124d642e2677318b", + "code/complex/inputs/complex/sources/Work__Bridge__Net.lean": "204f6d9cf902c85900f237bd99a23774e9a3f81b", + "code/complex/inputs/complex/sources/Work__Carrier__Live.lean": "b8306527d64ae06271c6aa55c5e0b3ded85c651c", + "code/complex/inputs/complex/sources/Work__Carrier__Phases.lean": "305da15b5d129959a0696e2031289eea91ec1813", + "code/complex/inputs/complex/sources/Work__Fourier__Main.lean": "9aa06b5bf28a2380ef9d54a0785ac2369f6012e4", + "code/complex/inputs/complex/sources/Work__GCert__Chain__Geom.lean": "eb4490af8b0f5b97984d9dbdf345d86fe65d02c7", + "code/complex/inputs/complex/sources/Work__GCert__Chain__InvThm.lean": "d69fcb4992778bcd2d12596e365ee8483aa538a2", + "code/complex/inputs/complex/sources/Work__GCert__Chain__NetCert.lean": "6336ba076607f4229c58e51b01f35b8457effb88", + "code/complex/inputs/complex/sources/Work__GCert__Chain__NetDef.lean": "c13042eb43328f9771a5f85e83edb59810f3a006", + "code/complex/inputs/complex/sources/Work__GCert__Chain__NetStage.lean": "670f4c6a84b3453dd0b1bc0879fff3ecd9410919", + "code/complex/inputs/complex/sources/Work__GCert__Chain__Phased.lean": "e68c42377f4fd0d0352ba697357d05f60333c8dc", + "code/complex/inputs/complex/sources/Work__GCert__Chain__WinB.lean": "951edde5cf5fdfb1dd5f7902499f3ccab961bf4a", + "code/complex/inputs/complex/sources/Work__GCert__Data__B2Gp193Main.lean": "d7ecfebcea804af8209a0db3d89caa9ed364ea7a", + "code/complex/inputs/complex/sources/Work__GCert__Data__Glue.lean": "c6cbac38e3a2fbabac74610519e26fcc065f7ff5", + "code/complex/inputs/complex/sources/Work__GCert__Data__InstB2Gp193.lean": "9b9925ce268a9f757fd44913140a57df95315769", + "code/complex/inputs/complex/sources/Work__GCert__Data__P193Cert.lean": "3c3250279e66b56c9fee8a12c265ae2780ce4761", + "code/complex/inputs/complex/sources/Work__GCert__Data__P193Price.lean": "eeed011d64482adbdf0d6ff48a7c395a7252d57a", + "code/complex/inputs/complex/sources/Work__GCert__Data__P193ScalOK.lean": "3539192ac1d3a51641f7ba08fa06a8659b12bc0b", + "code/complex/inputs/complex/sources/Work__GCert__Data__RateB2Gp193x.lean": "df563cde73a8f942e9c90189261dd6e8482d40f1", + "code/complex/inputs/complex/sources/Work__GCert__Data__Raw.lean": "499fa67e88ebfe0ad777081cb61def3f74de81ba", + "code/complex/inputs/complex/sources/Work__GCert__Data__SolutionB2Gp193x.lean": "0392e1f05bb89cca472c976391a649418dde186e", + "code/complex/inputs/complex/sources/Work__GFrame__Engine__Adapt.lean": "24e261ad0862ba778f0e7f00d48756865b7f4eb8", + "code/complex/inputs/complex/sources/Work__GFrame__Engine__Letters.lean": "2eca6e713bfd47449b872a0462857806861be9d5", + "code/complex/inputs/complex/sources/Work__GFrame__Engine__Level.lean": "6bd7cfa0c3f34bbd04fc445eceae0cc4d4c567fc", + "code/complex/inputs/complex/sources/tools__gx__ORIGIN.md": "e28b355d0a271da6c8c7da8b6d68451817378bf1", + "code/complex/inputs/complex/sources/tools__gx__gx.py": "6d14c0a976146eb881c1e3897b2476f8633d4e9c", + "code/complex/inputs/complex/sources/tools__gx__gxbind.py": "fcb625619cb07a9be9594422357786ca6e3c4add", + "code/complex/inputs/complex/sources/tools__gx__gxconv.py": "49ebb65973a2403bb22aa32692762cd0522a0287", + "code/complex/inputs/complex/sources/tools__gx__gxcore.py": "3e3f0a3076f3c326e7833c74eceecb3436dd3185", + "code/complex/inputs/e8/LICENSE": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64", + "code/complex/inputs/e8/NOTICE": "7008ce01c1f84c4ac181dd9382a94c83a1a172aa", + "code/complex/inputs/e8/Work/GCert/Data/B2Ge8.lean": "d1e3afba66b01bdc95d55d805ae63efa653031ff", + "code/complex/inputs/e8/Work/GCert/Data/B2Ge8Main.lean": "ef1487658291016d68e78b865f9239d100c69e1c", + "code/complex/inputs/e8/Work/GCert/Data/ChallengeB2Ge8x.lean": "c6c1567f5dfe456c5ffe4aad42598363df0a747a", + "code/complex/inputs/e8/Work/GCert/Data/E8Cert.lean": "ab43d9bf07756e60715ffad5e1f644cc2a1e6978", + "code/complex/inputs/e8/Work/GCert/Data/E8Price.lean": "71b561645b714e82324a649d540e0628bc7c8c66", + "code/complex/inputs/e8/Work/GCert/Data/E8ScalOK.lean": "0657e91b9975ca1dfa8da21ddd37e81e8a58adb6", + "code/complex/inputs/e8/Work/GCert/Data/Gen/E8.lean": "c8165c355b811de25107973fe7e22e2ea036bf51", + "code/complex/inputs/e8/Work/GCert/Data/Gen/E8/S0.lean": "5069b78564d65fcd7ea4a4865871cb783958a2c0", + "code/complex/inputs/e8/Work/GCert/Data/Gen/E8End.lean": "dfec705e0e8de5098b1359e4deaa07d14fa595e3", + "code/complex/inputs/e8/Work/GCert/Data/Gen/E8Hist.lean": "4c0a89ebc5b5ae8c23d94a576d8752056179b99a", + "code/complex/inputs/e8/Work/GCert/Data/Gen/E8Par.lean": "9ace01b6f3ea6f04174a4d15ba700544b057df8a", + "code/complex/inputs/e8/Work/GCert/Data/Gen/E8Scal0.lean": "219dd4f6dba8e79a8b041acc999938253d1a12f6", + "code/complex/inputs/e8/Work/GCert/Data/Gen/E8Seg0.lean": "b69b6fdff45e26b5eae1b394c8556b13c1f4aa40", + "code/complex/inputs/e8/Work/GCert/Data/Gen/E8Seg1.lean": "a05e925bdef191129c376518b18d0061f52fc9a4", + "code/complex/inputs/e8/Work/GCert/Data/Gen/E8SegF.lean": "72addebadbfea53898f7664f923f4f6f80b58c6c", + "code/complex/inputs/e8/Work/GCert/Data/Gen/E8Tab0.lean": "8995e049e05267f04b48eb4e9232bb8b056c4fec", + "code/complex/inputs/e8/Work/GCert/Data/Gen/E8Tab1.lean": "38ccb738cedf7e10794161a90313cea62a3f6360", + "code/complex/inputs/e8/Work/GCert/Data/Gen/E8Tab2.lean": "bc10a63187ba520d96e2d8bba3349afe334a7233", + "code/complex/inputs/e8/Work/GCert/Data/Gen/E8Tab3.lean": "07453a6580dcfb848970fce591c1a7e64867f860", + "code/complex/inputs/e8/Work/GCert/Data/Gen/E8YChk.lean": "e7129aa67f278d4fc1656f1d814bc4e6251a324c", + "code/complex/inputs/e8/Work/GCert/Data/InstB2Ge8.lean": "be583c65d3a375aea13449a3b52fc07be39a60ea", + "code/complex/inputs/e8/Work/GCert/Data/RateB2Ge8.lean": "46c0ed04cdadb5a3bf15920e51dc537fdfa43eb2", + "code/complex/inputs/e8/Work/GCert/Data/RateB2Ge8x.lean": "10c148fd72833f12e94e5a1770e13d60eaa6f8dc", + "code/complex/inputs/e8/Work/GCert/Data/SolutionB2Ge8x.lean": "bfa1d0308824cb8c4261a78b5eb7a297fce2ab4c", + "code/complex/inputs/e8/comparator/B2Ge8x.json": "7fda546848f67f704e3f900c2c2f82d44f48deee", + "code/complex/inputs/e8/tools/certificate/gcert1-e8-r783.json.gz": "0bd0bacf744f1c31419e05b834e34a92be77ae57", + "code/complex/inputs/e8/tools/e8/replay.py": "a281ae6687ec6d8c6f71480bba7507f0b1eb4fd1", + "code/complex/inputs/e8/tools/gen/foldgen.py": "a6287172bab665b9e5f125256dd535590c2be5f4", + "code/complex/inputs/e8/tools/gen/foldlib.py": "2cd642ec9e3d5b4b31ccaeec8eaafad5dab7790d", + "code/complex/inputs/e8/tools/gen/gen_rates.py": "8f90a197ba4642c36f82e804be5fd23e3c688b19", + "code/complex/inputs/e8/tools/gen/gen_sharp.py": "e28409ef864a8d6970d0a45457f67b08c1f0e380", + "code/complex/inputs/e8/tools/gen/templates/ChallengeB2L16x.lean.txt": "5863ad32a049b0e1f3ebe48a6bcb4b67f1009fb4", + "code/complex/inputs/e8/tools/gen/templates/SolutionB2L16x.lean.txt": "c111b98f65c32c1c29fe625880b4e836636d119b", + "code/complex/inputs/e8/tools/gx/gsmirror.py": "35af7ef46bd21341813b0e483b268fea60556896", + "code/complex/inputs/e8/tools/gx/gxbind.py": "fcb625619cb07a9be9594422357786ca6e3c4add", + "code/complex/inputs/e8/tools/gx/gxcore.py": "3e3f0a3076f3c326e7833c74eceecb3436dd3185", + "code/complex/inputs/e8/tools/gx/gxgen.py": "12d847f09db92df2c68d10faf8c7403322110ef7", + "code/complex/inputs/e8/tools/gx/gxpaths.py": "355613a9c9641b4ec7754cd2503684bf60ac9aaf", + "code/complex/inputs/e8/tools/gx/gxrate.py": "6a58830d4c5eb950b5f73567374ec786a4ae4982", + "code/complex/inputs/e8/tools/gx/gxunit.py": "2c4587038c5f33358600b9feca285487e8453cfb", + "code/complex/inputs/e8/tools/gx/regen_check.py": "720c4c06afb82330a4f23f1c3f7d3d529038b876", + "code/complex/inputs/e8/tools/gx/regen_check_e8.py": "c4db78c06fa6a5f21f7323edf8bf3d13ab07a931", + "code/complex/pins-e8.json": "ba757ae806be2599b6c9d3b0ca9e2143ef409ef1", + "code/pricing/base_two_moment.py": "14a90fa0e788217856f070382c9e61bd7c603c61", + "code/pricing/moment.py": "7d697cb45203fe72d97037403d6da41f71f3b7fd", + "code/pricing/outer.py": "43007488ad2c43187c77cc6798beff8b1cd76ad2", + "code/pricing/prime_witnesses.py": "7f16d930302ae879c562dd58e085d9747fcac077", + "data/bit/RECORD-SHA256SUMS": "53458062d6193eb1954592cb503fb75808e2b1cf", + "data/bit/bitE8-r865.json.gz": "8bec1751f7e33c3a1e4673ef5dbc34d6f205321e", + "data/regression-p10/BASE-RECORDS.bin.gz": "087f8261242e0e897907b8d4a86a7e1d100df172", + "data/regression-p10/BASE-frames.json.gz": "42ad5869ca5927c51daaa0af887c58960a4b37e3", + "data/regression-p10/BASE-states.json.gz": "427bc873b9ac858dd42c41b7a0cf8523e7dc3d09", + "data/regression-p10/receipts-loans/banks.json.gz": "6a543b0dba04265f032f10bcbdb3dabbf07d13e7", + "data/regression-p10/receipts-loans/finite.json.gz": "a7ab4e1dce3e01d01b10574e77a547b3b5027c31", + "data/regression-p10/receipts-loans/global_result.json.gz": "7a6dbc0dfe280dd7ed6014b1d492a61e573ca5a3", + "data/regression-p10/receipts-loans/math.json.gz": "ee8102218a6d127b1dc6570778468658a8da273b", + "data/regression-p10/receipts-loans/raw.json.gz": "3a965a6005d9bff179b9500307044ccb7eaf8c2c", + "data/regression-p10/receipts-loans/scalar.json.gz": "5d4d5e1a2db03851fe71c8a48364ce58a3b5548a" + }, + "changed": [] +} \ No newline at end of file diff --git a/research/e8-seven-stage-halving-two/SOURCE-pr373.json b/research/e8-seven-stage-halving-two/SOURCE-pr373.json new file mode 100644 index 0000000000..398edc96af --- /dev/null +++ b/research/e8-seven-stage-halving-two/SOURCE-pr373.json @@ -0,0 +1,24 @@ +{ + "schema": "pr373-provenance/1", + "source": "https://github.com/CrocSwap/integer-mult-bounds/pull/373", + "commit": "3ff87b5dc0b22a57958547ee347d5da25b7f9401", + "source_root": "research/e8-bit-seven-stage", + "note": "Every file under \"identical\" has, in this package, the git blob id it has in PR #373 at the commit above (git ls-tree -r 3ff87b5dc0b22a57958547ee347d5da25b7f9401 -- research/e8-bit-seven-stage). Files under \"changed\" exist there under the same path and were edited here.", + "identical": { + "code/bit/checkers/certify_bit_k.py": "6560951d798e3fe4aebcd1c442e67edc87b4ed9b", + "code/bit/checkers/columns_k.cpp": "42bb232fbec4de703e70cc13dc2f39a3b43a3a01", + "code/bit/checkers/finite_k.py": "3a284fa4b27ca9034feed02a03afc882b9914ac0", + "code/bit/checkers/geometry_k.py": "f8afa8c245c720092062b1b1d805f5a58d77f11b", + "code/bit/checkers/tile_k.py": "a4635e6681c2f1521b44f24364cc457d304cb077", + "code/bit/receipts_k.py": "428261488b4af028fd04df4f84eead1dad79a389", + "requirements.txt": "97fc30544865b9fcda4636ad0879a636b078ae1e" + }, + "changed": [ + "NOTICE.md", + "README.md", + "code/certify_b3.py", + "code/complex/portable_complex.py", + "code/provenance.py", + "verify.sh" + ] +} \ No newline at end of file diff --git a/research/e8-seven-stage-halving-two/code/bit/checkers/certify_bit_g.py b/research/e8-seven-stage-halving-two/code/bit/checkers/certify_bit_g.py new file mode 100644 index 0000000000..d257992e31 --- /dev/null +++ b/research/e8-seven-stage-halving-two/code/bit/checkers/certify_bit_g.py @@ -0,0 +1,46 @@ +"""Generalized (Dylan Crow, with Anthropic Claude assistance): h, the normalization T and the output path are arguments; +h = 20, T = 12 is the original. usage: certify_bit_g.py WORDDIR B H T OUT.json +Exact bit coarse saving + outer assembly for a PR249-format local word, using PR #315's engines +(moment.py, base_two_moment.py, outer.py) and its math_check.run logic, with a given complex coarse b.""" +import sys, json, importlib.util, os +from fractions import Fraction as Q +from collections import Counter +sys.path.insert(0,os.path.dirname(os.path.abspath(__file__))) +import cost as C +P=os.environ.get('PR315',os.path.join(os.path.dirname(os.path.abspath(__file__)),'..','..','pricing'))+'/' +def load(n): + s=importlib.util.spec_from_file_location(n,P+n+'.py'); m=importlib.util.module_from_spec(s); s.loader.exec_module(m); return m +moment=load('moment'); other=load('base_two_moment'); outer=load('outer') +d=sys.argv[1]; b=Q(sys.argv[2]); HH=int(sys.argv[3]); T=int(sys.argv[4]); OUT=sys.argv[5] +s,fr,dim,rec=C.load_snapshot(d) +H,resid,v=C.local_profile(rec,s,dim,h=HH); prof,W,m,deficit=C.five_stage(H,resid,v,h=HH) +norm={int(k):int(c)*T for k,c in prof.items() if c}; Wn=Q(4*v*HH+resid,HH)*T; assert Wn.denominator==1; Wn=int(Wn); m=5*HH +mass=sum(k*c for k,c in norm.items()); print('normalized W',Wn,'calls',sum(norm.values()),'mass',mass,'deficit',m*Wn-mass,'maxchild',max(norm)) +root=moment.certify(dict(norm),m,Wn,True); c=Q(int(Q(root['lower'])*10**18),10**18) +bm=moment.moment(norm,m,Wn,c,True); nextbm=moment.moment(norm,m,Wn,c+Q(1,10**18),True); assert bm[1]<1cap-grid, 'complex-bound saving not tight against the cap' +chain=[Q(384599,10**10)] +for _ in range(3): + a=(1-sv)*sv+sv*chain[-1]; assert chain[-1]0 +try: + outer.assembly(bit,b,bridge,k+Q(1,10**18),eta=eta,beta=beta); raise SystemExit('ADJACENT ADMITTED') +except AssertionError: pass +if binding=='complex': + try: outer.assembly(cap,b,bridge,k,eta=eta,beta=beta) + except AssertionError as e: assert 'leaf_saving_above_bit' in str(e); print('complex leaf cap itself rejected (leaf_saving_above_bit), as in PR #315 math_check') + else: raise SystemExit('complex leaf cap admitted') +print('complex b =',b,float(b),'| binding:',binding) +print('KAPPA =',k,'=',format(float(k),'.12e'),'| 47 strict constraints positive, adjacent grid point rejected') +json.dump(dict(word=d,h=HH,T=T,maxchild=max(norm),bit_moment_interval=[str(x) for x in bm],normalized_histogram=norm,W=Wn,m=m,bit_coarse=str(c),complex_coarse=str(b),binding=binding,kappa=str(k),kappa_float=float(k)),open(OUT,'w'),indent=1) diff --git a/research/e8-seven-stage-halving-two/code/bit/checkers/certify_bit_k.py b/research/e8-seven-stage-halving-two/code/bit/checkers/certify_bit_k.py new file mode 100644 index 0000000000..6560951d79 --- /dev/null +++ b/research/e8-seven-stage-halving-two/code/bit/checkers/certify_bit_k.py @@ -0,0 +1,54 @@ +"""Generalized (Dylan Crow, with Anthropic Claude assistance): h, the normalization T and the output path are arguments; +h = 20, T = 12 is the original. Bridged word B_K (DaysSky, assisted with Claude): the one-level histogram is +(2K+1) x the local histogram + 2v x the idle blocks of PR #363's bridged.check(K, h) (split below m/2 for K > 2), +W = 2Kv + resid/h, m = (2K+1) h; K = 2 is certify_bit_g.py. usage: certify_bit_k.py WORDDIR B K H T OUT.json +Exact bit coarse saving + outer assembly for a PR249-format local word, using PR #315's engines +(moment.py, base_two_moment.py, outer.py) and its math_check.run logic, with a given complex coarse b.""" +import sys, json, importlib.util, os +from fractions import Fraction as Q +from collections import Counter +sys.path.insert(0,os.path.dirname(os.path.abspath(__file__))) +import cost as C +sys.path.insert(0,os.path.join(os.path.dirname(os.path.abspath(__file__)),'..','..','complex','code')) +import bridged +P=os.environ.get('PR315',os.path.join(os.path.dirname(os.path.abspath(__file__)),'..','..','pricing'))+'/' +def load(n): + s=importlib.util.spec_from_file_location(n,P+n+'.py'); m=importlib.util.module_from_spec(s); s.loader.exec_module(m); return m +moment=load('moment'); other=load('base_two_moment'); outer=load('outer') +d=sys.argv[1]; b=Q(sys.argv[2]); KP=int(sys.argv[3]); HH=int(sys.argv[4]); T=int(sys.argv[5]); OUT=sys.argv[6]; S=2*KP+1 +s,fr,dim,rec=C.load_snapshot(d) +H,resid,v=C.local_profile(rec,s,dim,h=HH); m=S*HH +lay=bridged.check(KP,HH,split=(m-1)//2 if KP>2 else None) +prof=Counter({j:S*c for j,c in H.items()}) +for r in lay['blocks_per_role_pair']: prof[r]+=2*v +norm={int(k):int(c)*T for k,c in prof.items() if c}; Wn=Q(2*KP*v*HH+resid,HH)*T; assert Wn.denominator==1; Wn=int(Wn) +assert 2*max(norm)cap-grid, 'complex-bound saving not tight against the cap' +chain=[Q(384599,10**10)] +for _ in range(3): + a=(1-sv)*sv+sv*chain[-1]; assert chain[-1]0 +try: + outer.assembly(bit,b,bridge,k+Q(1,10**18),eta=eta,beta=beta); raise SystemExit('ADJACENT ADMITTED') +except AssertionError: pass +if binding=='complex': + try: outer.assembly(cap,b,bridge,k,eta=eta,beta=beta) + except AssertionError as e: assert 'leaf_saving_above_bit' in str(e); print('complex leaf cap itself rejected (leaf_saving_above_bit), as in PR #315 math_check') + else: raise SystemExit('complex leaf cap admitted') +print('complex b =',b,float(b),'| binding:',binding) +print('KAPPA =',k,'=',format(float(k),'.12e'),'| 47 strict constraints positive, adjacent grid point rejected') +json.dump(dict(word=d,K=KP,stages=S,idle_blocks_per_role_pair=lay['blocks_per_role_pair'],h=HH,T=T,maxchild=max(norm),bit_moment_interval=[str(x) for x in bm],normalized_histogram=norm,W=Wn,m=m,bit_coarse=str(c),complex_coarse=str(b),binding=binding,kappa=str(k),kappa_float=float(k)),open(OUT,'w'),indent=1) diff --git a/research/e8-seven-stage-halving-two/code/bit/checkers/columns_h.cpp b/research/e8-seven-stage-halving-two/code/bit/checkers/columns_h.cpp new file mode 100644 index 0000000000..00c5a3a5d8 --- /dev/null +++ b/research/e8-seven-stage-halving-two/code/bit/checkers/columns_h.cpp @@ -0,0 +1,48 @@ +// Generalization (Dylan Crow, with Anthropic Claude assistance): the copied-centre count is the macro NCOPY, defaulting to +// HDIM, so the unmodified PR #346/#352 build (no -DNCOPY) is exactly the original checker. The E8 bit word has 9 +// retained totals at h = 8 (-DNCOPY=9). +#ifndef NCOPY +#define NCOPY HDIM +#endif +#include "json.hpp" +#include +#include +using boost::multiprecision::cpp_int; +#include +#include +#include +#include +#include +#include +#include +using J=nlohmann::json; +struct E{int kind,dst,src,c;}; +void need(bool x,const char*s){if(!x)throw std::runtime_error(s);} +int main(int argc,char**argv){try{ +need(argc==3,"usage RAW6_RECORDS OUTPUT");std::string pre=argv[1];int v=VPORTS,r=RHELP,loc=2*v+r,global=4*v+r,temp=global; +struct Raw{int op,a,b,c,f,z;};std::ifstream f(pre,std::ios::binary|std::ios::ate);size_t sz=f.tellg();need(sz%sizeof(Raw)==0,"stream alignment");std::vectorp(sz/sizeof(Raw));f.seekg(0);f.read((char*)p.data(),sz);std::vectore;std::mapH;for(auto q:p){if(q.op==0){if(q.f)H[q.f]++;}else if(q.op==1)e.push_back({0,q.a,q.b,q.c});else if(q.op==2){H[q.z]++;e.push_back({1,loc,q.a,0});}else if(q.op==3)e.push_back({2,loc,q.a,0});else need(false,"opcode");} +J prefix=J::array();cpp_int largestF=0,largestB=0;for(int rev=0;rev<2;rev++){std::vectornorms(loc+1,1);cpp_int maxrow=1;bool isopen=false;for(size_t z=0;zmaxrow)maxrow=norms[q.dst];}else if(k==1){need(!isopen,"boundcopy");norms[loc]=norms[q.src];isopen=true;}else {need(isopen,"bounderase");norms[loc]=0;isopen=false;}}need(!isopen,"prefix copy closure");if(rev)largestB=maxrow;else largestF=maxrow;prefix.push_back({{"reverse",bool(rev)},{"cancellation_free_signed_row_l1_upper",maxrow.convert_to()},{"bits",boost::multiprecision::msb(maxrow)+1}});} +cpp_int payload=64*largestF*largestF*largestF*largestB*largestB;need(payload<(cpp_int(1)<<104),"payloadfiniteprefix2^104"); +long long copies=0,adds=0,odd=0;bool open=false;int center=-1;long long reverseCopies=0; +for(auto q:e){need(q.kind>=0&&q.kind<=2,"kind");need(q.dst>=0&&q.dst<=loc,"local dst");if(q.kind==0){need(q.src>=0&&q.src<=loc&&q.dst!=q.src,"source distinct");need(q.dst!=loc,"copy immutable");need(q.src!=loc||open,"temp not open");if(open)need(q.dst!=center,"source changes inside copied-center block");adds++;odd+=q.c&1;} +else if(q.kind==1){need(!open&&q.dst==loc&&q.src>=0&&q.srca((size_t)(global+1)*words);auto row=[&](int i){return a.data()+(size_t)i*words;};for(int i=0;i=v&&i<2*v&&w==(size_t)(i-v)/64)want^=1ull<<((i-v)%64);need(x[w]==want,"local defining-decoder full formal column");}}} +if(stage==1||stage==2||stage==4){int b=stage==1?0:stage==2?1:2;for(auto q:bridges[b])for(int i=0;i(std::chrono::steady_clock::now()-t0).count()<<"s\n";} +for(int bank=0;bank<4;bank+=2)for(int i=0;i()},{"payload_prefix_bits",boost::multiprecision::msb(payload)+1},{"new_Q_categories",{28,29}},{"local_raw_H",H},{"negative_controls",controls},{"seconds",std::chrono::duration(std::chrono::steady_clock::now()-t0).count()}};std::ofstream(argv[2])< +#include +using boost::multiprecision::cpp_int; +#include +#include +#include +#include +#include +#include +#include +using J=nlohmann::json; +struct E{int kind,dst,src,c;}; +void need(bool x,const char*s){if(!x)throw std::runtime_error(s);} +int main(int argc,char**argv){try{ +need(argc==3,"usage RAW6_RECORDS OUTPUT");std::string pre=argv[1];int v=VPORTS,r=RHELP,loc=2*v+r,global=2*KPAIRS*v+r,temp=global;const int S=2*KPAIRS+1; +struct Raw{int op,a,b,c,f,z;};std::ifstream f(pre,std::ios::binary|std::ios::ate);size_t sz=f.tellg();need(sz%sizeof(Raw)==0,"stream alignment");std::vectorp(sz/sizeof(Raw));f.seekg(0);f.read((char*)p.data(),sz);std::vectore;std::mapH;for(auto q:p){if(q.op==0){if(q.f)H[q.f]++;}else if(q.op==1)e.push_back({0,q.a,q.b,q.c});else if(q.op==2){H[q.z]++;e.push_back({1,loc,q.a,0});}else if(q.op==3)e.push_back({2,loc,q.a,0});else need(false,"opcode");} +J prefix=J::array();cpp_int largestF=0,largestB=0;for(int rev=0;rev<2;rev++){std::vectornorms(loc+1,1);cpp_int maxrow=1;bool isopen=false;for(size_t z=0;zmaxrow)maxrow=norms[q.dst];}else if(k==1){need(!isopen,"boundcopy");norms[loc]=norms[q.src];isopen=true;}else {need(isopen,"bounderase");norms[loc]=0;isopen=false;}}need(!isopen,"prefix copy closure");if(rev)largestB=maxrow;else largestF=maxrow;prefix.push_back({{"reverse",bool(rev)},{"cancellation_free_signed_row_l1_upper",maxrow.convert_to()},{"bits",boost::multiprecision::msb(maxrow)+1}});} +cpp_int payload=64*largestF*largestF*largestF*largestB*largestB;need(payload<(cpp_int(1)<<104),"payloadfiniteprefix2^104"); +long long copies=0,adds=0,odd=0;bool open=false;int center=-1;long long reverseCopies=0; +for(auto q:e){need(q.kind>=0&&q.kind<=2,"kind");need(q.dst>=0&&q.dst<=loc,"local dst");if(q.kind==0){need(q.src>=0&&q.src<=loc&&q.dst!=q.src,"source distinct");need(q.dst!=loc,"copy immutable");need(q.src!=loc||open,"temp not open");if(open)need(q.dst!=center,"source changes inside copied-center block");adds++;odd+=q.c&1;} +else if(q.kind==1){need(!open&&q.dst==loc&&q.src>=0&&q.src>active;std::vectorbackward;std::vector>>after(S); +auto X=[](int p){return 2*(p-1);};auto Y=[](int p){return 2*(p-1)+1;}; +for(int t=0;t=3&&t%2==1);backward.push_back(b);active.push_back(b?std::array{Y(p),X(p)}:std::array{X(p),Y(p)});} +for(int q=2;q<=KPAIRS;q++){after[2*q-3].push_back({X(q-1),X(q),1});after[2*q-3].push_back({Y(q),Y(q-1),-1}); + after[2*q-2].push_back({Y(q),Y(q-1),1});after[2*q-2].push_back({X(q-1),X(q),-1});} +for(int p=KPAIRS;p>=2;p--){after[S-1].push_back({Y(p-1),Y(p),-1});after[S-1].push_back({X(p),X(p-1),1});} +int nbridges=0;for(auto&a:after)nbridges+=a.size();need(nbridges==6*(KPAIRS-1),"twin bridge count"); +size_t words=(global+63)/64;std::vectora((size_t)(global+1)*words);auto row=[&](int i){return a.data()+(size_t)i*words;};for(int i=0;i=v&&i<2*v&&w==(size_t)(i-v)/64)want^=1ull<<((i-v)%64);need(x[w]==want,"local defining-decoder full formal column");}}} +for(auto q:after[stage])for(int i=0;i(std::chrono::steady_clock::now()-t0).count()<<"s\n";} +for(int bank=0;bank<2*KPAIRS;bank+=2)for(int i=0;ib(2*KPAIRS);for(int z=0;z<2*KPAIRS;z++)b[z]=1u<()},{"payload_prefix_bits",boost::multiprecision::msb(payload)+1},{"new_Q_categories",{28,29}},{"local_raw_H",H},{"negative_controls",controls},{"seconds",std::chrono::duration(std::chrono::steady_clock::now()-t0).count()}};std::ofstream(argv[2])< 0: H[int(r[4])] += 1 + copies = rec[rec[:, 0] == 2] + for r in copies: + if r[5] > 0: H[int(r[5])] += 1 + init = s['initial'] + resid = sum(h - dim[init[str(r)]] for r in range(2 * v, n)) + return H, resid, v + +def five_stage(H, resid, v, h=24, stages=5): + m = stages * h + prof = collections.Counter() + for j, c in H.items(): prof[j] += stages * c + for j in (2*h - 2, h - 1, 2*h + 2, 4): prof[j] += 2 * v + W = mpf(4 * v) + mpf(resid) / h + mass = sum(j * c for j, c in prof.items()) + return prof, W, m, W * m - mass + +def solve_moment(prof, W, m, bad=mpf('1e-16')): + calls = sum(prof.values()) + items = [(mpf(j) / m, c) for j, c in prof.items()] + def mu(sv): + t = 1 - sv + return (sum(c * x ** t for x, c in items) + bad * 32 * m * m * calls * (mpf(1) / m) ** t) / W - 1 + return findroot(mu, mpf('0.0007')) + +def evaluate(rec, s, dim, h=24): + H, resid, v = local_profile(rec, s, dim, h) + prof, W, m, deficit = five_stage(H, resid, v, h) + sv = solve_moment(prof, W, m) + return dict(saving=sv, kappa_approx=sv / (1 + sv), W=W, deficit=deficit, m=m, + calls=sum(prof.values()), local=dict(sorted(H.items())), resid=resid) + +if __name__ == '__main__': + import sys + s, fr, dim, rec = load_snapshot(sys.argv[1]) + r = evaluate(rec, s, dim) + print({k: (float(v) if hasattr(v, 'real') and not isinstance(v, dict) else v) for k, v in r.items() if k != 'local'}) diff --git a/research/e8-seven-stage-halving-two/code/bit/checkers/exactnd_h.py b/research/e8-seven-stage-halving-two/code/bit/checkers/exactnd_h.py new file mode 100644 index 0000000000..fa90b5089f --- /dev/null +++ b/research/e8-seven-stage-halving-two/code/bit/checkers/exactnd_h.py @@ -0,0 +1,44 @@ +import json, sys, collections +def bareiss_det(M): + M=[row[:] for row in M]; n=len(M); sign=1; prev=1 + for k in range(n-1): + if M[k][k]==0: + sw=next((i for i in range(k+1,n) if M[i][k]!=0),None) + if sw is None: return 0 + M[k],M[sw]=M[sw],M[k]; sign=-sign + for i in range(k+1,n): + for j in range(k+1,n): + M[i][j]=(M[i][j]*M[k][k]-M[i][k]*M[k][j])//prev + prev=M[k][k] + return sign*M[n-1][n-1] +def rank_int(B): + # exact rank via fraction-free elimination + M=[r[:] for r in B]; r=0; cols=len(M[0]) if M else 0 + for c in range(cols): + p=next((i for i in range(r,len(M)) if M[i][c]!=0),None) + if p is None: continue + M[r],M[p]=M[p],M[r] + for i in range(len(M)): + if i!=r and M[i][c]!=0: + a,b=M[r][c],M[i][c]; M[i]=[x*a-y*b for x,y in zip(M[i],M[r])] + r+=1 + return r +HH=20 +new_dir=sys.argv[1]; base_dir=sys.argv[2] +fr=json.load(open(new_dir+'/frames.json'))['frames']; old=json.load(open(base_dir+'/frames.json'))['frames'] +new=[k for k in fr if k not in old or fr[k]['B']!=old[k]['B']] +bad=0; stats=collections.Counter() +for k in new: + B=fr[k]['B']; A=fr[k].get('A',[]) + d=len(B) + if d==0: continue + assert rank_int(B)==d, ('basis rank',k) + if A: + assert all(sum(a*b for a,b in zip(ra,rb))==0 for ra in A for rb in B), ('A.B',k) + assert len(A)+d==HH, ('A dim',k) + s=[sum(r) for r in B] + M=[[9*sum(B[i][t]*B[j][t] for t in range(HH))-s[i]*s[j] for j in range(d)] for i in range(d)] + det=bareiss_det(M) + stats[(d, det!=0)]+=1 + if det==0: bad+=1 +print('changed/new frames:',len(new),' exactly degenerate:',bad,' by (dim,nonzero det):',dict(stats)) diff --git a/research/e8-seven-stage-halving-two/code/bit/checkers/finite_g.py b/research/e8-seven-stage-halving-two/code/bit/checkers/finite_g.py new file mode 100644 index 0000000000..d1aa38980a --- /dev/null +++ b/research/e8-seven-stage-halving-two/code/bit/checkers/finite_g.py @@ -0,0 +1,146 @@ +"""Finite bill for the banked five-stage bit word, generalized from the source527/p10 finite_check.run (Dylan Crow, with +Anthropic Claude assistance). The arithmetic is the original line by line; the changes are explicit parameters: + * h, m = 5h, v, R, replicas T, literal stock, literal paid histogram, weighted/unit additions and the forward and + inverse cancellation-free row bounds are inputs (from this package's receipts); + * NCOPY, the copied-centre temporaries per invocation and 5*NCOPY copy/erase episodes per replica (the original + writes h for both, since the paired cube has h centres; the E8 word has 9 retained totals at h = 8); + * the 2h-dimensional rational route template: [[p*, k*], [k*, p*]] for the reference port line q* of the label + family under its form (original: a triple line under G = I - J/9, denominators 1,2,3,6; E8: a root line under + /2), recomputed and factored into elementary operations, exact inverse replay, omitted factor rejected; + * K, the conservative extra bank-selector calls, by the original formula 2*5*T*((live-1) + R*m*factors) with + factors = maxops + (m-1) + m (maxops of the actual charts; an ungauged word has only the identity chart, 0 ops). +usage: python3 finite_g.py e8 RECEIPTS.json | python3 finite_g.py regression P10_RECEIPT_DIR""" +from fractions import Fraction as Q +from collections import Counter +from hashlib import sha256 +import json, sys, os, importlib.util, gzip +HERE=os.path.dirname(os.path.abspath(__file__)) +def ceilq(x): return -((-x.numerator)//x.denominator) +def cutoff_log2(delta,C): + assert 0=1 + return max(1,ceilq(36/delta**2),ceilq(2*(4+(C-1).bit_length())/delta)) +def mm(A,B): return [[sum(A[i][k]*B[k][j] for k in range(len(B))) for j in range(len(B[0]))] for i in range(len(A))] +def route_template(h,q,form,g=None,ginv=None): + """[[g p* g^-1, g k*], [k* g^-1, p*]] with p* = q q^T G/; G given by form(x,y) on coordinate vectors + (bilinear); g = I (the original's reference port) unless a port isometry is given.""" + I=lambda n:[[Q(i==j)for j in range(n)]for i in range(n)] + Gq=[sum(form(i,j)*q[j] for j in range(h)) for i in range(h)]; nq=sum(q[i]*Gq[i] for i in range(h)) + P=[[Q(q[i])*Gq[j]/nq for j in range(h)]for i in range(h)] + K=[[Q(i==j)-P[i][j]for j in range(h)]for i in range(h)] + if g is None: TL,TR,BL=P,K,K + else: TL,TR,BL=mm(mm(g,P),ginv),mm(g,K),mm(K,ginv) + rho=[TL[i]+TR[i]for i in range(h)]+[BL[i]+P[i]for i in range(h)] + a=[r[:]for r in rho];factors=[] + for j in range(2*h): + p=next(i for i in range(j,2*h)if a[i][j]) + if p!=j:a[j],a[p]=a[p],a[j];factors.append(('swap',j,p,None)) + if a[j][j]!=1: + c=1/a[j][j];a[j]=[c*x for x in a[j]];factors.append(('scale',j,None,c)) + for i in range(2*h): + if i!=j and a[i][j]: + c=-a[i][j];a[i]=[x+c*y for x,y in zip(a[i],a[j])];factors.append(('add',i,j,c)) + assert a==I(2*h) + def replay(omit=None): + a=I(2*h) + for z in reversed(range(len(factors))): + if z==omit:continue + kind,i,j,c=factors[z] + if kind=='swap':a[i],a[j]=a[j],a[i] + elif kind=='scale':a[i]=[x/c for x in a[i]] + else:a[i]=[x-c*y for x,y in zip(a[i],a[j])] + return a + assert replay()==rho + omit=next((i for i,f in enumerate(factors)if f[0]=='add'),0) # original: the first addition; a route without additions: the first factor + assert factors and replay(omit)!=rho + counts=dict(Counter(f[0]for f in factors));denoms=sorted({c.denominator for kind,i,j,c in factors if c is not None}) + serialization=[[kind,i,j,None if c is None else str(c)]for kind,i,j,c in factors] + return dict(factors=len(factors),factor_counts=counts,denominators=denoms, + factor_program_sha256=sha256(json.dumps(serialization,separators=(',',':')).encode()).hexdigest(), + exact_inverse_reconstruction=True,missing_addition_rejected=True) +def bill(x): + """x: dict with h,m,v,R,T,stock,literal(hist),ncopy,weighted,unit,fwd_row,inv_row,K,coarse,moment_module,route.""" + h,m,v,R,T,stock,ncopy=x['h'],x['m'],x['v'],x['R'],x['T'],x['stock'],x['ncopy'] + literal=Counter(x['literal']);E=sum(literal.values());mass=sum(r*c for r,c in literal.items()) + assert m==5*h and Q(max(literal),m)0 and delta1>0 + chain=[Q(384599,10**10)];gaps=[] + for j in range(3): + old=chain[-1];a=(1-c)*c+c*old;ds=dict(atom=c-a,borrowing=1-a-c,remainder=1-a-c*(1-old),stock=1-c);assert old0 + delta=min(ds.values());L=cutoff_log2(delta,coefficient);assert Q(L)*delta**2>=36 and Q(L)*delta>=2*(4+(coefficient-1).bit_length()) + gaps.append(dict(stage=j+1,minimum_gap=str(delta),cutoff_log2_at_charged_coefficient=str(L)));chain.append(a) + controls=[] + for name,test in [('zero cutoff gap',lambda:cutoff_log2(Q(0),coefficient)),('negative constant',lambda:cutoff_log2(Q(1,2),0))]: + try:test() + except AssertionError:controls.append(name) + else:raise AssertionError('bad finite cutoff accepted') + return dict(coefficient=coefficient,coefficient_bits=coefficient.bit_length(),low_matrix_power=d,strict_upper='q^'+str(d+1), + positive_rank_children=E,rank_mass=mass,weighted_additions=weighted,unit_expanded_additions=unit,route_families=J, + copy_erase_episodes=5*ncopy*T,payload_prefix_upper=payload,payload_prefix_bits=payload.bit_length(), + delta_tau_lower=str(delta_tau),delta_linear=str(delta1),bootstrap_chain=list(map(str,chain)),gaps=gaps, + row_reserve=dict(internal_coefficient=d+1,external_complex_coefficient=20161),route=x['route'],rejected_controls=controls) +def load_moment(): + s=importlib.util.spec_from_file_location('m',os.path.join(HERE,'..','..','pricing','moment.py'));m=importlib.util.module_from_spec(s);s.loader.exec_module(m);return m +def hist(x): return Counter({int(k):v for k,v in x.items() if v}) +if __name__=='__main__': + mod=load_moment() + if sys.argv[1]=='regression': + d=sys.argv[2]; raw=json.load(open(d+'/raw.json')); sc=json.load(open(d+'/scalar.json')); bk=json.load(open(d+'/banks.json'))['banks'] + ma=json.load(open(d+'/math.json'))['mathematics']; fin=json.load(open(d+'/finite.json')); gl=json.load(open(d+'/global_result.json')) + h=raw['h'];m=5*h;H=hist(raw['five_stage_profile']['histogram']) + for a,cnt in hist(raw.get('completion_rank_histogram',raw['auxiliary_entrance_rank_histogram'])).items(): + H[5*a]-=cnt + if not H[5*a]: del H[5*a] + T=bk['physical_replicas']; literal=Counter({r:T*c for r,c in H.items()}) + q=[int(i<3) for i in range(h)]; form=lambda i,j: Q(int(i==j))-Q(1,9) + x=dict(h=h,m=m,v=raw['v'],R=raw['physical_R'],T=T,stock=bk['literal_stock'],literal=literal,ncopy=h,deficit=4*raw['v']-5*h*(h-2), + weighted=sc['forward']['weighted_additions'],unit=sc['forward']['literal_unit_additions'],fwd_row=sc['forward']['max_intermediate_row_l1'], + inv_row=sc['inverse']['max_intermediate_row_l1'],K=bk['conservative_extra_selector_calls'],coarse=ma['bit_coarse'],moment_module=mod, + route=route_template(h,q,form)) + r=bill(x) + assert r['coefficient']==fin['q_power_bound']['coefficient'],(r['coefficient'],fin['q_power_bound']) + assert r['bootstrap_chain']==fin['bootstrap']['chain'] and r['delta_tau_lower']==fin['moment']['delta_tau_lower'] and r['delta_linear']==fin['moment']['delta_linear'] + assert r['route']['factor_counts']==fin['rational_route']['factor_counts'] and r['route']['factor_program_sha256']==fin['rational_route']['factor_program_sha256'] + assert r['route']['denominators']==[1,2,3,6] + print('PASS regression: on the p = 10 receipts in',d,'the generalized bill reproduces the coefficient',r['coefficient'], + ', the moment gaps, the bootstrap chain and the 40-dimensional route program (sha',r['route']['factor_program_sha256'][:12]+'...)') + else: + x=json.load(open(sys.argv[2])) + q=x['qstar']; form=lambda i,j: Q(int(i==j),2) # E8 form /2 in Construction-A coordinates + x['route']=route_template(x['h'],q,form); x['moment_module']=mod; x['literal']=hist(x['literal']) + # every port: route conjugated by its W(E8) reflection word (the original's coordinate permutations are free + # relabelings; here the isometry is a rational program and is charged as part of the port route) + w=json.load(gzip.open(x['word'],'rt')); Lw=w['lines']; h=x['h'] + ip=lambda a,b: Q(sum(u*t for u,t in zip(a,b)),2) + def refl(r): + return [[Q(int(i==j))-Q(r[i]*r[j],2)*2/ip(r,r) for j in range(h)] for i in range(h)] + isom={0:[[Q(int(i==j)) for j in range(h)] for i in range(h)]}; fr=[0] + while fr: + nx=[] + for a_ in fr: + for b_ in range(len(Lw)): + if b_ in isom or abs(ip(Lw[a_],Lw[b_]))!=1: continue + d_=[u-t for u,t in zip(Lw[a_],Lw[b_])] if ip(Lw[a_],Lw[b_])==1 else [u+t for u,t in zip(Lw[a_],Lw[b_])] + isom[b_]=mm(refl(d_),isom[a_]); nx.append(b_) + fr=nx + assert len(isom)==len(Lw) and Lw[0]==q + ports=[]; allden=set(); maxf=0 + for t,g in isom.items(): + ginv=[[g[j][i]*1 for j in range(h)] for i in range(h)] # G = I/2 is scalar, so g^-1 = g^T + assert mm(g,ginv)==[[Q(int(i==j)) for j in range(h)] for i in range(h)] + gq=[sum(g[i][j]*q[j] for j in range(h)) for i in range(h)]; assert gq==Lw[t] or gq==[-u for u in Lw[t]] + r_=route_template(h,q,form,g,ginv); allden|=set(r_['denominators']); maxf=max(maxf,r_['factors']) + assert all(d_&(d_-1)==0 for d_ in allden), allden # powers of two: units modulo every odd prime q + x['route']['all_ports']=dict(ports=len(isom),max_factors=maxf,denominators=sorted(allden)) + r=bill(x); r.pop('route') if False else None + json.dump({k:(v if not isinstance(v,Counter) else dict(v)) for k,v in r.items()},open(sys.argv[3],'w'),indent=1,default=str) + print('PASS finite bill (E8, m = %d): coefficient %d (%d bits) < 2^80, q-power bound %s, payload prefix %d bits < 104, delta_tau %s, reference route %s; all %d port routes exact elementary programs, at most %d factors, denominators %s (powers of two: units modulo every odd q)'%( + x['m'],r['coefficient'],r['coefficient_bits'],r['strict_upper'],r['payload_prefix_bits'],r['delta_tau_lower'][:14],r['route']['factor_counts'],r['route']['all_ports']['ports'],r['route']['all_ports']['max_factors'],r['route']['all_ports']['denominators'])) diff --git a/research/e8-seven-stage-halving-two/code/bit/checkers/finite_k.py b/research/e8-seven-stage-halving-two/code/bit/checkers/finite_k.py new file mode 100644 index 0000000000..3a284fa4b2 --- /dev/null +++ b/research/e8-seven-stage-halving-two/code/bit/checkers/finite_k.py @@ -0,0 +1,152 @@ +"""Finite bill for the banked five-stage bit word, generalized from the source527/p10 finite_check.run (Dylan Crow, with +Anthropic Claude assistance). The arithmetic is the original line by line; the changes are explicit parameters: + * h, m = 5h, v, R, replicas T, literal stock, literal paid histogram, weighted/unit additions and the forward and + inverse cancellation-free row bounds are inputs (from this package's receipts); + * NCOPY, the copied-centre temporaries per invocation and 5*NCOPY copy/erase episodes per replica (the original + writes h for both, since the paired cube has h centres; the E8 word has 9 retained totals at h = 8); + * the 2h-dimensional rational route template: [[p*, k*], [k*, p*]] for the reference port line q* of the label + family under its form (original: a triple line under G = I - J/9, denominators 1,2,3,6; E8: a root line under + /2), recomputed and factored into elementary operations, exact inverse replay, omitted factor rejected; + * K, the conservative extra bank-selector calls, by the original formula 2*5*T*((live-1) + R*m*factors) with + factors = maxops + (m-1) + m (maxops of the actual charts; an ungauged word has only the identity chart, 0 ops). +Bridged word B_K (DaysSky, assisted with Claude): x['Kpairs'] (default 2) gives S = 2K + 1 invocations, m = S h, +S invocations' additions plus 6(K-1)v twin-bridge additions, route families 2S(2v + R) + 2Kv (each invocation routes +its 2v data and R helper roles in and out; the terminal exchange moves the 2Kv data roles), S*NCOPY*T copy/erase +episodes and the selector bill 2*S*T*(...) (receipts_k.py). K = 2 gives exactly finite_g.py's 5, 6v, 20v + 10R + 4v +and 5*NCOPY*T; the p = 10 regression path is five-stage and unchanged. +usage: python3 finite_k.py e8 RECEIPTS.json OUT.json | python3 finite_k.py regression P10_RECEIPT_DIR""" +from fractions import Fraction as Q +from collections import Counter +from hashlib import sha256 +import json, sys, os, importlib.util, gzip +HERE=os.path.dirname(os.path.abspath(__file__)) +def ceilq(x): return -((-x.numerator)//x.denominator) +def cutoff_log2(delta,C): + assert 0=1 + return max(1,ceilq(36/delta**2),ceilq(2*(4+(C-1).bit_length())/delta)) +def mm(A,B): return [[sum(A[i][k]*B[k][j] for k in range(len(B))) for j in range(len(B[0]))] for i in range(len(A))] +def route_template(h,q,form,g=None,ginv=None): + """[[g p* g^-1, g k*], [k* g^-1, p*]] with p* = q q^T G/; G given by form(x,y) on coordinate vectors + (bilinear); g = I (the original's reference port) unless a port isometry is given.""" + I=lambda n:[[Q(i==j)for j in range(n)]for i in range(n)] + Gq=[sum(form(i,j)*q[j] for j in range(h)) for i in range(h)]; nq=sum(q[i]*Gq[i] for i in range(h)) + P=[[Q(q[i])*Gq[j]/nq for j in range(h)]for i in range(h)] + K=[[Q(i==j)-P[i][j]for j in range(h)]for i in range(h)] + if g is None: TL,TR,BL=P,K,K + else: TL,TR,BL=mm(mm(g,P),ginv),mm(g,K),mm(K,ginv) + rho=[TL[i]+TR[i]for i in range(h)]+[BL[i]+P[i]for i in range(h)] + a=[r[:]for r in rho];factors=[] + for j in range(2*h): + p=next(i for i in range(j,2*h)if a[i][j]) + if p!=j:a[j],a[p]=a[p],a[j];factors.append(('swap',j,p,None)) + if a[j][j]!=1: + c=1/a[j][j];a[j]=[c*x for x in a[j]];factors.append(('scale',j,None,c)) + for i in range(2*h): + if i!=j and a[i][j]: + c=-a[i][j];a[i]=[x+c*y for x,y in zip(a[i],a[j])];factors.append(('add',i,j,c)) + assert a==I(2*h) + def replay(omit=None): + a=I(2*h) + for z in reversed(range(len(factors))): + if z==omit:continue + kind,i,j,c=factors[z] + if kind=='swap':a[i],a[j]=a[j],a[i] + elif kind=='scale':a[i]=[x/c for x in a[i]] + else:a[i]=[x-c*y for x,y in zip(a[i],a[j])] + return a + assert replay()==rho + omit=next((i for i,f in enumerate(factors)if f[0]=='add'),0) # original: the first addition; a route without additions: the first factor + assert factors and replay(omit)!=rho + counts=dict(Counter(f[0]for f in factors));denoms=sorted({c.denominator for kind,i,j,c in factors if c is not None}) + serialization=[[kind,i,j,None if c is None else str(c)]for kind,i,j,c in factors] + return dict(factors=len(factors),factor_counts=counts,denominators=denoms, + factor_program_sha256=sha256(json.dumps(serialization,separators=(',',':')).encode()).hexdigest(), + exact_inverse_reconstruction=True,missing_addition_rejected=True) +def bill(x): + """x: dict with h,m,v,R,T,stock,literal(hist),ncopy,weighted,unit,fwd_row,inv_row,K,coarse,moment_module,route.""" + h,m,v,R,T,stock,ncopy=x['h'],x['m'],x['v'],x['R'],x['T'],x['stock'],x['ncopy'] + literal=Counter(x['literal']);E=sum(literal.values());mass=sum(r*c for r,c in literal.items()) + KP=x.get('Kpairs',2);S=2*KP+1 + assert m==S*h and Q(max(literal),m)0 and delta1>0 + chain=[Q(384599,10**10)];gaps=[] + for j in range(3): + old=chain[-1];a=(1-c)*c+c*old;ds=dict(atom=c-a,borrowing=1-a-c,remainder=1-a-c*(1-old),stock=1-c);assert old0 + delta=min(ds.values());L=cutoff_log2(delta,coefficient);assert Q(L)*delta**2>=36 and Q(L)*delta>=2*(4+(coefficient-1).bit_length()) + gaps.append(dict(stage=j+1,minimum_gap=str(delta),cutoff_log2_at_charged_coefficient=str(L)));chain.append(a) + controls=[] + for name,test in [('zero cutoff gap',lambda:cutoff_log2(Q(0),coefficient)),('negative constant',lambda:cutoff_log2(Q(1,2),0))]: + try:test() + except AssertionError:controls.append(name) + else:raise AssertionError('bad finite cutoff accepted') + return dict(coefficient=coefficient,coefficient_bits=coefficient.bit_length(),low_matrix_power=d,strict_upper='q^'+str(d+1), + positive_rank_children=E,rank_mass=mass,weighted_additions=weighted,unit_expanded_additions=unit,route_families=J, + copy_erase_episodes=S*ncopy*T,payload_prefix_upper=payload,payload_prefix_bits=payload.bit_length(), + delta_tau_lower=str(delta_tau),delta_linear=str(delta1),bootstrap_chain=list(map(str,chain)),gaps=gaps, + row_reserve=dict(internal_coefficient=d+1,external_complex_coefficient=20161),route=x['route'],rejected_controls=controls) +def load_moment(): + s=importlib.util.spec_from_file_location('m',os.path.join(HERE,'..','..','pricing','moment.py'));m=importlib.util.module_from_spec(s);s.loader.exec_module(m);return m +def hist(x): return Counter({int(k):v for k,v in x.items() if v}) +if __name__=='__main__': + mod=load_moment() + if sys.argv[1]=='regression': + d=sys.argv[2]; raw=json.load(open(d+'/raw.json')); sc=json.load(open(d+'/scalar.json')); bk=json.load(open(d+'/banks.json'))['banks'] + ma=json.load(open(d+'/math.json'))['mathematics']; fin=json.load(open(d+'/finite.json')); gl=json.load(open(d+'/global_result.json')) + h=raw['h'];m=5*h;H=hist(raw['five_stage_profile']['histogram']) + for a,cnt in hist(raw.get('completion_rank_histogram',raw['auxiliary_entrance_rank_histogram'])).items(): + H[5*a]-=cnt + if not H[5*a]: del H[5*a] + T=bk['physical_replicas']; literal=Counter({r:T*c for r,c in H.items()}) + q=[int(i<3) for i in range(h)]; form=lambda i,j: Q(int(i==j))-Q(1,9) + x=dict(h=h,m=m,v=raw['v'],R=raw['physical_R'],T=T,stock=bk['literal_stock'],literal=literal,ncopy=h,deficit=4*raw['v']-5*h*(h-2), + weighted=sc['forward']['weighted_additions'],unit=sc['forward']['literal_unit_additions'],fwd_row=sc['forward']['max_intermediate_row_l1'], + inv_row=sc['inverse']['max_intermediate_row_l1'],K=bk['conservative_extra_selector_calls'],coarse=ma['bit_coarse'],moment_module=mod, + route=route_template(h,q,form)) + r=bill(x) + assert r['coefficient']==fin['q_power_bound']['coefficient'],(r['coefficient'],fin['q_power_bound']) + assert r['bootstrap_chain']==fin['bootstrap']['chain'] and r['delta_tau_lower']==fin['moment']['delta_tau_lower'] and r['delta_linear']==fin['moment']['delta_linear'] + assert r['route']['factor_counts']==fin['rational_route']['factor_counts'] and r['route']['factor_program_sha256']==fin['rational_route']['factor_program_sha256'] + assert r['route']['denominators']==[1,2,3,6] + print('PASS regression: on the p = 10 receipts in',d,'the generalized bill reproduces the coefficient',r['coefficient'], + ', the moment gaps, the bootstrap chain and the 40-dimensional route program (sha',r['route']['factor_program_sha256'][:12]+'...)') + else: + x=json.load(open(sys.argv[2])) + q=x['qstar']; form=lambda i,j: Q(int(i==j),2) # E8 form /2 in Construction-A coordinates + x['route']=route_template(x['h'],q,form); x['moment_module']=mod; x['literal']=hist(x['literal']) + # every port: route conjugated by its W(E8) reflection word (the original's coordinate permutations are free + # relabelings; here the isometry is a rational program and is charged as part of the port route) + w=json.load(gzip.open(x['word'],'rt')); Lw=w['lines']; h=x['h'] + ip=lambda a,b: Q(sum(u*t for u,t in zip(a,b)),2) + def refl(r): + return [[Q(int(i==j))-Q(r[i]*r[j],2)*2/ip(r,r) for j in range(h)] for i in range(h)] + isom={0:[[Q(int(i==j)) for j in range(h)] for i in range(h)]}; fr=[0] + while fr: + nx=[] + for a_ in fr: + for b_ in range(len(Lw)): + if b_ in isom or abs(ip(Lw[a_],Lw[b_]))!=1: continue + d_=[u-t for u,t in zip(Lw[a_],Lw[b_])] if ip(Lw[a_],Lw[b_])==1 else [u+t for u,t in zip(Lw[a_],Lw[b_])] + isom[b_]=mm(refl(d_),isom[a_]); nx.append(b_) + fr=nx + assert len(isom)==len(Lw) and Lw[0]==q + ports=[]; allden=set(); maxf=0 + for t,g in isom.items(): + ginv=[[g[j][i]*1 for j in range(h)] for i in range(h)] # G = I/2 is scalar, so g^-1 = g^T + assert mm(g,ginv)==[[Q(int(i==j)) for j in range(h)] for i in range(h)] + gq=[sum(g[i][j]*q[j] for j in range(h)) for i in range(h)]; assert gq==Lw[t] or gq==[-u for u in Lw[t]] + r_=route_template(h,q,form,g,ginv); allden|=set(r_['denominators']); maxf=max(maxf,r_['factors']) + assert all(d_&(d_-1)==0 for d_ in allden), allden # powers of two: units modulo every odd prime q + x['route']['all_ports']=dict(ports=len(isom),max_factors=maxf,denominators=sorted(allden)) + r=bill(x); r.pop('route') if False else None + json.dump({k:(v if not isinstance(v,Counter) else dict(v)) for k,v in r.items()},open(sys.argv[3],'w'),indent=1,default=str) + print('PASS finite bill (E8, K = %d, m = %d): coefficient %d (%d bits) < 2^80, q-power bound %s, payload prefix %d bits < 104, delta_tau %s, reference route %s; all %d port routes exact elementary programs, at most %d factors, denominators %s (powers of two: units modulo every odd q)'%( + x.get('Kpairs',2),x['m'],r['coefficient'],r['coefficient_bits'],r['strict_upper'],r['payload_prefix_bits'],r['delta_tau_lower'][:14],r['route']['factor_counts'],r['route']['all_ports']['ports'],r['route']['all_ports']['max_factors'],r['route']['all_ports']['denominators'])) diff --git a/research/e8-seven-stage-halving-two/code/bit/checkers/geometry_g.py b/research/e8-seven-stage-halving-two/code/bit/checkers/geometry_g.py new file mode 100644 index 0000000000..74eb582247 --- /dev/null +++ b/research/e8-seven-stage-halving-two/code/bit/checkers/geometry_g.py @@ -0,0 +1,137 @@ +"""PR234's five-stage route and idle geometry with the label family as a parameter (Dylan Crow, with Anthropic Claude assistance; +generalizes the exact matrix checks of code/geometry527.py + global_lowering.Lowerer of the source527/p10 packages). + +The original fixes H = Q^h with G = I - J/9, a reference triple line q*, and port isometries given by coordinate +permutations pi (pi^-1 = pi^T). Here G, q* and the port isometries g_t (exact rational matrices with +g^T G g = G and g q* = +-q_t) are inputs; every formula is the original one with pi -> g and pi^T -> g^-1: + frame projector P_B = B^T (B G B^T)^-1 B G p* = q* q*^T G / , k* = I - p* + route rho(i,t) [[g p* g^-1, g k*], [k* g^-1, p*]] on blocks (0, i) of H^5, identity elsewhere; rho(0,t) = I + tau(i) exchange of blocks 0 and i; stage projector P (+) K (+) ... (+) K (K = k* on blocks 1..i) + data(i,kind) rho(i,t) * stage_projector(i, frame(kind)) * rho(i,t), kinds P (port line), K (its complement), H, 0 +Checks for every port t: rho^2 = I; P_t idempotent of trace 1; data(i-1,H) = data(i,P) and data(i-1,K) = data(i,0) +(i = 1..4); the eight idle boundary pairs (a, b) commute with a*b = a and gap b - a idempotent of trace +(2h-2, 2h-2, h-1, h-1, 2h+2, 2h+2, 4, 4); p (I - p) = 0. For the entrance census of the word (here: every helper +starts at frame 0, the single entrance class sigma = 0), the five-window completion: the tau-conjugates of +(I_h - P_sigma) (+) 0 are pairwise orthogonal and sum to I - completion(sigma); a duplicated window is rejected. +usage: python3 geometry_g.py e8 WORD.json[.gz] (E8 labels, all ports) + python3 geometry_g.py regression (paired-cube h = 20: equals the original literal formulas)""" +import sys, json, gzip, itertools, time +import sympy as sp +def eye(n): return sp.eye(n) +class Geo: + def __init__(self,h,G,qstar): + self.h=h; self.M=5*h; self.G=G; self.q=qstar + nq=(qstar.T*G*qstar)[0]; assert nq!=0 + self.pstar=qstar*(qstar.T*G)/nq; self.kstar=eye(h)-self.pstar + def frame_projector(self,B): + if B.rows==0: return sp.zeros(self.h) + return B.T*(B*self.G*B.T).inv()*B*self.G + def rho(self,stage,g,ginv): + h,M=self.h,self.M; I=eye(M) + if stage==0: return I + I[:h,:h]=g*self.pstar*ginv; I[stage*h:(stage+1)*h,stage*h:(stage+1)*h]=self.pstar + I[:h,stage*h:(stage+1)*h]=g*self.kstar; I[stage*h:(stage+1)*h,:h]=self.kstar*ginv + return I + def tau(self,stage): + I=eye(self.M) + if stage: + for j in range(self.h): I.row_swap(j,stage*self.h+j) + return I + def stage_projector(self,stage,P): + A=sp.zeros(self.M); A[:self.h,:self.h]=P + for j in range(1,stage+1): A[j*self.h:(j+1)*self.h,j*self.h:(j+1)*self.h]=self.kstar + return A + def check_port(self,qt,g,ginv): + h,M=self.h,self.M; I=eye(M); Z=sp.zeros(M) + assert g*ginv==eye(h) and g.T*self.G*g==self.G, 'port map is not a G-isometry' + assert g*self.q==qt or g*self.q==-qt, 'port map does not send q* to the port line' + routes=[self.rho(i,g,ginv) for i in range(5)] + assert all(r*r==I for r in routes) + P=self.frame_projector(qt.T); assert P*P==P and P.trace()==1 + Ph={'P':P,'K':eye(h)-P,'H':eye(h),'0':sp.zeros(h)} + cache={} + def data(i,kind): + if (i,kind) not in cache: cache[i,kind]=routes[i]*self.stage_projector(i,Ph[kind])*routes[i] + return cache[i,kind] + for i in range(1,5): + assert data(i-1,'H')==data(i,'P'); assert data(i-1,'K')==data(i,'0') + p=data(0,'P') + pairs=[(p,data(1,'H')),(Z,data(1,'K')),(data(2,'P'),data(3,'P')),(data(2,'0'),data(3,'0')), + (data(2,'H'),I),(data(2,'K'),I-p),(data(4,'H'),I),(data(4,'K'),I-p)] + ranks=[] + for a,b in pairs: + assert a*b==b*a==a; gap=b-a; assert gap*gap==gap; ranks.append(int(gap.trace())) + assert p*(I-p)==Z and p+(I-p)==I + return ranks,routes,data + def check_entrance(self,Psigma): + h,M=self.h,self.M; Z=sp.zeros(M) + completion=sp.diag(*([Psigma]*5)); residual=eye(M)-completion + assert completion*completion==completion and completion.trace()==5*Psigma.trace() + actual=[] + for i in range(5): + t=self.tau(i); local=sp.zeros(M); local[:h,:h]=eye(h)-Psigma; actual.append(t*local*t) + assert sum(actual,Z)==residual + assert all(a*b==Z for i,a in enumerate(actual) for j,b in enumerate(actual) if i!=j) + assert sum(actual[:4]+[actual[3]],Z)!=residual + return True +def e8(word): + c=json.load(gzip.open(word,'rt') if word.endswith('.gz') else open(word)) + assert c['form']=='/2' and c['h']==8 + h=8; G=eye(h)/2; L=[sp.Matrix(x) for x in c['lines']]; v=len(L) + ip=lambda a,b:(a.T*G*b)[0] + def refl(r): return eye(h)-r*(r.T*G)*2/ip(r,r) # s_r(x) = x - 2/ r, a G-isometry and an involution + star=0; geo=Geo(h,G,L[star]) + # port isometries: products of root reflections (BFS over lines), g q* = +-q_t + isom={star:(eye(h),[])}; frontier=[star] + while frontier: + nxt=[] + for a in frontier: + for r in range(v): + if r in (a,) : continue + if abs(ip(L[a],L[r]))==1: + d=L[a]-L[r] if ip(L[a],L[r])==1 else L[a]+L[r] # a root with s_d(q_a) = +-q_r + S=refl(d); b=r + if b not in isom: + g=S*isom[a][0]; isom[b]=(g,isom[a][1]+[d]); nxt.append(b) + frontier=nxt + assert len(isom)==v + idle=None; t0=time.time() + for t in range(v): + g,word_=isom[t]; ginv=g.inv() + ranks,_,_=geo.check_port(L[t],g,ginv) + if idle is None: idle=ranks + assert ranks==idle==[2*h-2,2*h-2,h-1,h-1,2*h+2,2*h+2,4,4],ranks + if t%20==0: print(' port %d/%d checked (%d reflections) %.0fs'%(t+1,v,len(word_),time.time()-t0),flush=True) + # entrance census of the word: every helper starts at the zero frame + nreg=2*v+c['R']; starts={c['start'][r] for r in range(2*v,nreg)}; assert starts=={c['start'][v]} and len(c['frames'][c['start'][v]])==0 + geo.check_entrance(sp.zeros(h)) + print('PASS E8 five-stage geometry: all %d ports (W(E8) reflection words as port isometries), routes involutive, stage boundaries chained,' + ' idle gap ranks %s, D_I D_P identity; entrance census {0: %d helpers}: five-window completion exact, duplicate window rejected'%(v,idle,c['R'])) +def regression(): + """paired-cube h = 20: the generalized formulas with g = pi equal the original literal ones (global_lowering.Lowerer).""" + h=20; G=eye(h)-sp.ones(h)/9; qstar=sp.Matrix([int(i<3) for i in range(h)]); geo=Geo(h,G,qstar) + def original_rho(stage,q): + I=sp.eye(5*h) + if stage==0: return I + rest=[j for j in range(h) if j not in q]; permutation=list(q)+rest + pi=sp.zeros(h) + for j,dst in enumerate(permutation): pi[dst,j]=1 + pstar=qstar*(qstar.T*G)/2; p=pi*pstar*pi.T; kstar=sp.eye(h)-pstar + I[:h,:h]=p; I[stage*h:(stage+1)*h,stage*h:(stage+1)*h]=pstar + I[:h,stage*h:(stage+1)*h]=pi*kstar; I[stage*h:(stage+1)*h,:h]=kstar*pi.T + return I,pi + for q in [(0,2,4),(1,7,13),(5,11,19)]: + ranks_ok=None + for i in range(5): + Io,pi=original_rho(i,q) if i else (sp.eye(5*h),None) + if i==0: continue + assert geo.rho(i,pi,pi.T)==Io + _,pi=original_rho(1,q) + qt=sp.Matrix([int(j in q) for j in range(h)]) + ranks,_,_=geo.check_port(qt,pi,pi.T) + assert ranks==[2*h-2,2*h-2,h-1,h-1,2*h+2,2*h+2,4,4] + print('PASS regression: on paired-cube labels (h = 20, G = I - J/9) the generalized routes equal the original literal' + ' rho for 3 ports and every stage, and give idle ranks (38, 38, 19, 19, 42, 42, 4, 4)') +if __name__=='__main__': + if sys.argv[1]=='e8': e8(sys.argv[2]) + else: regression() diff --git a/research/e8-seven-stage-halving-two/code/bit/checkers/geometry_k.py b/research/e8-seven-stage-halving-two/code/bit/checkers/geometry_k.py new file mode 100644 index 0000000000..f8afa8c245 --- /dev/null +++ b/research/e8-seven-stage-halving-two/code/bit/checkers/geometry_k.py @@ -0,0 +1,157 @@ +"""PR234's route and idle geometry for the bridged word B_K (DaysSky, assisted with Claude), generalizing PR #370's +geometry_g.py (five stages) to 2K + 1 stages. Every formula is geometry_g.py's; only the number of blocks and the idle +chronology change. + + H^S with S = 2K + 1 blocks, ambient form G (+) ... (+) G; p* = q* q*^T G / , k* = I - p* + route rho(i,t) [[g p* g^-1, g k*], [k* g^-1, p*]] on blocks (0, i), identity elsewhere; rho(0,t) = I (i < S) + stage projector P (+) K (+) ... (+) K (K = k* on blocks 1..i) + data(i,kind) rho(i,t) * stage_projector(i, frame(kind)) * rho(i,t), kinds P (port line), K, H, 0 +Checks for every port t: rho^2 = I; data(i-1,H) = data(i,P) and data(i-1,K) = data(i,0) for i = 1..S-1; the idle +boundary pairs of B_K (PR #363's bridged.py chronology), each commuting with a*b = a and an idempotent gap whose rank +equals bridged.check(K, h)'s idle climb: + pair q = 2..K, X: (p, data(2q-3,H)) and (data(2q-2,P), data(2q-1,P)); Y: (0, data(2q-3,K)) and (data(2q-2,0), data(2q-1,0)) + pair 1, final: (data(2,H), I) and (data(2,K), I - p); pair q, final: (data(2q,H), I) and (data(2q,K), I - p) +For K = 2 this is geometry_g.py's list of eight pairs, in the same order. Every gap of rank above floor((m - 1)/2) +gets an explicit intermediate frame Q = b - D, D a sum of mutually orthogonal E8 root projectors r r^T G/ in a +diagonal block where the gap is block-diagonal (dyadic entries only, so the prime-witness set stays {2}): +a Q = Q a = a, Q b = b Q = Q, Q^2 = Q, ranks (split, rest), so the paid children obey the half-shrink guard +2 max child < m. Entrance census (every helper starts at frame 0): the S tau-conjugates of +(I_h - P_sigma) (+) 0 are pairwise orthogonal and sum to I - completion(sigma); a duplicated window is rejected. +usage: python3 geometry_k.py K WORD.json[.gz]""" +import sys, os, json, gzip, time +import sympy as sp +sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', 'complex', 'code')) +import bridged +def eye(n): return sp.eye(n) +class Geo: + def __init__(self, h, G, qstar, S): + self.h = h; self.S = S; self.M = S * h; self.G = G; self.q = qstar + nq = (qstar.T * G * qstar)[0]; assert nq != 0 + self.pstar = qstar * (qstar.T * G) / nq; self.kstar = eye(h) - self.pstar + self.GG = sp.diag(*([G] * S)) + def frame_projector(self, B): + if B.rows == 0: return sp.zeros(self.h) + return B.T * (B * self.G * B.T).inv() * B * self.G + def rho(self, stage, g, ginv): + h, M = self.h, self.M; I = eye(M) + if stage == 0: return I + I[:h, :h] = g * self.pstar * ginv; I[stage*h:(stage+1)*h, stage*h:(stage+1)*h] = self.pstar + I[:h, stage*h:(stage+1)*h] = g * self.kstar; I[stage*h:(stage+1)*h, :h] = self.kstar * ginv + return I + def tau(self, stage): + I = eye(self.M) + if stage: + for j in range(self.h): I.row_swap(j, stage * self.h + j) + return I + def stage_projector(self, stage, P): + A = sp.zeros(self.M); A[:self.h, :self.h] = P + for j in range(1, stage + 1): A[j*self.h:(j+1)*self.h, j*self.h:(j+1)*self.h] = self.kstar + return A + def intermediate(self, a, b, split, lines): + """Q = b - D with D a sum of mutually G-orthogonal root projectors r r^T G/ (dyadic) inside diagonal blocks + on which the gap b - a is block-diagonal; rank(Q - a) = split.""" + h, M = self.h, self.M; gap = b - a; need = int(gap.trace()) - split; D = sp.zeros(M); got = 0 + proj = [r * (r.T * self.G) / (r.T * self.G * r)[0] for r in lines] + for j in range(self.S - 1, 0, -1): + blk = slice(j * h, (j + 1) * h) + off = gap.copy(); off[blk, blk] = sp.zeros(h) + if not (off[blk, :].is_zero_matrix and off[:, blk].is_zero_matrix): continue + Gj = gap[blk, blk]; chosen = [] + for e in proj: + if got == need: break + if Gj * e == e and all(e * f == sp.zeros(h) for f in chosen): + chosen.append(e); D[blk, blk] = D[blk, blk] + e; got += 1 + if got == need: break + assert got == need, ('no dyadic intermediate frame', need, got) + Q = b - D + assert D * D == D and D * a == a * D == sp.zeros(M) and b * D == D * b == D and Q * Q == Q + assert a * Q == Q * a == a and Q * b == b * Q == Q + assert int((Q - a).trace()) == split and int((b - Q).trace()) == need + assert all(sp.Rational(x).q & (sp.Rational(x).q - 1) == 0 for x in Q), 'intermediate frame not dyadic' + return Q + def check_port(self, K, qt, g, ginv, split, lines): + h, M, S = self.h, self.M, self.S; I = eye(M); Z = sp.zeros(M) + assert g * ginv == eye(h) and g.T * self.G * g == self.G, 'port map is not a G-isometry' + assert g * self.q == qt or g * self.q == -qt, 'port map does not send q* to the port line' + routes = [self.rho(i, g, ginv) for i in range(S)] + assert all(r * r == I for r in routes) + P = self.frame_projector(qt.T); assert P * P == P and P.trace() == 1 + Ph = {'P': P, 'K': eye(h) - P, 'H': eye(h), '0': sp.zeros(h)} + cache = {} + def data(i, kind): + if (i, kind) not in cache: cache[i, kind] = routes[i] * self.stage_projector(i, Ph[kind]) * routes[i] + return cache[i, kind] + for i in range(1, S): + assert data(i-1, 'H') == data(i, 'P'); assert data(i-1, 'K') == data(i, '0') + p = data(0, 'P'); pairs = [] + for q in range(2, K + 1): + pairs += [(p, data(2*q-3, 'H')), (Z, data(2*q-3, 'K')), (data(2*q-2, 'P'), data(2*q-1, 'P')), (data(2*q-2, '0'), data(2*q-1, '0'))] + pairs += [(data(2, 'H'), I), (data(2, 'K'), I - p)] + for q in range(2, K + 1): + pairs += [(data(2*q, 'H'), I), (data(2*q, 'K'), I - p)] + ranks = []; children = [] + for a, b in pairs: + assert a * b == b * a == a; gap = b - a; assert gap * gap == gap; r = int(gap.trace()); ranks.append(r) + if r > split: + Q = self.intermediate(a, b, split, lines); children += [split, r - split] + else: + children.append(r) + assert p * (I - p) == Z and p + (I - p) == I + return ranks, children + def check_entrance(self, Psigma): + h, M, S = self.h, self.M, self.S; Z = sp.zeros(M) + completion = sp.diag(*([Psigma] * S)); residual = eye(M) - completion + assert completion * completion == completion and completion.trace() == S * Psigma.trace() + actual = [] + for i in range(S): + t = self.tau(i); local = sp.zeros(M); local[:h, :h] = eye(h) - Psigma; actual.append(t * local * t) + assert sum(actual, Z) == residual + assert all(a * b == Z for i, a in enumerate(actual) for j, b in enumerate(actual) if i != j) + assert sum(actual[:S-1] + [actual[S-2]], Z) != residual + return True +def expected(K, h): + """idle climbs of bridged.check in the order of check_port's pair list (X and Y of each climb)""" + idle = bridged.check(K, h)['per_pair_idle']; out = [] + for q in range(2, K + 1): + a, b, _ = idle[q]; out += [a, a, b, b] + out += [idle[1][0]] * 2 + for q in range(2, K + 1): out += [idle[q][2]] * 2 + return out +def main(K, word): + c = json.load(gzip.open(word, 'rt') if word.endswith('.gz') else open(word)) + assert c['form'] == '/2' and c['h'] == 8 + h = 8; S = 2 * K + 1; m = S * h; split = (m - 1) // 2 + G = eye(h) / 2; L = [sp.Matrix(x) for x in c['lines']]; v = len(L) + ip = lambda a, b: (a.T * G * b)[0] + def refl(r): return eye(h) - r * (r.T * G) * 2 / ip(r, r) + star = 0; geo = Geo(h, G, L[star], S) + isom = {star: (eye(h), [])}; frontier = [star] + while frontier: + nxt = [] + for a in frontier: + for r in range(v): + if r == a: continue + if abs(ip(L[a], L[r])) == 1: + d = L[a] - L[r] if ip(L[a], L[r]) == 1 else L[a] + L[r] + if r not in isom: + isom[r] = (refl(d) * isom[a][0], isom[a][1] + [d]); nxt.append(r) + frontier = nxt + assert len(isom) == v + want = expected(K, h); idle = None; kids = None; t0 = time.time() + for t in range(v): + g, w_ = isom[t] + ranks, children = geo.check_port(K, L[t], g, g.inv(), split, L) + if idle is None: idle, kids = ranks, children + assert ranks == idle == want, (ranks, want) + assert children == kids and 2 * max(children) < m + if t % 30 == 0: print(' port %d/%d checked (%d reflections) %.0fs' % (t + 1, v, len(w_), time.time() - t0), flush=True) + nreg = 2 * v + c['R']; starts = {c['start'][r] for r in range(2 * v, nreg)} + assert starts == {c['start'][v]} and len(c['frames'][c['start'][v]]) == 0 + geo.check_entrance(sp.zeros(h)) + lay = bridged.check(K, h, split=split if K > 2 else None)['blocks_per_role_pair'] + assert sorted(kids) == sorted(lay * 2), (kids, lay) # X and Y of every role pair: PR #363's priced idle blocks + print('PASS E8 geometry in B_%d (%d stages, m = %d): all %d ports (W(E8) reflection words), routes involutive, %d stage boundaries chained,' + ' idle gap ranks %s (= bridged.py), paid idle children %s (explicit dyadic intermediate frames, 2 x %d < %d); entrance census {0: %d helpers}:' + ' %d-window completion exact, duplicate window rejected' % (K, S, m, v, S - 1, idle, kids, max(kids), m, c['R'], S)) +if __name__ == '__main__': + main(int(sys.argv[1]), sys.argv[2]) diff --git a/research/e8-seven-stage-halving-two/code/bit/checkers/gram_frames.py b/research/e8-seven-stage-halving-two/code/bit/checkers/gram_frames.py new file mode 100644 index 0000000000..b740d47295 --- /dev/null +++ b/research/e8-seven-stage-halving-two/code/bit/checkers/gram_frames.py @@ -0,0 +1,54 @@ +"""Exact nondegeneracy and PR #315's prime-witness rule for every frame of a PR249-format word, with the ambient Gram +matrix as a parameter. Generalizes PR #346's exactnd_h.py and prime_new.py (Dylan Crow, with Anthropic Claude assistance). + --gram triple9 : the paired-cube form G = I - J/9, integer Gram 9 B G B^t = 9 B B^t - s s^t (exactnd_h/prime_new, verbatim) + --gram e8ham : the E8 form /2 in Construction-A (Hamming) coordinates, integer Gram 2 B G B^t = B B^t +Checks per frame: rank(B) = dim, A.B = 0 and |A| + dim = h (when A given), det(integer Gram) != 0 (exact Bareiss), and +the prime witness: |det| = residual * prod p^e over PR #315's allowed primes with 0 < residual < 2^80. With --new BASE +only frames absent from BASE are checked (prime_new.py's scope); otherwise every frame. +usage: python3 gram_frames.py WORDDIR --gram {triple9,e8ham} --h H [--new BASEDIR] [--positive]""" +import json, sys, argparse, importlib.util, os, collections +ap=argparse.ArgumentParser(); ap.add_argument('word'); ap.add_argument('--gram',required=True); ap.add_argument('--h',type=int,required=True) +ap.add_argument('--new'); ap.add_argument('--positive',action='store_true'); a=ap.parse_args() +HERE=os.path.dirname(os.path.abspath(__file__)) +s=importlib.util.spec_from_file_location('pw',os.path.join(HERE,'..','..','pricing','prime_witnesses.py')); pw=importlib.util.module_from_spec(s); s.loader.exec_module(pw) +def validate_record(row, dimension, determinant, allowed_primes): # PR #315 prime_check.validate_record, verbatim logic + assert type(row['dimension']) is int and type(row['determinant']) is int and type(row['residual']) is int, 'exact integer witness fields' + assert row['dimension'] == dimension and row['determinant'] == determinant != 0, 'exact determinant mismatch or singular basis' + assert 0 < row['residual'] < 2**80, 'retained prime lower bound' + product = row['residual'] + for prime, exponent in row['factors'].items(): + q = int(prime); assert q in allowed_primes and type(exponent) is int and exponent > 0, 'factor shape'; product *= q**exponent + assert product == abs(determinant), 'factor identity' +def gram(B): + if a.gram=='triple9': + s_=list(map(sum,B)); return [[9*sum(x*y for x,y in zip(B[i],B[j]))-s_[i]*s_[j] for j in range(len(B))] for i in range(len(B))] + if a.gram=='e8ham': + return [[sum(x*y for x,y in zip(B[i],B[j])) for j in range(len(B))] for i in range(len(B))] + raise SystemExit('unknown gram') +def rank_int(B): + M=[r[:] for r in B]; r=0 + for c in range(len(M[0]) if M else 0): + p=next((i for i in range(r,len(M)) if M[i][c]!=0),None) + if p is None: continue + M[r],M[p]=M[p],M[r] + for i in range(len(M)): + if i!=r and M[i][c]!=0: x,y=M[r][c],M[i][c]; M[i]=[u*x-w*y for u,w in zip(M[i],M[r])] + r+=1 + return r +fr=json.load(open(a.word+'/frames.json'))['frames'] +old=json.load(open(a.new+'/frames.json'))['frames'] if a.new else {} +keys=[k for k in fr if k not in old] +stats=collections.Counter(); primes=set(); bits=0; nonpos=0 +for k in keys: + B=fr[k]['B']; A=fr[k].get('A',[]); d=len(B); assert fr[k]['dim']==d + assert d==0 or rank_int(B)==d,('basis rank',k) + if A: assert all(sum(x*y for x,y in zip(r,b))==0 for r in A for b in B) and len(A)+d==a.h,('annihilator',k) + M=gram(B) if d else []; det=pw.det(M); assert det!=0,('degenerate frame',k) + if a.positive: # positive-definite ambient form: every leading principal minor positive + for j in range(1,d+1): + if pw.det([r[:j] for r in M[:j]])<=0: nonpos+=1; break + powers,residual=pw.factor_witness(det); row=dict(dimension=d,determinant=det,residual=residual,factors={p:e for p,e in powers.items() if e}) + validate_record(row,d,det,pw.PRIMES); primes.update(map(int,row['factors'])); bits=max(bits,abs(det).bit_length()); stats[d]+=1 +assert nonpos==0 +print('PASS %s Gram: %d frames checked, all nondegenerate%s; prime witnesses valid; max determinant bits %d; primes %s; by dim %s'%( + a.gram,sum(stats.values()),' and positive definite' if a.positive else '',bits,sorted(primes),dict(sorted(stats.items())))) diff --git a/research/e8-seven-stage-halving-two/code/bit/checkers/json.hpp b/research/e8-seven-stage-halving-two/code/bit/checkers/json.hpp new file mode 100644 index 0000000000..82d69f7c5d --- /dev/null +++ b/research/e8-seven-stage-halving-two/code/bit/checkers/json.hpp @@ -0,0 +1,25526 @@ +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + +/****************************************************************************\ + * Note on documentation: The source files contain links to the online * + * documentation of the public API at https://json.nlohmann.me. This URL * + * contains the most recent documentation and should also be applicable to * + * previous versions; documentation for deprecated functions is not * + * removed, but marked deprecated. See "Generate documentation" section in * + * file docs/README.md. * +\****************************************************************************/ + +#ifndef INCLUDE_NLOHMANN_JSON_HPP_ +#define INCLUDE_NLOHMANN_JSON_HPP_ + +#include // all_of, find, for_each +#include // nullptr_t, ptrdiff_t, size_t +#include // hash, less +#include // initializer_list +#ifndef JSON_NO_IO + #include // istream, ostream +#endif // JSON_NO_IO +#include // random_access_iterator_tag +#include // unique_ptr +#include // string, stoi, to_string +#include // declval, forward, move, pair, swap +#include // vector + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// This file contains all macro definitions affecting or depending on the ABI + +#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK + #if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH) + #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 12 || NLOHMANN_JSON_VERSION_PATCH != 0 + #warning "Already included a different version of the library!" + #endif + #endif +#endif + +#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum) +#define NLOHMANN_JSON_VERSION_MINOR 12 // NOLINT(modernize-macro-to-enum) +#define NLOHMANN_JSON_VERSION_PATCH 0 // NOLINT(modernize-macro-to-enum) + +#ifndef JSON_DIAGNOSTICS + #define JSON_DIAGNOSTICS 0 +#endif + +#ifndef JSON_DIAGNOSTIC_POSITIONS + #define JSON_DIAGNOSTIC_POSITIONS 0 +#endif + +#ifndef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON + #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 0 +#endif + +#if JSON_DIAGNOSTICS + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS _diag +#else + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS +#endif + +#if JSON_DIAGNOSTIC_POSITIONS + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS _dp +#else + #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS +#endif + +#if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON + #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON _ldvcmp +#else + #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON +#endif + +#ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION + #define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0 +#endif + +// Construct the namespace ABI tags component +#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c) json_abi ## a ## b ## c +#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b, c) \ + NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b, c) + +#define NLOHMANN_JSON_ABI_TAGS \ + NLOHMANN_JSON_ABI_TAGS_CONCAT( \ + NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \ + NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON, \ + NLOHMANN_JSON_ABI_TAG_DIAGNOSTIC_POSITIONS) + +// Construct the namespace version component +#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \ + _v ## major ## _ ## minor ## _ ## patch +#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \ + NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) + +#if NLOHMANN_JSON_NAMESPACE_NO_VERSION +#define NLOHMANN_JSON_NAMESPACE_VERSION +#else +#define NLOHMANN_JSON_NAMESPACE_VERSION \ + NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \ + NLOHMANN_JSON_VERSION_MINOR, \ + NLOHMANN_JSON_VERSION_PATCH) +#endif + +// Combine namespace components +#define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b +#define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \ + NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) + +#ifndef NLOHMANN_JSON_NAMESPACE +#define NLOHMANN_JSON_NAMESPACE \ + nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \ + NLOHMANN_JSON_ABI_TAGS, \ + NLOHMANN_JSON_NAMESPACE_VERSION) +#endif + +#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN +#define NLOHMANN_JSON_NAMESPACE_BEGIN \ + namespace nlohmann \ + { \ + inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \ + NLOHMANN_JSON_ABI_TAGS, \ + NLOHMANN_JSON_NAMESPACE_VERSION) \ + { +#endif + +#ifndef NLOHMANN_JSON_NAMESPACE_END +#define NLOHMANN_JSON_NAMESPACE_END \ + } /* namespace (inline namespace) NOLINT(readability/namespace) */ \ + } // namespace nlohmann +#endif + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // transform +#include // array +#include // forward_list +#include // inserter, front_inserter, end +#include // map +#ifdef JSON_HAS_CPP_17 + #include // optional +#endif +#include // string +#include // tuple, make_tuple +#include // is_arithmetic, is_same, is_enum, underlying_type, is_convertible +#include // unordered_map +#include // pair, declval +#include // valarray + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // nullptr_t +#include // exception +#if JSON_DIAGNOSTICS + #include // accumulate +#endif +#include // runtime_error +#include // to_string +#include // vector + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // array +#include // size_t +#include // uint8_t +#include // string + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // declval, pair +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template struct make_void +{ + using type = void; +}; +template using void_t = typename make_void::type; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +// https://en.cppreference.com/w/cpp/experimental/is_detected +struct nonesuch +{ + nonesuch() = delete; + ~nonesuch() = delete; + nonesuch(nonesuch const&) = delete; + nonesuch(nonesuch const&&) = delete; + void operator=(nonesuch const&) = delete; + void operator=(nonesuch&&) = delete; +}; + +template class Op, + class... Args> +struct detector +{ + using value_t = std::false_type; + using type = Default; +}; + +template class Op, class... Args> +struct detector>, Op, Args...> +{ + using value_t = std::true_type; + using type = Op; +}; + +template class Op, class... Args> +using is_detected = typename detector::value_t; + +template class Op, class... Args> +struct is_detected_lazy : is_detected { }; + +template class Op, class... Args> +using detected_t = typename detector::type; + +template class Op, class... Args> +using detected_or = detector; + +template class Op, class... Args> +using detected_or_t = typename detected_or::type; + +template class Op, class... Args> +using is_detected_exact = std::is_same>; + +template class Op, class... Args> +using is_detected_convertible = + std::is_convertible, To>; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + + +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-FileCopyrightText: 2016 - 2021 Evan Nemerson +// SPDX-License-Identifier: MIT + +/* Hedley - https://nemequ.github.io/hedley + * Created by Evan Nemerson + */ + +#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 15) +#if defined(JSON_HEDLEY_VERSION) + #undef JSON_HEDLEY_VERSION +#endif +#define JSON_HEDLEY_VERSION 15 + +#if defined(JSON_HEDLEY_STRINGIFY_EX) + #undef JSON_HEDLEY_STRINGIFY_EX +#endif +#define JSON_HEDLEY_STRINGIFY_EX(x) #x + +#if defined(JSON_HEDLEY_STRINGIFY) + #undef JSON_HEDLEY_STRINGIFY +#endif +#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x) + +#if defined(JSON_HEDLEY_CONCAT_EX) + #undef JSON_HEDLEY_CONCAT_EX +#endif +#define JSON_HEDLEY_CONCAT_EX(a,b) a##b + +#if defined(JSON_HEDLEY_CONCAT) + #undef JSON_HEDLEY_CONCAT +#endif +#define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b) + +#if defined(JSON_HEDLEY_CONCAT3_EX) + #undef JSON_HEDLEY_CONCAT3_EX +#endif +#define JSON_HEDLEY_CONCAT3_EX(a,b,c) a##b##c + +#if defined(JSON_HEDLEY_CONCAT3) + #undef JSON_HEDLEY_CONCAT3 +#endif +#define JSON_HEDLEY_CONCAT3(a,b,c) JSON_HEDLEY_CONCAT3_EX(a,b,c) + +#if defined(JSON_HEDLEY_VERSION_ENCODE) + #undef JSON_HEDLEY_VERSION_ENCODE +#endif +#define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR) + #undef JSON_HEDLEY_VERSION_DECODE_MAJOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR) + #undef JSON_HEDLEY_VERSION_DECODE_MINOR +#endif +#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) + +#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION) + #undef JSON_HEDLEY_VERSION_DECODE_REVISION +#endif +#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) + +#if defined(JSON_HEDLEY_GNUC_VERSION) + #undef JSON_HEDLEY_GNUC_VERSION +#endif +#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#elif defined(__GNUC__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) +#endif + +#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK) + #undef JSON_HEDLEY_GNUC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GNUC_VERSION) + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION) + #undef JSON_HEDLEY_MSVC_VERSION +#endif +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) +#elif defined(_MSC_FULL_VER) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) +#elif defined(_MSC_VER) && !defined(__ICL) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK) + #undef JSON_HEDLEY_MSVC_VERSION_CHECK +#endif +#if !defined(JSON_HEDLEY_MSVC_VERSION) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) +#elif defined(_MSC_VER) && (_MSC_VER >= 1400) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) +#elif defined(_MSC_VER) && (_MSC_VER >= 1200) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) +#else + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION) + #undef JSON_HEDLEY_INTEL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && !defined(__ICL) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) +#elif defined(__INTEL_COMPILER) && !defined(__ICL) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_VERSION) + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_INTEL_CL_VERSION) + #undef JSON_HEDLEY_INTEL_CL_VERSION +#endif +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && defined(__ICL) + #define JSON_HEDLEY_INTEL_CL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER, __INTEL_COMPILER_UPDATE, 0) +#endif + +#if defined(JSON_HEDLEY_INTEL_CL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_CL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_INTEL_CL_VERSION) + #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_CL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION) + #undef JSON_HEDLEY_PGI_VERSION +#endif +#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) + #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION_CHECK) + #undef JSON_HEDLEY_PGI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PGI_VERSION) + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #undef JSON_HEDLEY_SUNPRO_VERSION +#endif +#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) +#elif defined(__SUNPRO_C) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) +#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) +#elif defined(__SUNPRO_CC) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) +#endif + +#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK) + #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#endif +#if defined(__EMSCRIPTEN__) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) +#endif + +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION) + #undef JSON_HEDLEY_ARM_VERSION +#endif +#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) +#elif defined(__CC_ARM) && defined(__ARMCC_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) +#endif + +#if defined(JSON_HEDLEY_ARM_VERSION_CHECK) + #undef JSON_HEDLEY_ARM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_ARM_VERSION) + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION) + #undef JSON_HEDLEY_IBM_VERSION +#endif +#if defined(__ibmxl__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) +#elif defined(__xlC__) && defined(__xlC_ver__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) +#elif defined(__xlC__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) +#endif + +#if defined(JSON_HEDLEY_IBM_VERSION_CHECK) + #undef JSON_HEDLEY_IBM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IBM_VERSION) + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_VERSION) + #undef JSON_HEDLEY_TI_VERSION +#endif +#if \ + defined(__TI_COMPILER_VERSION__) && \ + ( \ + defined(__TMS470__) || defined(__TI_ARM__) || \ + defined(__MSP430__) || \ + defined(__TMS320C2000__) \ + ) +#if (__TI_COMPILER_VERSION__ >= 16000000) + #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif +#endif + +#if defined(JSON_HEDLEY_TI_VERSION_CHECK) + #undef JSON_HEDLEY_TI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_VERSION) + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #undef JSON_HEDLEY_TI_CL2000_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__) + #define JSON_HEDLEY_TI_CL2000_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL2000_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL2000_VERSION) + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL2000_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #undef JSON_HEDLEY_TI_CL430_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__) + #define JSON_HEDLEY_TI_CL430_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL430_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL430_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL430_VERSION) + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL430_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #undef JSON_HEDLEY_TI_ARMCL_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__)) + #define JSON_HEDLEY_TI_ARMCL_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION_CHECK) + #undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_ARMCL_VERSION) + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_ARMCL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #undef JSON_HEDLEY_TI_CL6X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__) + #define JSON_HEDLEY_TI_CL6X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL6X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL6X_VERSION) + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL6X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #undef JSON_HEDLEY_TI_CL7X_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__C7000__) + #define JSON_HEDLEY_TI_CL7X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CL7X_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CL7X_VERSION) + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL7X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #undef JSON_HEDLEY_TI_CLPRU_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) && defined(__PRU__) + #define JSON_HEDLEY_TI_CLPRU_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif + +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION_CHECK) + #undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_CLPRU_VERSION) + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CLPRU_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION) + #undef JSON_HEDLEY_CRAY_VERSION +#endif +#if defined(_CRAYC) + #if defined(_RELEASE_PATCHLEVEL) + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #else + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK) + #undef JSON_HEDLEY_CRAY_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_CRAY_VERSION) + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION) + #undef JSON_HEDLEY_IAR_VERSION +#endif +#if defined(__IAR_SYSTEMS_ICC__) + #if __VER__ > 1000 + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #else + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(__VER__ / 100, __VER__ % 100, 0) + #endif +#endif + +#if defined(JSON_HEDLEY_IAR_VERSION_CHECK) + #undef JSON_HEDLEY_IAR_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IAR_VERSION) + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION) + #undef JSON_HEDLEY_TINYC_VERSION +#endif +#if defined(__TINYC__) + #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) +#endif + +#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK) + #undef JSON_HEDLEY_TINYC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION) + #undef JSON_HEDLEY_DMC_VERSION +#endif +#if defined(__DMC__) + #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) +#endif + +#if defined(JSON_HEDLEY_DMC_VERSION_CHECK) + #undef JSON_HEDLEY_DMC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_DMC_VERSION) + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #undef JSON_HEDLEY_COMPCERT_VERSION +#endif +#if defined(__COMPCERT_VERSION__) + #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) +#endif + +#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK) + #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION) + #undef JSON_HEDLEY_PELLES_VERSION +#endif +#if defined(__POCC__) + #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) +#endif + +#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK) + #undef JSON_HEDLEY_PELLES_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PELLES_VERSION) + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_MCST_LCC_VERSION) + #undef JSON_HEDLEY_MCST_LCC_VERSION +#endif +#if defined(__LCC__) && defined(__LCC_MINOR__) + #define JSON_HEDLEY_MCST_LCC_VERSION JSON_HEDLEY_VERSION_ENCODE(__LCC__ / 100, __LCC__ % 100, __LCC_MINOR__) +#endif + +#if defined(JSON_HEDLEY_MCST_LCC_VERSION_CHECK) + #undef JSON_HEDLEY_MCST_LCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_MCST_LCC_VERSION) + #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_MCST_LCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION) + #undef JSON_HEDLEY_GCC_VERSION +#endif +#if \ + defined(JSON_HEDLEY_GNUC_VERSION) && \ + !defined(__clang__) && \ + !defined(JSON_HEDLEY_INTEL_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_ARM_VERSION) && \ + !defined(JSON_HEDLEY_CRAY_VERSION) && \ + !defined(JSON_HEDLEY_TI_VERSION) && \ + !defined(JSON_HEDLEY_TI_ARMCL_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL430_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL2000_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL6X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CL7X_VERSION) && \ + !defined(JSON_HEDLEY_TI_CLPRU_VERSION) && \ + !defined(__COMPCERT__) && \ + !defined(JSON_HEDLEY_MCST_LCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION +#endif + +#if defined(JSON_HEDLEY_GCC_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_ATTRIBUTE +#endif +#if \ + defined(__has_attribute) && \ + ( \ + (!defined(JSON_HEDLEY_IAR_VERSION) || JSON_HEDLEY_IAR_VERSION_CHECK(8,5,9)) \ + ) +# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) +#else +# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#endif +#if \ + defined(__has_cpp_attribute) && \ + defined(__cplusplus) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS +#endif +#if !defined(__cplusplus) || !defined(__has_cpp_attribute) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#elif \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION) && \ + (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ + (!defined(JSON_HEDLEY_MSVC_VERSION) || JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0)) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_BUILTIN) + #undef JSON_HEDLEY_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) +#else + #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN) + #undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN) + #undef JSON_HEDLEY_GCC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_FEATURE) + #undef JSON_HEDLEY_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) +#else + #define JSON_HEDLEY_HAS_FEATURE(feature) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE) + #undef JSON_HEDLEY_GNUC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_FEATURE) + #undef JSON_HEDLEY_GCC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_EXTENSION) + #undef JSON_HEDLEY_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) +#else + #define JSON_HEDLEY_HAS_EXTENSION(extension) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION) + #undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION) + #undef JSON_HEDLEY_GCC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_HAS_WARNING) + #undef JSON_HEDLEY_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) +#else + #define JSON_HEDLEY_HAS_WARNING(warning) (0) +#endif + +#if defined(JSON_HEDLEY_GNUC_HAS_WARNING) + #undef JSON_HEDLEY_GNUC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_GCC_HAS_WARNING) + #undef JSON_HEDLEY_GCC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + defined(__clang__) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ + (JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) + #define JSON_HEDLEY_PRAGMA(value) _Pragma(#value) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_PRAGMA(value) __pragma(value) +#else + #define JSON_HEDLEY_PRAGMA(value) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH) + #undef JSON_HEDLEY_DIAGNOSTIC_PUSH +#endif +#if defined(JSON_HEDLEY_DIAGNOSTIC_POP) + #undef JSON_HEDLEY_DIAGNOSTIC_POP +#endif +#if defined(__clang__) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) + #define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) +#elif JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") + #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_PUSH + #define JSON_HEDLEY_DIAGNOSTIC_POP +#endif + +/* JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat") +# if JSON_HEDLEY_HAS_WARNING("-Wc++17-extensions") +# if JSON_HEDLEY_HAS_WARNING("-Wc++1z-extensions") +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + _Pragma("clang diagnostic ignored \"-Wc++1z-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# else +# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ + xpr \ + JSON_HEDLEY_DIAGNOSTIC_POP +# endif +# endif +#endif +#if !defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x +#endif + +#if defined(JSON_HEDLEY_CONST_CAST) + #undef JSON_HEDLEY_CONST_CAST +#endif +#if defined(__cplusplus) +# define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast(expr)) +#elif \ + JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_REINTERPRET_CAST) + #undef JSON_HEDLEY_REINTERPRET_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast(expr)) +#else + #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_STATIC_CAST) + #undef JSON_HEDLEY_STATIC_CAST +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast(expr)) +#else + #define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) +#endif + +#if defined(JSON_HEDLEY_CPP_CAST) + #undef JSON_HEDLEY_CPP_CAST +#endif +#if defined(__cplusplus) +# if JSON_HEDLEY_HAS_WARNING("-Wold-style-cast") +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") \ + ((T) (expr)) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# elif JSON_HEDLEY_IAR_VERSION_CHECK(8,3,0) +# define JSON_HEDLEY_CPP_CAST(T, expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("diag_suppress=Pe137") \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_CPP_CAST(T, expr) ((T) (expr)) +# endif +#else +# define JSON_HEDLEY_CPP_CAST(T, expr) (expr) +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:1478 1786)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1216,1444,1445") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:161)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(16,9,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 161") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-attributes") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("warning(disable:1292)") +#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:1292)) +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:5030)) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097,1098") +#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("error_messages(off,attrskipunsup)") +#elif \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1173") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress=Pe1097") +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wcast-qual") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") +#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL +#endif + +#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION) + #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunused-function") + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("clang diagnostic ignored \"-Wunused-function\"") +#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("GCC diagnostic ignored \"-Wunused-function\"") +#elif JSON_HEDLEY_MSVC_VERSION_CHECK(1,0,0) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION __pragma(warning(disable:4505)) +#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("diag_suppress 3142") +#else + #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION +#endif + +#if defined(JSON_HEDLEY_DEPRECATED) + #undef JSON_HEDLEY_DEPRECATED +#endif +#if defined(JSON_HEDLEY_DEPRECATED_FOR) + #undef JSON_HEDLEY_DEPRECATED_FOR +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) +#elif \ + (JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) && !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(18,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) +#elif defined(__cplusplus) && (__cplusplus >= 201402L) + #define JSON_HEDLEY_DEPRECATED(since) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since)]]) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since "; use " #replacement)]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated") + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") +#else + #define JSON_HEDLEY_DEPRECATED(since) + #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) +#endif + +#if defined(JSON_HEDLEY_UNAVAILABLE) + #undef JSON_HEDLEY_UNAVAILABLE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) +#else + #define JSON_HEDLEY_UNAVAILABLE(available_since) +#endif + +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT +#endif +#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT_MSG) + #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__)) +#elif (JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) + #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) +#elif defined(_Check_return_) /* SAL */ + #define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_ + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_ +#else + #define JSON_HEDLEY_WARN_UNUSED_RESULT + #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) +#endif + +#if defined(JSON_HEDLEY_SENTINEL) + #undef JSON_HEDLEY_SENTINEL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) +#else + #define JSON_HEDLEY_SENTINEL(position) +#endif + +#if defined(JSON_HEDLEY_NO_RETURN) + #undef JSON_HEDLEY_NO_RETURN +#endif +#if JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NO_RETURN __noreturn +#elif \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L + #define JSON_HEDLEY_NO_RETURN _Noreturn +#elif defined(__cplusplus) && (__cplusplus >= 201103L) + #define JSON_HEDLEY_NO_RETURN JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]]) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_NO_RETURN _Pragma("does_not_return") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NO_RETURN __attribute((noreturn)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NO_RETURN __declspec(noreturn) +#else + #define JSON_HEDLEY_NO_RETURN +#endif + +#if defined(JSON_HEDLEY_NO_ESCAPE) + #undef JSON_HEDLEY_NO_ESCAPE +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(noescape) + #define JSON_HEDLEY_NO_ESCAPE __attribute__((__noescape__)) +#else + #define JSON_HEDLEY_NO_ESCAPE +#endif + +#if defined(JSON_HEDLEY_UNREACHABLE) + #undef JSON_HEDLEY_UNREACHABLE +#endif +#if defined(JSON_HEDLEY_UNREACHABLE_RETURN) + #undef JSON_HEDLEY_UNREACHABLE_RETURN +#endif +#if defined(JSON_HEDLEY_ASSUME) + #undef JSON_HEDLEY_ASSUME +#endif +#if \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_ASSUME(expr) __assume(expr) +#elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume) + #define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr) +#elif \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #if defined(__cplusplus) + #define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr) + #else + #define JSON_HEDLEY_ASSUME(expr) _nassert(expr) + #endif +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,10,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(10,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable() +#elif defined(JSON_HEDLEY_ASSUME) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif +#if !defined(JSON_HEDLEY_ASSUME) + #if defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (JSON_HEDLEY_UNREACHABLE(), 1))) + #else + #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, expr) + #endif +#endif +#if defined(JSON_HEDLEY_UNREACHABLE) + #if \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (JSON_HEDLEY_STATIC_CAST(void, JSON_HEDLEY_ASSUME(0)), (value)) + #else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE() + #endif +#else + #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (value) +#endif +#if !defined(JSON_HEDLEY_UNREACHABLE) + #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0) +#endif + +JSON_HEDLEY_DIAGNOSTIC_PUSH +#if JSON_HEDLEY_HAS_WARNING("-Wpedantic") + #pragma clang diagnostic ignored "-Wpedantic" +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus) + #pragma clang diagnostic ignored "-Wc++98-compat-pedantic" +#endif +#if JSON_HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros",4,0,0) + #if defined(__clang__) + #pragma clang diagnostic ignored "-Wvariadic-macros" + #elif defined(JSON_HEDLEY_GCC_VERSION) + #pragma GCC diagnostic ignored "-Wvariadic-macros" + #endif +#endif +#if defined(JSON_HEDLEY_NON_NULL) + #undef JSON_HEDLEY_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) +#else + #define JSON_HEDLEY_NON_NULL(...) +#endif +JSON_HEDLEY_DIAGNOSTIC_POP + +#if defined(JSON_HEDLEY_PRINTF_FORMAT) + #undef JSON_HEDLEY_PRINTF_FORMAT +#endif +#if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) +#elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) +#elif \ + JSON_HEDLEY_HAS_ATTRIBUTE(format) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0) + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) +#else + #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) +#endif + +#if defined(JSON_HEDLEY_CONSTEXPR) + #undef JSON_HEDLEY_CONSTEXPR +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_CONSTEXPR JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr) + #endif +#endif +#if !defined(JSON_HEDLEY_CONSTEXPR) + #define JSON_HEDLEY_CONSTEXPR +#endif + +#if defined(JSON_HEDLEY_PREDICT) + #undef JSON_HEDLEY_PREDICT +#endif +#if defined(JSON_HEDLEY_LIKELY) + #undef JSON_HEDLEY_LIKELY +#endif +#if defined(JSON_HEDLEY_UNLIKELY) + #undef JSON_HEDLEY_UNLIKELY +#endif +#if defined(JSON_HEDLEY_UNPREDICTABLE) + #undef JSON_HEDLEY_UNPREDICTABLE +#endif +#if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable) + #define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr)) +#endif +#if \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) && !defined(JSON_HEDLEY_PGI_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability( (expr), (value), (probability)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1 , (probability)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0 , (probability)) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect (!!(expr), 1 ) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect (!!(expr), 0 ) +#elif \ + (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PREDICT(expr, expected, probability) \ + (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (JSON_HEDLEY_STATIC_CAST(void, expected), (expr))) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ + })) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \ + (__extension__ ({ \ + double hedley_probability_ = (probability); \ + ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ + })) +# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) +# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) +#else +# define JSON_HEDLEY_PREDICT(expr, expected, probability) (JSON_HEDLEY_STATIC_CAST(void, expected), (expr)) +# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) +# define JSON_HEDLEY_LIKELY(expr) (!!(expr)) +# define JSON_HEDLEY_UNLIKELY(expr) (!!(expr)) +#endif +#if !defined(JSON_HEDLEY_UNPREDICTABLE) + #define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5) +#endif + +#if defined(JSON_HEDLEY_MALLOC) + #undef JSON_HEDLEY_MALLOC +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_MALLOC __attribute__((__malloc__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_MALLOC _Pragma("returns_new_memory") +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_MALLOC __declspec(restrict) +#else + #define JSON_HEDLEY_MALLOC +#endif + +#if defined(JSON_HEDLEY_PURE) + #undef JSON_HEDLEY_PURE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PURE __attribute__((__pure__)) +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) +# define JSON_HEDLEY_PURE _Pragma("does_not_write_global_data") +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) \ + ) +# define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;") +#else +# define JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_CONST) + #undef JSON_HEDLEY_CONST +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(const) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_CONST __attribute__((__const__)) +#elif \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) + #define JSON_HEDLEY_CONST _Pragma("no_side_effect") +#else + #define JSON_HEDLEY_CONST JSON_HEDLEY_PURE +#endif + +#if defined(JSON_HEDLEY_RESTRICT) + #undef JSON_HEDLEY_RESTRICT +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT restrict +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,4) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ + defined(__clang__) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_RESTRICT __restrict +#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) + #define JSON_HEDLEY_RESTRICT _Restrict +#else + #define JSON_HEDLEY_RESTRICT +#endif + +#if defined(JSON_HEDLEY_INLINE) + #undef JSON_HEDLEY_INLINE +#endif +#if \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ + (defined(__cplusplus) && (__cplusplus >= 199711L)) + #define JSON_HEDLEY_INLINE inline +#elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0) + #define JSON_HEDLEY_INLINE __inline__ +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,1,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_INLINE __inline +#else + #define JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_ALWAYS_INLINE) + #undef JSON_HEDLEY_ALWAYS_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) +# define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_ALWAYS_INLINE __forceinline +#elif defined(__cplusplus) && \ + ( \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) \ + ) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") +#else +# define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE +#endif + +#if defined(JSON_HEDLEY_NEVER_INLINE) + #undef JSON_HEDLEY_NEVER_INLINE +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ + JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \ + (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ + (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ + (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ + JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ + JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ + JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#elif JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline") +#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) + #define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never") +#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) + #define JSON_HEDLEY_NEVER_INLINE __attribute((noinline)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0) + #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline) +#else + #define JSON_HEDLEY_NEVER_INLINE +#endif + +#if defined(JSON_HEDLEY_PRIVATE) + #undef JSON_HEDLEY_PRIVATE +#endif +#if defined(JSON_HEDLEY_PUBLIC) + #undef JSON_HEDLEY_PUBLIC +#endif +#if defined(JSON_HEDLEY_IMPORT) + #undef JSON_HEDLEY_IMPORT +#endif +#if defined(_WIN32) || defined(__CYGWIN__) +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC __declspec(dllexport) +# define JSON_HEDLEY_IMPORT __declspec(dllimport) +#else +# if \ + JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + ( \ + defined(__TI_EABI__) && \ + ( \ + (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) \ + ) \ + ) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) +# define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) +# define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default"))) +# else +# define JSON_HEDLEY_PRIVATE +# define JSON_HEDLEY_PUBLIC +# endif +# define JSON_HEDLEY_IMPORT extern +#endif + +#if defined(JSON_HEDLEY_NO_THROW) + #undef JSON_HEDLEY_NO_THROW +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__)) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) + #define JSON_HEDLEY_NO_THROW __declspec(nothrow) +#else + #define JSON_HEDLEY_NO_THROW +#endif + +#if defined(JSON_HEDLEY_FALL_THROUGH) + #undef JSON_HEDLEY_FALL_THROUGH +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(fallthrough) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang,fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]]) +#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough) + #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]]) +#elif defined(__fallthrough) /* SAL */ + #define JSON_HEDLEY_FALL_THROUGH __fallthrough +#else + #define JSON_HEDLEY_FALL_THROUGH +#endif + +#if defined(JSON_HEDLEY_RETURNS_NON_NULL) + #undef JSON_HEDLEY_RETURNS_NON_NULL +#endif +#if \ + JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) +#elif defined(_Ret_notnull_) /* SAL */ + #define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_ +#else + #define JSON_HEDLEY_RETURNS_NON_NULL +#endif + +#if defined(JSON_HEDLEY_ARRAY_PARAM) + #undef JSON_HEDLEY_ARRAY_PARAM +#endif +#if \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ + !defined(__STDC_NO_VLA__) && \ + !defined(__cplusplus) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_ARRAY_PARAM(name) (name) +#else + #define JSON_HEDLEY_ARRAY_PARAM(name) +#endif + +#if defined(JSON_HEDLEY_IS_CONSTANT) + #undef JSON_HEDLEY_IS_CONSTANT +#endif +#if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR) + #undef JSON_HEDLEY_REQUIRE_CONSTEXPR +#endif +/* JSON_HEDLEY_IS_CONSTEXPR_ is for + HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #undef JSON_HEDLEY_IS_CONSTEXPR_ +#endif +#if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ + (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) && !defined(__cplusplus)) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) + #define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) +#endif +#if !defined(__cplusplus) +# if \ + JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ + JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ + JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) +#endif +# elif \ + ( \ + defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \ + !defined(JSON_HEDLEY_SUNPRO_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_IAR_VERSION)) || \ + (JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) && !defined(JSON_HEDLEY_IAR_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ + JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ + JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0) +#if defined(__INTPTR_TYPE__) + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) +#else + #include + #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) +#endif +# elif \ + defined(JSON_HEDLEY_GCC_VERSION) || \ + defined(JSON_HEDLEY_INTEL_VERSION) || \ + defined(JSON_HEDLEY_TINYC_VERSION) || \ + defined(JSON_HEDLEY_TI_ARMCL_VERSION) || \ + JSON_HEDLEY_TI_CL430_VERSION_CHECK(18,12,0) || \ + defined(JSON_HEDLEY_TI_CL2000_VERSION) || \ + defined(JSON_HEDLEY_TI_CL6X_VERSION) || \ + defined(JSON_HEDLEY_TI_CL7X_VERSION) || \ + defined(JSON_HEDLEY_TI_CLPRU_VERSION) || \ + defined(__clang__) +# define JSON_HEDLEY_IS_CONSTEXPR_(expr) ( \ + sizeof(void) != \ + sizeof(*( \ + 1 ? \ + ((void*) ((expr) * 0L) ) : \ +((struct { char v[sizeof(void) * 2]; } *) 1) \ + ) \ + ) \ + ) +# endif +#endif +#if defined(JSON_HEDLEY_IS_CONSTEXPR_) + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY_IS_CONSTEXPR_(expr) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1)) +#else + #if !defined(JSON_HEDLEY_IS_CONSTANT) + #define JSON_HEDLEY_IS_CONSTANT(expr) (0) + #endif + #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) +#endif + +#if defined(JSON_HEDLEY_BEGIN_C_DECLS) + #undef JSON_HEDLEY_BEGIN_C_DECLS +#endif +#if defined(JSON_HEDLEY_END_C_DECLS) + #undef JSON_HEDLEY_END_C_DECLS +#endif +#if defined(JSON_HEDLEY_C_DECL) + #undef JSON_HEDLEY_C_DECL +#endif +#if defined(__cplusplus) + #define JSON_HEDLEY_BEGIN_C_DECLS extern "C" { + #define JSON_HEDLEY_END_C_DECLS } + #define JSON_HEDLEY_C_DECL extern "C" +#else + #define JSON_HEDLEY_BEGIN_C_DECLS + #define JSON_HEDLEY_END_C_DECLS + #define JSON_HEDLEY_C_DECL +#endif + +#if defined(JSON_HEDLEY_STATIC_ASSERT) + #undef JSON_HEDLEY_STATIC_ASSERT +#endif +#if \ + !defined(__cplusplus) && ( \ + (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ + (JSON_HEDLEY_HAS_FEATURE(c_static_assert) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \ + JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ + defined(_Static_assert) \ + ) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) +#elif \ + (defined(__cplusplus) && (__cplusplus >= 201103L)) || \ + JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message)) +#else +# define JSON_HEDLEY_STATIC_ASSERT(expr, message) +#endif + +#if defined(JSON_HEDLEY_NULL) + #undef JSON_HEDLEY_NULL +#endif +#if defined(__cplusplus) + #if __cplusplus >= 201103L + #define JSON_HEDLEY_NULL JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr) + #elif defined(NULL) + #define JSON_HEDLEY_NULL NULL + #else + #define JSON_HEDLEY_NULL JSON_HEDLEY_STATIC_CAST(void*, 0) + #endif +#elif defined(NULL) + #define JSON_HEDLEY_NULL NULL +#else + #define JSON_HEDLEY_NULL ((void*) 0) +#endif + +#if defined(JSON_HEDLEY_MESSAGE) + #undef JSON_HEDLEY_MESSAGE +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_MESSAGE(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(message msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg) +#elif JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg) +#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0) +# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_WARNING) + #undef JSON_HEDLEY_WARNING +#endif +#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas") +# define JSON_HEDLEY_WARNING(msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ + JSON_HEDLEY_PRAGMA(clang warning msg) \ + JSON_HEDLEY_DIAGNOSTIC_POP +#elif \ + JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ + JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ + JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg) +#elif \ + JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg)) +#else +# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg) +#endif + +#if defined(JSON_HEDLEY_REQUIRE) + #undef JSON_HEDLEY_REQUIRE +#endif +#if defined(JSON_HEDLEY_REQUIRE_MSG) + #undef JSON_HEDLEY_REQUIRE_MSG +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if) +# if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat") +# define JSON_HEDLEY_REQUIRE(expr) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), #expr, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ + __attribute__((diagnose_if(!(expr), msg, "error"))) \ + JSON_HEDLEY_DIAGNOSTIC_POP +# else +# define JSON_HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, "error"))) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) __attribute__((diagnose_if(!(expr), msg, "error"))) +# endif +#else +# define JSON_HEDLEY_REQUIRE(expr) +# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) +#endif + +#if defined(JSON_HEDLEY_FLAGS) + #undef JSON_HEDLEY_FLAGS +#endif +#if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) && (!defined(__cplusplus) || JSON_HEDLEY_HAS_WARNING("-Wbitfield-enum-conversion")) + #define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__)) +#else + #define JSON_HEDLEY_FLAGS +#endif + +#if defined(JSON_HEDLEY_FLAGS_CAST) + #undef JSON_HEDLEY_FLAGS_CAST +#endif +#if JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0) +# define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ + JSON_HEDLEY_DIAGNOSTIC_PUSH \ + _Pragma("warning(disable:188)") \ + ((T) (expr)); \ + JSON_HEDLEY_DIAGNOSTIC_POP \ + })) +#else +# define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr) +#endif + +#if defined(JSON_HEDLEY_EMPTY_BASES) + #undef JSON_HEDLEY_EMPTY_BASES +#endif +#if \ + (JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,23918) && !JSON_HEDLEY_MSVC_VERSION_CHECK(20,0,0)) || \ + JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) + #define JSON_HEDLEY_EMPTY_BASES __declspec(empty_bases) +#else + #define JSON_HEDLEY_EMPTY_BASES +#endif + +/* Remaining macros are deprecated. */ + +#if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK +#endif +#if defined(__clang__) + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) +#else + #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif + +#if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN) + #undef JSON_HEDLEY_CLANG_HAS_BUILTIN +#endif +#define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin) + +#if defined(JSON_HEDLEY_CLANG_HAS_FEATURE) + #undef JSON_HEDLEY_CLANG_HAS_FEATURE +#endif +#define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature) + +#if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION) + #undef JSON_HEDLEY_CLANG_HAS_EXTENSION +#endif +#define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension) + +#if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE +#endif +#define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) + +#if defined(JSON_HEDLEY_CLANG_HAS_WARNING) + #undef JSON_HEDLEY_CLANG_HAS_WARNING +#endif +#define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning) + +#endif /* !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < X) */ + + +// This file contains all internal macro definitions (except those affecting ABI) +// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them + +// #include + + +// exclude unsupported compilers +#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) + #if defined(__clang__) + #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 + #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) + #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 + #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" + #endif + #endif +#endif + +// C++ language standard detection +// if the user manually specified the used c++ version this is skipped +#if !defined(JSON_HAS_CPP_23) && !defined(JSON_HAS_CPP_20) && !defined(JSON_HAS_CPP_17) && !defined(JSON_HAS_CPP_14) && !defined(JSON_HAS_CPP_11) + #if (defined(__cplusplus) && __cplusplus > 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG > 202002L) + #define JSON_HAS_CPP_23 + #define JSON_HAS_CPP_20 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus > 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG > 201703L) + #define JSON_HAS_CPP_20 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus > 201402L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 + #define JSON_HAS_CPP_17 + #define JSON_HAS_CPP_14 + #elif (defined(__cplusplus) && __cplusplus > 201103L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) + #define JSON_HAS_CPP_14 + #endif + // the cpp 11 flag is always specified because it is the minimal required version + #define JSON_HAS_CPP_11 +#endif + +#ifdef __has_include + #if __has_include() + #include + #endif +#endif + +#if !defined(JSON_HAS_FILESYSTEM) && !defined(JSON_HAS_EXPERIMENTAL_FILESYSTEM) + #ifdef JSON_HAS_CPP_17 + #if defined(__cpp_lib_filesystem) + #define JSON_HAS_FILESYSTEM 1 + #elif defined(__cpp_lib_experimental_filesystem) + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #elif !defined(__has_include) + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #elif __has_include() + #define JSON_HAS_FILESYSTEM 1 + #elif __has_include() + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 1 + #endif + + // std::filesystem does not work on MinGW GCC 8: https://sourceforge.net/p/mingw-w64/bugs/737/ + #if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ == 8 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before GCC 8: https://en.cppreference.com/w/cpp/compiler_support + #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 8 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before Clang 7: https://en.cppreference.com/w/cpp/compiler_support + #if defined(__clang_major__) && __clang_major__ < 7 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before MSVC 19.14: https://en.cppreference.com/w/cpp/compiler_support + #if defined(_MSC_VER) && _MSC_VER < 1914 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before iOS 13 + #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 130000 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + + // no filesystem support before macOS Catalina + #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 + #undef JSON_HAS_FILESYSTEM + #undef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #endif + #endif +#endif + +#ifndef JSON_HAS_EXPERIMENTAL_FILESYSTEM + #define JSON_HAS_EXPERIMENTAL_FILESYSTEM 0 +#endif + +#ifndef JSON_HAS_FILESYSTEM + #define JSON_HAS_FILESYSTEM 0 +#endif + +#ifndef JSON_HAS_THREE_WAY_COMPARISON + #if defined(__cpp_impl_three_way_comparison) && __cpp_impl_three_way_comparison >= 201907L \ + && defined(__cpp_lib_three_way_comparison) && __cpp_lib_three_way_comparison >= 201907L + #define JSON_HAS_THREE_WAY_COMPARISON 1 + #else + #define JSON_HAS_THREE_WAY_COMPARISON 0 + #endif +#endif + +#ifndef JSON_HAS_RANGES + // ranges header shipping in GCC 11.1.0 (released 2021-04-27) has syntax error + #if defined(__GLIBCXX__) && __GLIBCXX__ == 20210427 + #define JSON_HAS_RANGES 0 + #elif defined(__cpp_lib_ranges) + #define JSON_HAS_RANGES 1 + #else + #define JSON_HAS_RANGES 0 + #endif +#endif + +#ifndef JSON_HAS_STATIC_RTTI + #if !defined(_HAS_STATIC_RTTI) || _HAS_STATIC_RTTI != 0 + #define JSON_HAS_STATIC_RTTI 1 + #else + #define JSON_HAS_STATIC_RTTI 0 + #endif +#endif + +#ifdef JSON_HAS_CPP_17 + #define JSON_INLINE_VARIABLE inline +#else + #define JSON_INLINE_VARIABLE +#endif + +#if JSON_HEDLEY_HAS_ATTRIBUTE(no_unique_address) + #define JSON_NO_UNIQUE_ADDRESS [[no_unique_address]] +#else + #define JSON_NO_UNIQUE_ADDRESS +#endif + +// disable documentation warnings on clang +#if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdocumentation" + #pragma clang diagnostic ignored "-Wdocumentation-unknown-command" +#endif + +// allow disabling exceptions +#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) + #define JSON_THROW(exception) throw exception + #define JSON_TRY try + #define JSON_CATCH(exception) catch(exception) + #define JSON_INTERNAL_CATCH(exception) catch(exception) +#else + #include + #define JSON_THROW(exception) std::abort() + #define JSON_TRY if(true) + #define JSON_CATCH(exception) if(false) + #define JSON_INTERNAL_CATCH(exception) if(false) +#endif + +// override exception macros +#if defined(JSON_THROW_USER) + #undef JSON_THROW + #define JSON_THROW JSON_THROW_USER +#endif +#if defined(JSON_TRY_USER) + #undef JSON_TRY + #define JSON_TRY JSON_TRY_USER +#endif +#if defined(JSON_CATCH_USER) + #undef JSON_CATCH + #define JSON_CATCH JSON_CATCH_USER + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_CATCH_USER +#endif +#if defined(JSON_INTERNAL_CATCH_USER) + #undef JSON_INTERNAL_CATCH + #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER +#endif + +// allow overriding assert +#if !defined(JSON_ASSERT) + #include // assert + #define JSON_ASSERT(x) assert(x) +#endif + +// allow to access some private functions (needed by the test suite) +#if defined(JSON_TESTS_PRIVATE) + #define JSON_PRIVATE_UNLESS_TESTED public +#else + #define JSON_PRIVATE_UNLESS_TESTED private +#endif + +/*! +@brief macro to briefly define a mapping between an enum and JSON +@def NLOHMANN_JSON_SERIALIZE_ENUM +@since version 3.4.0 +*/ +#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ + template \ + inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ + { \ + /* NOLINTNEXTLINE(modernize-type-traits) we use C++11 */ \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + /* NOLINTNEXTLINE(modernize-avoid-c-arrays) we don't want to depend on */ \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [e](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.first == e; \ + }); \ + j = ((it != std::end(m)) ? it : std::begin(m))->second; \ + } \ + template \ + inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ + { \ + /* NOLINTNEXTLINE(modernize-type-traits) we use C++11 */ \ + static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ + /* NOLINTNEXTLINE(modernize-avoid-c-arrays) we don't want to depend on */ \ + static const std::pair m[] = __VA_ARGS__; \ + auto it = std::find_if(std::begin(m), std::end(m), \ + [&j](const std::pair& ej_pair) -> bool \ + { \ + return ej_pair.second == j; \ + }); \ + e = ((it != std::end(m)) ? it : std::begin(m))->first; \ + } + +// Ugly macros to avoid uglier copy-paste when specializing basic_json. They +// may be removed in the future once the class is split. + +#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \ + template class ObjectType, \ + template class ArrayType, \ + class StringType, class BooleanType, class NumberIntegerType, \ + class NumberUnsignedType, class NumberFloatType, \ + template class AllocatorType, \ + template class JSONSerializer, \ + class BinaryType, \ + class CustomBaseClass> + +#define NLOHMANN_BASIC_JSON_TPL \ + basic_json + +// Macros to simplify conversion from/to types + +#define NLOHMANN_JSON_EXPAND( x ) x +#define NLOHMANN_JSON_GET_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, NAME,...) NAME +#define NLOHMANN_JSON_PASTE(...) NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_GET_MACRO(__VA_ARGS__, \ + NLOHMANN_JSON_PASTE64, \ + NLOHMANN_JSON_PASTE63, \ + NLOHMANN_JSON_PASTE62, \ + NLOHMANN_JSON_PASTE61, \ + NLOHMANN_JSON_PASTE60, \ + NLOHMANN_JSON_PASTE59, \ + NLOHMANN_JSON_PASTE58, \ + NLOHMANN_JSON_PASTE57, \ + NLOHMANN_JSON_PASTE56, \ + NLOHMANN_JSON_PASTE55, \ + NLOHMANN_JSON_PASTE54, \ + NLOHMANN_JSON_PASTE53, \ + NLOHMANN_JSON_PASTE52, \ + NLOHMANN_JSON_PASTE51, \ + NLOHMANN_JSON_PASTE50, \ + NLOHMANN_JSON_PASTE49, \ + NLOHMANN_JSON_PASTE48, \ + NLOHMANN_JSON_PASTE47, \ + NLOHMANN_JSON_PASTE46, \ + NLOHMANN_JSON_PASTE45, \ + NLOHMANN_JSON_PASTE44, \ + NLOHMANN_JSON_PASTE43, \ + NLOHMANN_JSON_PASTE42, \ + NLOHMANN_JSON_PASTE41, \ + NLOHMANN_JSON_PASTE40, \ + NLOHMANN_JSON_PASTE39, \ + NLOHMANN_JSON_PASTE38, \ + NLOHMANN_JSON_PASTE37, \ + NLOHMANN_JSON_PASTE36, \ + NLOHMANN_JSON_PASTE35, \ + NLOHMANN_JSON_PASTE34, \ + NLOHMANN_JSON_PASTE33, \ + NLOHMANN_JSON_PASTE32, \ + NLOHMANN_JSON_PASTE31, \ + NLOHMANN_JSON_PASTE30, \ + NLOHMANN_JSON_PASTE29, \ + NLOHMANN_JSON_PASTE28, \ + NLOHMANN_JSON_PASTE27, \ + NLOHMANN_JSON_PASTE26, \ + NLOHMANN_JSON_PASTE25, \ + NLOHMANN_JSON_PASTE24, \ + NLOHMANN_JSON_PASTE23, \ + NLOHMANN_JSON_PASTE22, \ + NLOHMANN_JSON_PASTE21, \ + NLOHMANN_JSON_PASTE20, \ + NLOHMANN_JSON_PASTE19, \ + NLOHMANN_JSON_PASTE18, \ + NLOHMANN_JSON_PASTE17, \ + NLOHMANN_JSON_PASTE16, \ + NLOHMANN_JSON_PASTE15, \ + NLOHMANN_JSON_PASTE14, \ + NLOHMANN_JSON_PASTE13, \ + NLOHMANN_JSON_PASTE12, \ + NLOHMANN_JSON_PASTE11, \ + NLOHMANN_JSON_PASTE10, \ + NLOHMANN_JSON_PASTE9, \ + NLOHMANN_JSON_PASTE8, \ + NLOHMANN_JSON_PASTE7, \ + NLOHMANN_JSON_PASTE6, \ + NLOHMANN_JSON_PASTE5, \ + NLOHMANN_JSON_PASTE4, \ + NLOHMANN_JSON_PASTE3, \ + NLOHMANN_JSON_PASTE2, \ + NLOHMANN_JSON_PASTE1)(__VA_ARGS__)) +#define NLOHMANN_JSON_PASTE2(func, v1) func(v1) +#define NLOHMANN_JSON_PASTE3(func, v1, v2) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE2(func, v2) +#define NLOHMANN_JSON_PASTE4(func, v1, v2, v3) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE3(func, v2, v3) +#define NLOHMANN_JSON_PASTE5(func, v1, v2, v3, v4) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE4(func, v2, v3, v4) +#define NLOHMANN_JSON_PASTE6(func, v1, v2, v3, v4, v5) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE5(func, v2, v3, v4, v5) +#define NLOHMANN_JSON_PASTE7(func, v1, v2, v3, v4, v5, v6) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE6(func, v2, v3, v4, v5, v6) +#define NLOHMANN_JSON_PASTE8(func, v1, v2, v3, v4, v5, v6, v7) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE7(func, v2, v3, v4, v5, v6, v7) +#define NLOHMANN_JSON_PASTE9(func, v1, v2, v3, v4, v5, v6, v7, v8) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE8(func, v2, v3, v4, v5, v6, v7, v8) +#define NLOHMANN_JSON_PASTE10(func, v1, v2, v3, v4, v5, v6, v7, v8, v9) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE9(func, v2, v3, v4, v5, v6, v7, v8, v9) +#define NLOHMANN_JSON_PASTE11(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE10(func, v2, v3, v4, v5, v6, v7, v8, v9, v10) +#define NLOHMANN_JSON_PASTE12(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE11(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11) +#define NLOHMANN_JSON_PASTE13(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE12(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12) +#define NLOHMANN_JSON_PASTE14(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE13(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13) +#define NLOHMANN_JSON_PASTE15(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE14(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14) +#define NLOHMANN_JSON_PASTE16(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE15(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) +#define NLOHMANN_JSON_PASTE17(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE16(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16) +#define NLOHMANN_JSON_PASTE18(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE17(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17) +#define NLOHMANN_JSON_PASTE19(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE18(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18) +#define NLOHMANN_JSON_PASTE20(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE19(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19) +#define NLOHMANN_JSON_PASTE21(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE20(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20) +#define NLOHMANN_JSON_PASTE22(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE21(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21) +#define NLOHMANN_JSON_PASTE23(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE22(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22) +#define NLOHMANN_JSON_PASTE24(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE23(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23) +#define NLOHMANN_JSON_PASTE25(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE24(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24) +#define NLOHMANN_JSON_PASTE26(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE25(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25) +#define NLOHMANN_JSON_PASTE27(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE26(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26) +#define NLOHMANN_JSON_PASTE28(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE27(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27) +#define NLOHMANN_JSON_PASTE29(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE28(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28) +#define NLOHMANN_JSON_PASTE30(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE29(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29) +#define NLOHMANN_JSON_PASTE31(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE30(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30) +#define NLOHMANN_JSON_PASTE32(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE31(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31) +#define NLOHMANN_JSON_PASTE33(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE32(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32) +#define NLOHMANN_JSON_PASTE34(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE33(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33) +#define NLOHMANN_JSON_PASTE35(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE34(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34) +#define NLOHMANN_JSON_PASTE36(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE35(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35) +#define NLOHMANN_JSON_PASTE37(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE36(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36) +#define NLOHMANN_JSON_PASTE38(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE37(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37) +#define NLOHMANN_JSON_PASTE39(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE38(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38) +#define NLOHMANN_JSON_PASTE40(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE39(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39) +#define NLOHMANN_JSON_PASTE41(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE40(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40) +#define NLOHMANN_JSON_PASTE42(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE41(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41) +#define NLOHMANN_JSON_PASTE43(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE42(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42) +#define NLOHMANN_JSON_PASTE44(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE43(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43) +#define NLOHMANN_JSON_PASTE45(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE44(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44) +#define NLOHMANN_JSON_PASTE46(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE45(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45) +#define NLOHMANN_JSON_PASTE47(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE46(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46) +#define NLOHMANN_JSON_PASTE48(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE47(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47) +#define NLOHMANN_JSON_PASTE49(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE48(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48) +#define NLOHMANN_JSON_PASTE50(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE49(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49) +#define NLOHMANN_JSON_PASTE51(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE50(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50) +#define NLOHMANN_JSON_PASTE52(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE51(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51) +#define NLOHMANN_JSON_PASTE53(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE52(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52) +#define NLOHMANN_JSON_PASTE54(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE53(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53) +#define NLOHMANN_JSON_PASTE55(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE54(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54) +#define NLOHMANN_JSON_PASTE56(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE55(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55) +#define NLOHMANN_JSON_PASTE57(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE56(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56) +#define NLOHMANN_JSON_PASTE58(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE57(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57) +#define NLOHMANN_JSON_PASTE59(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE58(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58) +#define NLOHMANN_JSON_PASTE60(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE59(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59) +#define NLOHMANN_JSON_PASTE61(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE60(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60) +#define NLOHMANN_JSON_PASTE62(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE61(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61) +#define NLOHMANN_JSON_PASTE63(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE62(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62) +#define NLOHMANN_JSON_PASTE64(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE63(func, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63) + +#define NLOHMANN_JSON_TO(v1) nlohmann_json_j[#v1] = nlohmann_json_t.v1; +#define NLOHMANN_JSON_FROM(v1) nlohmann_json_j.at(#v1).get_to(nlohmann_json_t.v1); +#define NLOHMANN_JSON_FROM_WITH_DEFAULT(v1) nlohmann_json_t.v1 = !nlohmann_json_j.is_null() ? nlohmann_json_j.value(#v1, nlohmann_json_default_obj.v1) : nlohmann_json_default_obj.v1; + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_INTRUSIVE +@since version 3.9.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE(Type, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT +@since version 3.11.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(Type, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_INTRUSIVE_ONLY_SERIALIZE +@since version 3.11.3 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_INTRUSIVE_ONLY_SERIALIZE(Type, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE +@since version 3.9.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_non_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(Type, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT +@since version 3.11.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_non_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(Type, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE +@since version 3.11.3 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_type_non_intrusive/ +*/ +#define NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE(Type, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE(Type, BaseType, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { nlohmann::from_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_WITH_DEFAULT +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_WITH_DEFAULT(Type, BaseType, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + friend void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { nlohmann::from_json(nlohmann_json_j, static_cast(nlohmann_json_t)); const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_ONLY_SERIALIZE +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_INTRUSIVE_ONLY_SERIALIZE(Type, BaseType, ...) \ + template::value, int> = 0> \ + friend void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE(Type, BaseType, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { nlohmann::from_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_WITH_DEFAULT +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_WITH_DEFAULT(Type, BaseType, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } \ + template::value, int> = 0> \ + void from_json(const BasicJsonType& nlohmann_json_j, Type& nlohmann_json_t) { nlohmann::from_json(nlohmann_json_j, static_cast(nlohmann_json_t)); const Type nlohmann_json_default_obj{}; NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_FROM_WITH_DEFAULT, __VA_ARGS__)) } + +/*! +@brief macro +@def NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE +@since version 3.12.0 +@sa https://json.nlohmann.me/api/macros/nlohmann_define_derived_type/ +*/ +#define NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE_ONLY_SERIALIZE(Type, BaseType, ...) \ + template::value, int> = 0> \ + void to_json(BasicJsonType& nlohmann_json_j, const Type& nlohmann_json_t) { nlohmann::to_json(nlohmann_json_j, static_cast(nlohmann_json_t)); NLOHMANN_JSON_EXPAND(NLOHMANN_JSON_PASTE(NLOHMANN_JSON_TO, __VA_ARGS__)) } + +// inspired from https://stackoverflow.com/a/26745591 +// allows calling any std function as if (e.g., with begin): +// using std::begin; begin(x); +// +// it allows using the detected idiom to retrieve the return type +// of such an expression +#define NLOHMANN_CAN_CALL_STD_FUNC_IMPL(std_name) \ + namespace detail { \ + using std::std_name; \ + \ + template \ + using result_of_##std_name = decltype(std_name(std::declval()...)); \ + } \ + \ + namespace detail2 { \ + struct std_name##_tag \ + { \ + }; \ + \ + template \ + std_name##_tag std_name(T&&...); \ + \ + template \ + using result_of_##std_name = decltype(std_name(std::declval()...)); \ + \ + template \ + struct would_call_std_##std_name \ + { \ + static constexpr auto const value = ::nlohmann::detail:: \ + is_detected_exact::value; \ + }; \ + } /* namespace detail2 */ \ + \ + template \ + struct would_call_std_##std_name : detail2::would_call_std_##std_name \ + { \ + } + +#ifndef JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_USE_IMPLICIT_CONVERSIONS 1 +#endif + +#if JSON_USE_IMPLICIT_CONVERSIONS + #define JSON_EXPLICIT +#else + #define JSON_EXPLICIT explicit +#endif + +#ifndef JSON_DISABLE_ENUM_SERIALIZATION + #define JSON_DISABLE_ENUM_SERIALIZATION 0 +#endif + +#ifndef JSON_USE_GLOBAL_UDLS + #define JSON_USE_GLOBAL_UDLS 1 +#endif + +#if JSON_HAS_THREE_WAY_COMPARISON + #include // partial_ordering +#endif + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/////////////////////////// +// JSON type enumeration // +/////////////////////////// + +/*! +@brief the JSON type enumeration + +This enumeration collects the different JSON types. It is internally used to +distinguish the stored values, and the functions @ref basic_json::is_null(), +@ref basic_json::is_object(), @ref basic_json::is_array(), +@ref basic_json::is_string(), @ref basic_json::is_boolean(), +@ref basic_json::is_number() (with @ref basic_json::is_number_integer(), +@ref basic_json::is_number_unsigned(), and @ref basic_json::is_number_float()), +@ref basic_json::is_discarded(), @ref basic_json::is_primitive(), and +@ref basic_json::is_structured() rely on it. + +@note There are three enumeration entries (number_integer, number_unsigned, and +number_float), because the library distinguishes these three types for numbers: +@ref basic_json::number_unsigned_t is used for unsigned integers, +@ref basic_json::number_integer_t is used for signed integers, and +@ref basic_json::number_float_t is used for floating-point numbers or to +approximate integers which do not fit in the limits of their respective type. + +@sa see @ref basic_json::basic_json(const value_t value_type) -- create a JSON +value with the default value for a given type + +@since version 1.0.0 +*/ +enum class value_t : std::uint8_t +{ + null, ///< null value + object, ///< object (unordered set of name/value pairs) + array, ///< array (ordered collection of values) + string, ///< string value + boolean, ///< boolean value + number_integer, ///< number value (signed integer) + number_unsigned, ///< number value (unsigned integer) + number_float, ///< number value (floating-point) + binary, ///< binary array (ordered collection of bytes) + discarded ///< discarded by the parser callback function +}; + +/*! +@brief comparison operator for JSON types + +Returns an ordering that is similar to Python: +- order: null < boolean < number < object < array < string < binary +- furthermore, each type is not smaller than itself +- discarded values are not comparable +- binary is represented as a b"" string in python and directly comparable to a + string; however, making a binary array directly comparable with a string would + be surprising behavior in a JSON file. + +@since version 1.0.0 +*/ +#if JSON_HAS_THREE_WAY_COMPARISON + inline std::partial_ordering operator<=>(const value_t lhs, const value_t rhs) noexcept // *NOPAD* +#else + inline bool operator<(const value_t lhs, const value_t rhs) noexcept +#endif +{ + static constexpr std::array order = {{ + 0 /* null */, 3 /* object */, 4 /* array */, 5 /* string */, + 1 /* boolean */, 2 /* integer */, 2 /* unsigned */, 2 /* float */, + 6 /* binary */ + } + }; + + const auto l_index = static_cast(lhs); + const auto r_index = static_cast(rhs); +#if JSON_HAS_THREE_WAY_COMPARISON + if (l_index < order.size() && r_index < order.size()) + { + return order[l_index] <=> order[r_index]; // *NOPAD* + } + return std::partial_ordering::unordered; +#else + return l_index < order.size() && r_index < order.size() && order[l_index] < order[r_index]; +#endif +} + +// GCC selects the built-in operator< over an operator rewritten from +// a user-defined spaceship operator +// Clang, MSVC, and ICC select the rewritten candidate +// (see GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105200) +#if JSON_HAS_THREE_WAY_COMPARISON && defined(__GNUC__) +inline bool operator<(const value_t lhs, const value_t rhs) noexcept +{ + return std::is_lt(lhs <=> rhs); // *NOPAD* +} +#endif + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/*! +@brief replace all occurrences of a substring by another string + +@param[in,out] s the string to manipulate; changed so that all + occurrences of @a f are replaced with @a t +@param[in] f the substring to replace with @a t +@param[in] t the string to replace @a f + +@pre The search string @a f must not be empty. **This precondition is +enforced with an assertion.** + +@since version 2.0.0 +*/ +template +inline void replace_substring(StringType& s, const StringType& f, + const StringType& t) +{ + JSON_ASSERT(!f.empty()); + for (auto pos = s.find(f); // find first occurrence of f + pos != StringType::npos; // make sure f was found + s.replace(pos, f.size(), t), // replace with t, and + pos = s.find(f, pos + t.size())) // find next occurrence of f + {} +} + +/*! + * @brief string escaping as described in RFC 6901 (Sect. 4) + * @param[in] s string to escape + * @return escaped string + * + * Note the order of escaping "~" to "~0" and "/" to "~1" is important. + */ +template +inline StringType escape(StringType s) +{ + replace_substring(s, StringType{"~"}, StringType{"~0"}); + replace_substring(s, StringType{"/"}, StringType{"~1"}); + return s; +} + +/*! + * @brief string unescaping as described in RFC 6901 (Sect. 4) + * @param[in] s string to unescape + * @return unescaped string + * + * Note the order of escaping "~1" to "/" and "~0" to "~" is important. + */ +template +static void unescape(StringType& s) +{ + replace_substring(s, StringType{"~1"}, StringType{"/"}); + replace_substring(s, StringType{"~0"}, StringType{"~"}); +} + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // size_t + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +/// struct to capture the start position of the current token +struct position_t +{ + /// the total number of characters read + std::size_t chars_read_total = 0; + /// the number of characters read in the current line + std::size_t chars_read_current_line = 0; + /// the number of lines read + std::size_t lines_read = 0; + + /// conversion to size_t to preserve SAX interface + constexpr operator size_t() const + { + return chars_read_total; + } +}; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-FileCopyrightText: 2018 The Abseil Authors +// SPDX-License-Identifier: MIT + + + +#include // array +#include // size_t +#include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type +#include // index_sequence, make_index_sequence, index_sequence_for + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template +using uncvref_t = typename std::remove_cv::type>::type; + +#ifdef JSON_HAS_CPP_14 + +// the following utilities are natively available in C++14 +using std::enable_if_t; +using std::index_sequence; +using std::make_index_sequence; +using std::index_sequence_for; + +#else + +// alias templates to reduce boilerplate +template +using enable_if_t = typename std::enable_if::type; + +// The following code is taken from https://github.com/abseil/abseil-cpp/blob/10cb35e459f5ecca5b2ff107635da0bfa41011b4/absl/utility/utility.h +// which is part of Google Abseil (https://github.com/abseil/abseil-cpp), licensed under the Apache License 2.0. + +//// START OF CODE FROM GOOGLE ABSEIL + +// integer_sequence +// +// Class template representing a compile-time integer sequence. An instantiation +// of `integer_sequence` has a sequence of integers encoded in its +// type through its template arguments (which is a common need when +// working with C++11 variadic templates). `absl::integer_sequence` is designed +// to be a drop-in replacement for C++14's `std::integer_sequence`. +// +// Example: +// +// template< class T, T... Ints > +// void user_function(integer_sequence); +// +// int main() +// { +// // user_function's `T` will be deduced to `int` and `Ints...` +// // will be deduced to `0, 1, 2, 3, 4`. +// user_function(make_integer_sequence()); +// } +template +struct integer_sequence +{ + using value_type = T; + static constexpr std::size_t size() noexcept + { + return sizeof...(Ints); + } +}; + +// index_sequence +// +// A helper template for an `integer_sequence` of `size_t`, +// `absl::index_sequence` is designed to be a drop-in replacement for C++14's +// `std::index_sequence`. +template +using index_sequence = integer_sequence; + +namespace utility_internal +{ + +template +struct Extend; + +// Note that SeqSize == sizeof...(Ints). It's passed explicitly for efficiency. +template +struct Extend, SeqSize, 0> +{ + using type = integer_sequence < T, Ints..., (Ints + SeqSize)... >; +}; + +template +struct Extend, SeqSize, 1> +{ + using type = integer_sequence < T, Ints..., (Ints + SeqSize)..., 2 * SeqSize >; +}; + +// Recursion helper for 'make_integer_sequence'. +// 'Gen::type' is an alias for 'integer_sequence'. +template +struct Gen +{ + using type = + typename Extend < typename Gen < T, N / 2 >::type, N / 2, N % 2 >::type; +}; + +template +struct Gen +{ + using type = integer_sequence; +}; + +} // namespace utility_internal + +// Compile-time sequences of integers + +// make_integer_sequence +// +// This template alias is equivalent to +// `integer_sequence`, and is designed to be a drop-in +// replacement for C++14's `std::make_integer_sequence`. +template +using make_integer_sequence = typename utility_internal::Gen::type; + +// make_index_sequence +// +// This template alias is equivalent to `index_sequence<0, 1, ..., N-1>`, +// and is designed to be a drop-in replacement for C++14's +// `std::make_index_sequence`. +template +using make_index_sequence = make_integer_sequence; + +// index_sequence_for +// +// Converts a typename pack into an index sequence of the same length, and +// is designed to be a drop-in replacement for C++14's +// `std::index_sequence_for()` +template +using index_sequence_for = make_index_sequence; + +//// END OF CODE FROM GOOGLE ABSEIL + +#endif + +// dispatch utility (taken from ranges-v3) +template struct priority_tag : priority_tag < N - 1 > {}; +template<> struct priority_tag<0> {}; + +// taken from ranges-v3 +template +struct static_const +{ + static JSON_INLINE_VARIABLE constexpr T value{}; +}; + +#ifndef JSON_HAS_CPP_17 + template + constexpr T static_const::value; +#endif + +template +constexpr std::array make_array(Args&& ... args) +{ + return std::array {{static_cast(std::forward(args))...}}; +} + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // numeric_limits +#include // char_traits +#include // tuple +#include // false_type, is_constructible, is_integral, is_same, true_type +#include // declval + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +#include // random_access_iterator_tag + +// #include + +// #include + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN +namespace detail +{ + +template +struct iterator_types {}; + +template +struct iterator_types < + It, + void_t> +{ + using difference_type = typename It::difference_type; + using value_type = typename It::value_type; + using pointer = typename It::pointer; + using reference = typename It::reference; + using iterator_category = typename It::iterator_category; +}; + +// This is required as some compilers implement std::iterator_traits in a way that +// doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. +template +struct iterator_traits +{ +}; + +template +struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> + : iterator_types +{ +}; + +template +struct iterator_traits::value>> +{ + using iterator_category = std::random_access_iterator_tag; + using value_type = T; + using difference_type = ptrdiff_t; + using pointer = T*; + using reference = T&; +}; + +} // namespace detail +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN + +NLOHMANN_CAN_CALL_STD_FUNC_IMPL(begin); + +NLOHMANN_JSON_NAMESPACE_END + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + + + +// #include + + +NLOHMANN_JSON_NAMESPACE_BEGIN + +NLOHMANN_CAN_CALL_STD_FUNC_IMPL(end); + +NLOHMANN_JSON_NAMESPACE_END + +// #include + +// #include + +// #include +// __ _____ _____ _____ +// __| | __| | | | JSON for Modern C++ +// | | |__ | | | | | | version 3.12.0 +// |_____|_____|_____|_|___| https://github.com/nlohmann/json +// +// SPDX-FileCopyrightText: 2013 - 2025 Niels Lohmann +// SPDX-License-Identifier: MIT + +#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ + #define INCLUDE_NLOHMANN_JSON_FWD_HPP_ + + #include // int64_t, uint64_t + #include // map + #include // allocator + #include // string + #include // vector + + // #include + + + /*! + @brief namespace for Niels Lohmann + @see https://github.com/nlohmann + @since version 1.0.0 + */ + NLOHMANN_JSON_NAMESPACE_BEGIN + + /*! + @brief default JSONSerializer template argument + + This serializer ignores the template arguments and uses ADL + ([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)) + for serialization. + */ + template + struct adl_serializer; + + /// a class to store JSON values + /// @sa https://json.nlohmann.me/api/basic_json/ + template class ObjectType = + std::map, + template class ArrayType = std::vector, + class StringType = std::string, class BooleanType = bool, + class NumberIntegerType = std::int64_t, + class NumberUnsignedType = std::uint64_t, + class NumberFloatType = double, + template class AllocatorType = std::allocator, + template class JSONSerializer = + adl_serializer, + class BinaryType = std::vector, // cppcheck-suppress syntaxError + class CustomBaseClass = void> + class basic_json; + + /// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document + /// @sa https://json.nlohmann.me/api/json_pointer/ + template + class json_pointer; + + /*! + @brief default specialization + @sa https://json.nlohmann.me/api/json/ + */ + using json = basic_json<>; + + /// @brief a minimal map-like container that preserves insertion order + /// @sa https://json.nlohmann.me/api/ordered_map/ + template + struct ordered_map; + + /// @brief specialization that maintains the insertion order of object keys + /// @sa https://json.nlohmann.me/api/ordered_json/ + using ordered_json = basic_json; + + NLOHMANN_JSON_NAMESPACE_END + +#endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_ + + +NLOHMANN_JSON_NAMESPACE_BEGIN +/*! +@brief detail namespace with internal helper functions + +This namespace collects functions that should not be exposed, +implementations of some @ref basic_json methods, and meta-programming helpers. + +@since version 2.1.0 +*/ +namespace detail +{ + +///////////// +// helpers // +///////////// + +// Note to maintainers: +// +// Every trait in this file expects a non CV-qualified type. +// The only exceptions are in the 'aliases for detected' section +// (i.e. those of the form: decltype(T::member_function(std::declval()))) +// +// In this case, T has to be properly CV-qualified to constraint the function arguments +// (e.g. to_json(BasicJsonType&, const T&)) + +template struct is_basic_json : std::false_type {}; + +NLOHMANN_BASIC_JSON_TPL_DECLARATION +struct is_basic_json : std::true_type {}; + +// used by exceptions create() member functions +// true_type for pointer to possibly cv-qualified basic_json or std::nullptr_t +// false_type otherwise +template +struct is_basic_json_context : + std::integral_constant < bool, + is_basic_json::type>::type>::value + || std::is_same::value > +{}; + +////////////////////// +// json_ref helpers // +////////////////////// + +template +class json_ref; + +template +struct is_json_ref : std::false_type {}; + +template +struct is_json_ref> : std::true_type {}; + +////////////////////////// +// aliases for detected // +////////////////////////// + +template +using mapped_type_t = typename T::mapped_type; + +template +using key_type_t = typename T::key_type; + +template +using value_type_t = typename T::value_type; + +template +using difference_type_t = typename T::difference_type; + +template +using pointer_t = typename T::pointer; + +template +using reference_t = typename T::reference; + +template +using iterator_category_t = typename T::iterator_category; + +template +using to_json_function = decltype(T::to_json(std::declval()...)); + +template +using from_json_function = decltype(T::from_json(std::declval()...)); + +template +using get_template_function = decltype(std::declval().template get()); + +// trait checking if JSONSerializer::from_json(json const&, udt&) exists +template +struct has_from_json : std::false_type {}; + +// trait checking if j.get is valid +// use this trait instead of std::is_constructible or std::is_convertible, +// both rely on, or make use of implicit conversions, and thus fail when T +// has several constructors/operator= (see https://github.com/nlohmann/json/issues/958) +template +struct is_getable +{ + static constexpr bool value = is_detected::value; +}; + +template +struct has_from_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +// This trait checks if JSONSerializer::from_json(json const&) exists +// this overload is used for non-default-constructible user-defined-types +template +struct has_non_default_from_json : std::false_type {}; + +template +struct has_non_default_from_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +// This trait checks if BasicJsonType::json_serializer::to_json exists +// Do not evaluate the trait when T is a basic_json type, to avoid template instantiation infinite recursion. +template +struct has_to_json : std::false_type {}; + +template +struct has_to_json < BasicJsonType, T, enable_if_t < !is_basic_json::value >> +{ + using serializer = typename BasicJsonType::template json_serializer; + + static constexpr bool value = + is_detected_exact::value; +}; + +template +using detect_key_compare = typename T::key_compare; + +template +struct has_key_compare : std::integral_constant::value> {}; + +// obtains the actual object key comparator +template +struct actual_object_comparator +{ + using object_t = typename BasicJsonType::object_t; + using object_comparator_t = typename BasicJsonType::default_object_comparator_t; + using type = typename std::conditional < has_key_compare::value, + typename object_t::key_compare, object_comparator_t>::type; +}; + +template +using actual_object_comparator_t = typename actual_object_comparator::type; + +///////////////// +// char_traits // +///////////////// + +// Primary template of char_traits calls std char_traits +template +struct char_traits : std::char_traits +{}; + +// Explicitly define char traits for unsigned char since it is not standard +template<> +struct char_traits : std::char_traits +{ + using char_type = unsigned char; + using int_type = uint64_t; + + // Redefine to_int_type function + static int_type to_int_type(char_type c) noexcept + { + return static_cast(c); + } + + static char_type to_char_type(int_type i) noexcept + { + return static_cast(i); + } + + static constexpr int_type eof() noexcept + { + return static_cast(std::char_traits::eof()); + } +}; + +// Explicitly define char traits for signed char since it is not standard +template<> +struct char_traits : std::char_traits +{ + using char_type = signed char; + using int_type = uint64_t; + + // Redefine to_int_type function + static int_type to_int_type(char_type c) noexcept + { + return static_cast(c); + } + + static char_type to_char_type(int_type i) noexcept + { + return static_cast(i); + } + + static constexpr int_type eof() noexcept + { + return static_cast(std::char_traits::eof()); + } +}; + +/////////////////// +// is_ functions // +/////////////////// + +// https://en.cppreference.com/w/cpp/types/conjunction +template struct conjunction : std::true_type { }; +template struct conjunction : B { }; +template +struct conjunction +: std::conditional(B::value), conjunction, B>::type {}; + +// https://en.cppreference.com/w/cpp/types/negation +template struct negation : std::integral_constant < bool, !B::value > { }; + +// Reimplementation of is_constructible and is_default_constructible, due to them being broken for +// std::pair and std::tuple until LWG 2367 fix (see https://cplusplus.github.io/LWG/lwg-defects.html#2367). +// This causes compile errors in e.g. clang 3.5 or gcc 4.9. +template +struct is_default_constructible : std::is_default_constructible {}; + +template +struct is_default_constructible> + : conjunction, is_default_constructible> {}; + +template +struct is_default_constructible> + : conjunction, is_default_constructible> {}; + +template +struct is_default_constructible> + : conjunction...> {}; + +template +struct is_default_constructible> + : conjunction...> {}; + +template +struct is_constructible : std::is_constructible {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_constructible> : is_default_constructible> {}; + +template +struct is_iterator_traits : std::false_type {}; + +template +struct is_iterator_traits> +{ + private: + using traits = iterator_traits; + + public: + static constexpr auto value = + is_detected::value && + is_detected::value && + is_detected::value && + is_detected::value && + is_detected::value; +}; + +template +struct is_range +{ + private: + using t_ref = typename std::add_lvalue_reference::type; + + using iterator = detected_t; + using sentinel = detected_t; + + // to be 100% correct, it should use https://en.cppreference.com/w/cpp/iterator/input_or_output_iterator + // and https://en.cppreference.com/w/cpp/iterator/sentinel_for + // but reimplementing these would be too much work, as a lot of other concepts are used underneath + static constexpr auto is_iterator_begin = + is_iterator_traits>::value; + + public: + static constexpr bool value = !std::is_same::value && !std::is_same::value && is_iterator_begin; +}; + +template +using iterator_t = enable_if_t::value, result_of_begin())>>; + +template +using range_value_t = value_type_t>>; + +// The following implementation of is_complete_type is taken from +// https://blogs.msdn.microsoft.com/vcblog/2015/12/02/partial-support-for-expression-sfinae-in-vs-2015-update-1/ +// and is written by Xiang Fan who agreed to using it in this library. + +template +struct is_complete_type : std::false_type {}; + +template +struct is_complete_type : std::true_type {}; + +template +struct is_compatible_object_type_impl : std::false_type {}; + +template +struct is_compatible_object_type_impl < + BasicJsonType, CompatibleObjectType, + enable_if_t < is_detected::value&& + is_detected::value >> +{ + using object_t = typename BasicJsonType::object_t; + + // macOS's is_constructible does not play well with nonesuch... + static constexpr bool value = + is_constructible::value && + is_constructible::value; +}; + +template +struct is_compatible_object_type + : is_compatible_object_type_impl {}; + +template +struct is_constructible_object_type_impl : std::false_type {}; + +template +struct is_constructible_object_type_impl < + BasicJsonType, ConstructibleObjectType, + enable_if_t < is_detected::value&& + is_detected::value >> +{ + using object_t = typename BasicJsonType::object_t; + + static constexpr bool value = + (is_default_constructible::value && + (std::is_move_assignable::value || + std::is_copy_assignable::value) && + (is_constructible::value && + std::is_same < + typename object_t::mapped_type, + typename ConstructibleObjectType::mapped_type >::value)) || + (has_from_json::value || + has_non_default_from_json < + BasicJsonType, + typename ConstructibleObjectType::mapped_type >::value); +}; + +template +struct is_constructible_object_type + : is_constructible_object_type_impl {}; + +template +struct is_compatible_string_type +{ + static constexpr auto value = + is_constructible::value; +}; + +template +struct is_constructible_string_type +{ + // launder type through decltype() to fix compilation failure on ICPC +#ifdef __INTEL_COMPILER + using laundered_type = decltype(std::declval()); +#else + using laundered_type = ConstructibleStringType; +#endif + + static constexpr auto value = + conjunction < + is_constructible, + is_detected_exact>::value; +}; + +template +struct is_compatible_array_type_impl : std::false_type {}; + +template +struct is_compatible_array_type_impl < + BasicJsonType, CompatibleArrayType, + enable_if_t < + is_detected::value&& + is_iterator_traits>>::value&& +// special case for types like std::filesystem::path whose iterator's value_type are themselves +// c.f. https://github.com/nlohmann/json/pull/3073 + !std::is_same>::value >> +{ + static constexpr bool value = + is_constructible>::value; +}; + +template +struct is_compatible_array_type + : is_compatible_array_type_impl {}; + +template +struct is_constructible_array_type_impl : std::false_type {}; + +template +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t::value >> + : std::true_type {}; + +template +struct is_constructible_array_type_impl < + BasicJsonType, ConstructibleArrayType, + enable_if_t < !std::is_same::value&& + !is_compatible_string_type::value&& + is_default_constructible::value&& +(std::is_move_assignable::value || + std::is_copy_assignable::value)&& +is_detected::value&& +is_iterator_traits>>::value&& +is_detected::value&& +// special case for types like std::filesystem::path whose iterator's value_type are themselves +// c.f. https://github.com/nlohmann/json/pull/3073 +!std::is_same>::value&& +is_complete_type < +detected_t>::value >> +{ + using value_type = range_value_t; + + static constexpr bool value = + std::is_same::value || + has_from_json::value || + has_non_default_from_json < + BasicJsonType, + value_type >::value; +}; + +template +struct is_constructible_array_type + : is_constructible_array_type_impl {}; + +template +struct is_compatible_integer_type_impl : std::false_type {}; + +template +struct is_compatible_integer_type_impl < + RealIntegerType, CompatibleNumberIntegerType, + enable_if_t < std::is_integral::value&& + std::is_integral::value&& + !std::is_same::value >> +{ + // is there an assert somewhere on overflows? + using RealLimits = std::numeric_limits; + using CompatibleLimits = std::numeric_limits; + + static constexpr auto value = + is_constructible::value && + CompatibleLimits::is_integer && + RealLimits::is_signed == CompatibleLimits::is_signed; +}; + +template +struct is_compatible_integer_type + : is_compatible_integer_type_impl {}; + +template +struct is_compatible_type_impl: std::false_type {}; + +template +struct is_compatible_type_impl < + BasicJsonType, CompatibleType, + enable_if_t::value >> +{ + static constexpr bool value = + has_to_json::value; +}; + +template +struct is_compatible_type + : is_compatible_type_impl {}; + +template +struct is_constructible_tuple : std::false_type {}; + +template +struct is_constructible_tuple> : conjunction...> {}; + +template +struct is_json_iterator_of : std::false_type {}; + +template +struct is_json_iterator_of : std::true_type {}; + +template +struct is_json_iterator_of : std::true_type +{}; + +// checks if a given type T is a template specialization of Primary +template