refinement-type-checker

Verify code properties and contracts using refinement types with Z3 solver.

17|2|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/rainoftime/pl-skills --skill refinement-type-checker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refinement-type-checker
Source: https://github.com/rainoftime/pl-skills/tree/main/refinement-type-checker
Command: npx skills add https://github.com/rainoftime/pl-skills --skill refinement-type-checker

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires z3, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables the verification of code properties and contracts by refining standard types with logical predicates, acting as a lighter alternative to full dependent types.

Core Features & Use Cases

  • Property Verification: Ensure code adheres to specific mathematical or logical properties.
  • Contract Checking: Enforce pre- and post-conditions for functions.
  • Dependent Types Lite: Provides a subset of dependent type system features for enhanced type safety.
  • Use Case: Guarantee that a function always returns a non-negative integer, or that a list passed to a sorting function is indeed sorted.

Quick Start

Use the refinement-type-checker skill to verify that a given integer expression is greater than zero.

Frequently Asked Questions about refinement-type-checker

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

FAQPage Schema
How do I verify code properties using refinement types?

Refinement types verify code properties by attaching logical predicates to standard types. This Skill checks pre- and post-conditions by passing your predicates to the Z3 SMT solver for automated subtyping evaluation.

What is the difference between dependent types and refinement types for contract checking?

Refinement types offer a lighter alternative to full dependent types for contract checking. They provide a dependent type-lite subset that enforces mathematical properties via SMT solvers rather than requiring a fully dependent type system.

How do I enforce function pre and post-conditions with an SMT solver?

You enforce function pre- and post-conditions by defining logical predicates for your types. The Skill utilizes the Z3 SMT solver to evaluate these predicates and automatically verify that your code adheres to the specified contracts.

Do I need Python and Z3 to use this refinement type checker?

Yes, you need both Python and the Z3 solver to use this refinement type checker. Python runs the verification scripts, while Z3 acts as the underlying SMT solver required for predicate evaluation and subtyping checks.

Can I guarantee a function returns a non-negative integer using property verification?

Yes, property verification can guarantee a function returns a non-negative integer. You refine the return type with a logical predicate like greater than zero, and the Z3 solver proves the function output always satisfies this condition.

What are the limitations of using dependent type-lite features for program analysis?

Dependent type-lite features limit program analysis to properties expressible as logical predicates solvable by Z3. It is a lighter alternative to full dependent types, meaning highly complex or undecidable mathematical constraints may not verify successfully.