# Contextual refinement types

*authors*: Antoine Gaulin, Brigitte Pientka
*year*: 2023
*url*: http://dx.doi.org/10.4204/eptcs.396.2
*publisher*: Open Publishing Association
*year*: 2023
*abstract*: An extension of the proof environment Beluga with datasort refinement types is developed with refinement schemas, which provide fine-grained classification for the structures of contexts and binders and proves the conservativity of the extension. We develop an extension of the proof environment Beluga with datasort refinement types and study its impact on mechanized proofs. In particular, we introduce refinement schemas, which provide fine-grained classification for the structures of contexts and binders. Refinement schemas are helpful in concisely representing certain proofs that rely on relations between contexts. Our formulation of refinements combines the type checking and sort checking phases into one by viewing typing derivations as outputs of sorting derivations. This allows us to cleanly state and prove the conservativity of our extension.