Skip to content

[Lean Squad] feat(fv): Task 2 — informal spec for CommandLineParseResult.Equals#7918

Merged
Evangelink merged 3 commits intomainfrom
lean-squad/task2-parseresult-equals-spec-2026-04-29-87fea4e2e7e10b8d
Apr 29, 2026
Merged

[Lean Squad] feat(fv): Task 2 — informal spec for CommandLineParseResult.Equals#7918
Evangelink merged 3 commits intomainfrom
lean-squad/task2-parseresult-equals-spec-2026-04-29-87fea4e2e7e10b8d

Conversation

@Evangelink
Copy link
Copy Markdown
Member

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

Fixes #7911

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>
Copilot AI review requested due to automatic review settings April 29, 2026 04:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, Empty behavior, 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

Comment thread formal-verification/specs/commandlineparseresult_equals_informal.md Outdated
Comment thread formal-verification/specs/commandlineparseresult_equals_informal.md Outdated
Comment thread formal-verification/specs/commandlineparseresult_equals_informal.md
Comment thread formal-verification/specs/commandlineparseresult_equals_informal.md Outdated
Comment thread formal-verification/specs/commandlineparseresult_equals_informal.md Outdated
Comment thread formal-verification/specs/commandlineparseresult_equals_informal.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 29, 2026 05:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

Comments suppressed due to low confidence (1)

formal-verification/specs/commandlineparseresult_equals_informal.md:162

  • The statement that Equals models 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

Comment thread formal-verification/specs/commandlineparseresult_equals_informal.md
Comment thread formal-verification/specs/commandlineparseresult_equals_informal.md
Comment thread formal-verification/specs/commandlineparseresult_equals_informal.md Outdated
…al.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 29, 2026 05:14
@Evangelink Evangelink enabled auto-merge (squash) April 29, 2026 05:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread formal-verification/specs/commandlineparseresult_equals_informal.md
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.

[Lean Squad] feat(fv): Task 2 — informal spec for CommandLineParseResult.Equals

2 participants