Skip to content

proofs(Layer 1.0 follow-up): stripIsIdentityOnStrippedBody — slash-slash closure #113

Description

@hyperpolymath

Context

PR #111 landed the Layer 1.0 foundation for line-comment stripping:

  • stripLineCommentBody + stripLineComments total Idris2 definitions mirroring src/assail/analyzer.rs:931.
  • IsStrippedBody shape predicate + stripBodyProducesStrippedShape lemma (Qed).
  • Base cases of stripLineCommentsIdempotent (empty + non-slash-headed input) (Qed).
  • 3 concrete sanity tests (Refl).

What's open

The slash-slash inductive case of stripLineCommentsIdempotent requires:

stripIsIdentityOnStrippedBody :
    (xs : List Char) -> IsStrippedBody xs ->
    stripLineComments xs = xs

Three constructor cases:

  • StripEmpty → Refl
  • StripJustNl tail → requires a second induction on tail (arbitrary content)
  • StripSpaceCons rest _ → unfold strip on sp + IH

Once that lemma is closed, the slash-slash case of the main theorem is cong (sp :: sp ::) (bodyOutputIdempotent rest).

Acceptance

Refs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions