[Lean Squad] feat(fv): Task 2 — informal spec for CommandLineParseResult.Equals#7918
Merged
Evangelink merged 3 commits intomainfrom Apr 29, 2026
Conversation
Extract a precise informal specification for CommandLineParseResult.Equals, the structural-equality implementation for the command-line parse result type. The spec documents: - 19 properties across 6 groups (null-safety, extensionality, object.Equals consistency, order-sensitivity, Empty-value behaviour, ToolName comparison) - Algorithm walkthrough (O(n·m), pure, no exceptions for null input) - Edge cases: null other, case-sensitive ToolName, order-sensitive errors/options - Lean modelling plan: Option String for nullable, List for collections Next: Task 3 — write ArgumentArity.lean (highest priority Lean target) 🔬 Lean Squad — automated FV agent Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an informal, source-derived specification for Microsoft.Testing.Platform.CommandLine.CommandLineParseResult.Equals, to support the Lean Squad FV workflow and future Lean modelling work.
Changes:
- Introduces a new FV spec markdown document describing
CommandLineParseResult.Equals. - Documents equality properties (null-safety, extensionality, order-sensitivity,
Emptybehavior, ToolName comparison) and an algorithm walkthrough. - Captures Lean modelling notes/approximations for translating the behavior into Lean.
Show a summary per file
| File | Description |
|---|---|
| formal-verification/specs/commandlineparseresult_equals_informal.md | New informal spec for CommandLineParseResult.Equals intended as input to Lean formalisation. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 6
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot's findings
Comments suppressed due to low confidence (1)
formal-verification/specs/commandlineparseresult_equals_informal.md:162
- The statement that
Equalsmodels whether the command line was “exactly the same string” is not accurate for this type: the parser normalizes option prefixes (trims-/--) and may unescape/strip quotes in arguments, so distinct command-line strings can produce equal parse results. Consider rephrasing this as “exactly the same parsed/normalized structure” to match the actual semantics.
The equality is **order-preserving structural equality** over the full parse tree. This mirrors the semantics of a command-line invocation: `--foo bar --baz` is semantically different from `--baz --foo bar` even if both produce option sets that "contain" the same options.
This contrasts with `IsOptionSet` and `TryGetOptionArgumentList`, which are lookup methods that aggregate over all options with a matching name and are case-insensitive. The `Equals` method deliberately models "was the command line *exactly* the same string?", not "do both command lines select the same options?".
- Files reviewed: 1/1 changed files
- Comments generated: 3
…al.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This was referenced Apr 29, 2026
[Lean Squad] feat(fv): Task 2 — informal spec for CommandLineOptionsValidator arity validation
#7999
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extract a precise informal specification for CommandLineParseResult.Equals, the structural-equality implementation for the command-line parse result type.
The spec documents:
Next: Task 3 — write ArgumentArity.lean (highest priority Lean target)
🔬 Lean Squad — automated FV agent
Fixes #7911