subtyping-verifier

Verify structural and nominal subtyping relations for records and functions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity of ensuring type safety and correctness in programming language implementations by providing a robust mechanism to verify subtyping relationships.

Core Features & Use Cases

  • Subtyping Rule Verification: Checks structural and nominal subtyping rules, including width and depth subtyping for records.
  • Polymorphism Support: Handles subtyping checks for polymorphic types and function variance (contravariance, covariance).
  • Use Case: When developing a new programming language or extending an existing one, this skill can be used to automatically verify that the language's subtyping rules are consistently applied, preventing type errors and ensuring soundness.

Quick Start

Use the subtyping verifier to check if the type TRecord({'x': TInt(), 'y': TInt()}) is a subtype of TRecord({'x': TInt()}).

Frequently Asked Questions about subtyping-verifier

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

FAQPage Schema
How do I verify subtyping relations for records in a type system?

To verify subtyping relations for records, you check structural subtyping rules, specifically width and depth subtyping, to ensure a record with more fields is a valid subtype of one with fewer fields.

What is structural subtyping and how does it differ from nominal subtyping?

Structural subtyping verifies type compatibility based on the underlying structure or fields of types, whereas nominal subtyping checks relationships based on explicitly declared type names and hierarchies.

How do I check function variance and polymorphism when verifying type safety?

To check function variance and polymorphism, you verify contravariance in function parameters and covariance in return types, ensuring polymorphic types maintain soundness during subtyping checks.

Do I need to define type constructors before checking type safety proofs?

Yes, you must define type constructors and implement base and structural subtyping rules before verifying type safety proofs and polymorphism checks in programming language implementations.

Can I use this to automatically check subtyping rules when extending a programming language?

Yes, you can automatically verify that a programming language's subtyping rules are consistently applied, preventing type errors and ensuring type soundness during language extension or implementation.

What are the limitations of automated subtyping verification for polymorphic types?

Automated subtyping verification requires explicit definitions of type constructors and structural rules; it cannot infer subtyping relationships for polymorphic types without pre-configured base and structural subtyping logic.