Skip to content

Add instanceFormat/certificateFormat declarations to PRIMEFACTOR - #491

Open
Trosper3 wants to merge 3 commits into
CSharpAPIfrom
backfill/primefactor-format
Open

Add instanceFormat/certificateFormat declarations to PRIMEFACTOR#491
Trosper3 wants to merge 3 commits into
CSharpAPIfrom
backfill/primefactor-format

Conversation

@Trosper3

Copy link
Copy Markdown
Contributor

Summary

  • PRIMEFACTOR never adopted the self-describing instance/certificate format pattern (Interfaces/ProblemInterface.cs).
  • Declares instanceFormat (a single integer) and certificateFormat describing the factor-list certificate, on PRIMEFACTOR_Class.cs. Notes that the verifier checks only that the factors' product matches the original number — it does not check that each factor is itself prime.
  • Format-declaration tests follow the existing DFA/NFA_Tests pattern, plus a check that the certificate example quoted in the format string ((3,5)) actually verifies true against defaultInstance via the real verifier.

Closes #446

Test plan

  • dotnet test redux-tests/redux-tests.csproj --filter "FullyQualifiedName~PRIMEFACTOR" — 20/20 passing

Trosper3 and others added 2 commits August 22, 2026 22:26
PRIMEFACTOR never adopted the self-describing instance/certificate
format pattern (Interfaces/ProblemInterface.cs). Declares
instanceFormat (a single integer) and certificateFormat describing the
factor-list certificate, noting the verifier checks only that the
factors' product matches the original number (it does not check that
each factor is itself prime).

Format-declaration tests follow the existing DFA/NFA_Tests pattern,
plus a check that the certificate example quoted in the format string
actually verifies true against defaultInstance.
@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

Redux Build System — CI Report

dotnet · commit 558aca5

Operation Status Summary Time
audit no known vulnerabilities 5.0s
format-check all files formatted 23.6s
lint 0 issues 34.7s
typecheck ⏭️ covered by lint (dotnet build)
unit-test 841 passed · coverage 65% (min 80%) 43.3s
build built local/redux:ci · 234MB 38.7s
integration-test ⏭️ no [integration] command
push ⏭️ not implemented

Overall: ❌ 4 passed · 1 failed · 3 skipped

…attern

Extracts the constructor's inline StringParser grammar into a named
InstanceGrammar const, and adds CertificateGrammar/CertificateExample
consts to PrimeFactorVerifier. instanceFormat/certificateFormat are
now interpolated from these plus _defaultInstance, instead of
hand-duplicated prose.
@Trosper3
Trosper3 requested a review from wrigjl August 31, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backfill instanceFormat/certificateFormat: NPC_PRIMEFACTOR

1 participant