correctness

Apply Dijkstra's formal methods to derive and verify software correctness.

Updated Feb 17, 2026
One-click install
npx skills add https://github.com/Objective-Arts/lens-dist --skill correctness
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: correctness
Source: https://github.com/Objective-Arts/lens-dist/tree/main/canon/correctness
Command: npx skills add https://github.com/Objective-Arts/lens-dist --skill correctness

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the fundamental limitations of software testing by advocating for mathematical proof of correctness, ensuring reliability in critical systems.

Core Features & Use Cases

  • Formal Methods Principles: Introduces Dijkstra's philosophy on programming as applied mathematics.
  • Structured Programming: Emphasizes the use of sequence, selection, and iteration, and the avoidance of goto.
  • Program Derivation: Explains concepts like weakest preconditions and loop invariants for proving code correctness.
  • Use Case: For a safety-critical system, use this Skill's principles to rigorously derive and verify the logic, ensuring it behaves exactly as specified under all conditions, far beyond what testing alone can guarantee.

Quick Start

Apply Dijkstra's principles to ensure the correctness of your critical code.

Frequently Asked Questions about correctness

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prove code correctness for safety-critical systems instead of just testing?

Prove code correctness for safety-critical systems by applying formal methods and mathematical reasoning to rigorously verify logic, ensuring specified behavior under all conditions. This approach overcomes the fundamental limitations of standard software testing.

What are formal methods in software engineering and when do I need them?

Formal methods in software engineering are mathematical reasoning techniques used to prove program correctness. You need them for safety-critical and security-critical systems where rigorous verification is paramount and testing alone cannot guarantee reliability.

How do I use loop invariants and weakest preconditions for program derivation?

Use loop invariants and weakest preconditions for program derivation by applying Dijkstra's philosophy of programming as applied mathematics. These concepts allow you to mathematically derive and verify structured code logic.

Can I apply structured programming principles to verify security-critical applications?

You can apply structured programming principles to verify security-critical applications by utilizing sequence, selection, and iteration while avoiding goto statements. This enforces simplicity and elegance, which is paramount for rigorous verification.

Why does mathematical proof of correctness matter compared to automated software testing?

Mathematical proof of correctness matters compared to automated software testing because it addresses testing's fundamental limitations. Proving correctness ensures a program behaves exactly as specified under all conditions, far beyond what testing can guarantee.

What are the limitations of formal methods for software verification?

The limitations of formal methods for software verification include a strict requirement for intellectual humility and adherence to principles of simplicity to manage complexity. Rigorous program derivation demands significant mathematical reasoning overhead compared to standard testing.