axiomatic-semantics
Skill17 starsChanged 9 months agoApache-2.0View on GitHub
Define program meaning through logical assertions and proof rules (Hoare logic).
In this repository98 other files it gives its agents.
- abstract-interpretation-engineSkill
- abstract-machineSkill
- acsl-annotation-assistantSkill
- actor-model-implementerSkill
- algebraic-effectsSkill
- alias-and-points-to-analysisSkill
- bidirectional-type-checkingSkill
- bisimulation-checkerSkill
- capability-systemSkill
- closure-converterSkill
- common-subexpression-eliminatorSkill
- concurrency-verifierSkill
- constant-propagation-passSkill
- contextual-equivalenceSkill
- control-flow-analysisSkill
- coq-proof-assistantSkill
- cps-transformerSkill
- dafny-verifierSkill
- dataflow-analysis-frameworkSkill
- dead-code-eliminatorSkill
- defunctionalizationSkill
- denotational-semantics-builderSkill
- dependent-type-implementerSkill
- dsl-embeddingSkill
- effect-handlers-implementerSkill
- effect-systemSkill
- effect-type-systemSkill
- escape-analysisSkill
- existential-typesSkill
- ffi-designerSkill
- fuzzer-generatorSkill
- gadt-implementerSkill
- garbage-collector-implementerSkill
- graalvm-truffle-implementerSkill
- gradual-typing-implementerSkill
- higher-order-abstract-syntaxSkill
- hoare-logic-verifierSkill
- incremental-computationSkill
- information-flow-analyzerSkill
- inline-expanderSkill
- interprocedural-analysisSkill
- invariant-generatorSkill
- jit-compiler-builderSkill
- lambda-calculus-interpreterSkill
- language-server-protocolSkill
- lean-proverSkill
- lexer-generatorSkill
- linear-type-implementerSkill
- liveness-analysisSkill
- llvm-backend-generatorSkill
- lock-free-data-structureSkill
- loop-optimizerSkill
- loop-termination-proverSkill
- macro-expanderSkill
- memory-allocatorSkill
- message-passing-systemSkill
- mlir-dialect-designerSkill
- model-checkerSkill
- module-systemSkill
- monad-transformerSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 43
Start with the postcondition, work backwards
- Distinctive: line 45
Use Z3 or other SMT solvers for implication checking
- Distinctive: line 84
When operational semantics suffices
- Distinctive: line 86
When automation is required (use model checking)
- Distinctive: line 92
No built-in concurrency reasoning (see separation logic)
- Distinctive: line 174
Solution: Every rule now includes explicit frame conditions.
- Distinctive: line 181
Test generation supplements invariant inference
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Axiomatic Semantics
Axiomatic semantics defines program meaning through logical assertions about program states. Hoare logic, the primary framework, uses triples {P} C {Q} meaning "if P holds before C, then Q holds after C terminates."
When to Use This Skill
- Verifying program correctness
- Designing proof systems
- Teaching formal verification
- Specifying program behavior
- Building verification tools
What This Skill Does
- Assertion Language: Define predicates over program states
- Hoare Triples: Specify pre/post conditions
- Proof Rules: Derive correctness properties
- Weakest Precondition: Compute necessary preconditions
- Loop Invariants: Handle iteration constructs
Key Concepts
| Concept | Description |
| Hoare Triple | {P} C {Q} - precondition, command, postcondition |
| Weakest Precondition | Largest set of states guaranteeing Q after C |
| Loop Invariant | Property holding before, during, and after loop |
| Partial Correctness | If terminates, postcondition holds |
| Total Correctness | Terminates and postcondition holds |
Tips
- Start with the postcondition, work backwards
- Find good loop invariants (the hard part)
- Use Z3 or other SMT solvers for implication checking
- Annotate loops with invariants explicitly
- Total correctness requires termination proofs
Common Use Cases
- Verifying algorithm correctness
- Security proofs
- Compiler correctness
- Teaching formal methods
- Specification languages (JML, ACSL)
Related Skills
hoare-logic-verifier- Verification toolseparation-logician- Memory reasoningsmt-solver-interface- Automated provingoperational-semantics-definer- Operational view
Canonical References
| Reference | Why It Matters |
| Hoare, "An Axiomatic Basis for Computer Programming" (CACM 1969) | Original Hoare logic (Turing Award) |
| Dijkstra, "A Discipline of Programming" (1976) | Weakest preconditions |
| Winskel, "The Formal Semantics of Programming Languages" (1993) | Comprehensive treatment |
Tradeoffs and Limitations
Approach Tradeoffs
| Approach | Pros | Cons |
| Hoare Logic | Compositional, intuitive | Need loop invariants |
| Weakest Precondition | Automatic derivation | Complex expressions |
| Strongest Postcondition | Forward reasoning | Less compositional |
When NOT to Use This Skill
- When operational semantics suffices
- For non-terminating programs (partial vs total)
- When automation is required (use model checking)
Limitations
- Undecidable in general
- Requires loop invariant annotations
- No built-in concurrency reasoning (see separation logic)
Assessment Criteria
A high-quality implementation should have:
| Criterion | What to Look For |
| Soundness | Proven triples are actually valid |
| Completeness | Valid triples can be proven |
| Automation | Uses SMT solver for implications |
| Expressiveness | Handles loops, procedures |
Quality Indicators
✅ Good: Sound proof rules, handles loops, SMT integration ⚠️ Warning: Manual invariant annotation required ❌ Bad: Unsound rules, no loop support
Research Tools & Artifacts
Real-world axiomatic semantics tools to study:
| Tool | Why It Matters |
| Verifast | Verified C programs with separation logic |
| Frama-C (WP) | Industrial-strength C verification |
| Why3 | Platform for deductive verification |
| OpenJML | Java bytecode verification with JML |
| Viper | Verification framework with permission reasoning |
| ACSL (Frama-C) | ANSI/ISO C Specification Language |
Key Verification Systems
- Dafny: Verifiable programs with inline proofs
- F* : Effectful verification with meta-theory
- Coq: Interactive proof with extraction to verified code
- Isabelle/HOL: Generic proof assistant
Research Frontiers
Current active research in axiomatic semantics:
| Direction | Key Papers | Challenge |
| Automation | "From Hoare Logic to Separation Logic" (2018) | Auto-generating loop invariants |
| Fractional permissions | "Fractional Permissions" (2010) | Concurrent read/write sharing |
| Concurrent separation logic | O'Hearn, Brookes "Resources, Concurrency and Local Reasoning" (2004/2007) | Verifying lock-free algorithms |
| Iris | "Higher-Order Ghost State" (2015) | Complex concurrency patterns |
| Relational verification | Benton "Simple Relational Correctness Proofs" (2004) | Proving equivalence of programs |
Hot Topics
- SMT integration: Better theory support for arithmetic
- Horn clauses: Automatic invariant generation
- Learning-based invariants: Using ML to suggest invariants
- Quantum Hoare logic: Verification for quantum programs
Implementation Pitfalls
Common bugs in verification tools:
| Pitfall | Real Example | Prevention |
| Missing frame rule | Frama-C early versions | Explicit frame conditions |
| Unsound loop invariant | ESC/Java missing measures | Check variant/measure |
| Weak memory | Verifiers assuming sequential | Model weak memory explicitly |
| Arithmetic overflow | ACL2 unsoundness case | Bounded arithmetic support |
| Aliasing bugs | Missing permission checks | Always track permissions |
| Incomplete theories | Missing bitvector support | Cover all language features |
The "Frame Rule" Bug
Early separation logic verifiers forgot the frame rule:
// @requires P
// @ensures P * Q
void foo() {
// Could lose Q if not framed!
}Solution: Every rule now includes explicit frame conditions.
Automation vs. Expressiveness Tradeoff
The core tension: more automation → less expressiveness:
- Full separation logic is undecidable
- Bi-abduction finds frame automatically (DISEL, etc.)
- Test generation supplements invariant inference
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

