## Inference of User-Defined Type Qualifiers and Qualifier Rules (2006)

Venue: | In Proc. ESOP |

Citations: | 21 - 4 self |

### BibTeX

@INPROCEEDINGS{Chin06inferenceof,

author = {Brian Chin and Shane Markstrum and Todd Millstein and Jens Palsberg},

title = {Inference of User-Defined Type Qualifiers and Qualifier Rules},

booktitle = {In Proc. ESOP},

year = {2006},

pages = {264--278}

}

### OpenURL

### Abstract

Abstract. In previous work, we described a new approach to supporting userdefined type qualifiers, which augment existing types to specify and check additional properties of interest. For each qualifier, users define a set of rules that are enforced during static typechecking of programs. Separately, these rules are automatically validated with respect to a user-defined predicate that formalizes the qualifier’s intended run-time invariant. We instantiated this approach as a framework for user-defined type qualifiers in C programs, called CLARITY. In this paper, we extend our earlier approach by resolving two usability issues. First, we show how to perform qualifier inference in the presence of userdefined rules by generating and solving a system of conditional set constraints, thereby relieving users of the burden of explicitly annotating programs. Second, we show how to automatically infer rules that respect a given user-defined invariant, thereby relieving qualifier designers of the burden of manually producing such rules. We have formalized both qualifier and rule inference and proven their correctness. We have also extended CLARITY to support qualifier and rule inference, and we illustrate their utility in practice through experiments with several type qualifiers and open-source C programs. 1

### Citations

606 | H.: Construction of abstract state graphs with PVS
- Graf, Saidi
- 1997
(Show Context)
Citation Context ...d by a constraint system, qualifier inference in our framework uses a fixed form of constraints but is parameterized by the qualifier rules. Rule inference is related to work on predicate abstraction =-=[9, 1]-=- and on finding the best transformer [12, 13]. These algorithms use decision procedures to precisely abstract a program with respect to a set of predicates. Rule inference is similar, as it produces a... |

399 | Automatic predicate abstraction of c programs
- Ball, Majumdar, et al.
(Show Context)
Citation Context ...d by a constraint system, qualifier inference in our framework uses a fixed form of constraints but is parameterized by the qualifier rules. Rule inference is related to work on predicate abstraction =-=[9, 1]-=- and on finding the best transformer [12, 13]. These algorithms use decision procedures to precisely abstract a program with respect to a set of predicates. Rule inference is similar, as it produces a... |

360 | A.: A Theory of Type Qualifiers
- Foster, Fähndrich, et al.
- 1999
(Show Context)
Citation Context ...esirable to allow programmers to refine existing types in order to specify and check additional program properties. A practical form of refinement can be achieved through user-defined type qualifiers =-=[6, 7]-=-. In previous work [2], we described a new approach to user-defined type qualifiers that is more expressive and provides stronger guarantees than prior approaches. Users provide a set of qualifier rul... |

355 | Simplify: A theorem prover for program checking
- Detlefs, Nelson, et al.
(Show Context)
Citation Context ...es the qualifier. For each case clause, the qualifier validator generates one proof obligation to be discharged. 2 Our implementation discharges obligations with the Simplify automatic theorem prover =-=[5]-=-. 2 We do not validate restrict rules, whose correctness depends on a user-specific notion of run-time error.sInference of User-Defined Type Qualifiers and Qualifier Rules 267 Each proof obligation re... |

173 | Refinement Types for ML
- Freeman, Pfenning
- 1991
(Show Context)
Citation Context ...UAL includes a form of qualifier polymorphism, and follow-on work extended CQUAL’s type system to be flow sensitive [7], while CLARITY currently lacks both of these features. Work on refinement types =-=[8]-=- allows programmers to create subtypes of ML datatype definitions. Intersection types allow a function to have multiple type signatures with varying refinements, playing a role analogous to ourcase ru... |

65 | Intersection types and computational effects
- Davies, Pfenning
- 2000
(Show Context)
Citation Context ...a function to have multiple type signatures with varying refinements, playing a role analogous to ourcase rules. A refinement inference algorithm is provided for a functional subset of ML. Later work =-=[4]-=- considered the interaction of intersection types with computational effects, and recent work extends these ideas to a flow-sensitive setting [10]. These two systems are more powerful than our type qu... |

62 | An effective theory of type refinements
- Mandelbaum, Walker, et al.
- 2003
(Show Context)
Citation Context ... is provided for a functional subset of ML. Later work [4] considered the interaction of intersection types with computational effects, and recent work extends these ideas to a flow-sensitive setting =-=[10]-=-. These two systems are more powerful than our type qualifiers, but they do not support full type inference. HM(X) [11] is a Hindley-Milner-style type inference system that is parameterized by the for... |

58 | Semantic type qualifiers
- Chin, Markstrum, et al.
- 2005
(Show Context)
Citation Context ...mers to refine existing types in order to specify and check additional program properties. A practical form of refinement can be achieved through user-defined type qualifiers [6, 7]. In previous work =-=[2]-=-, we described a new approach to user-defined type qualifiers that is more expressive and provides stronger guarantees than prior approaches. Users provide a set of qualifier rules in a stylized langu... |

52 | Symbolically computing most-precise abstract operations for shape analysis
- Yorsh, Reps, et al.
- 2004
(Show Context)
Citation Context ...ce in our framework uses a fixed form of constraints but is parameterized by the qualifier rules. Rule inference is related to work on predicate abstraction [9, 1] and on finding the best transformer =-=[12, 13]-=-. These algorithms use decision procedures to precisely abstract a program with respect to a set of predicates. Rule inference is similar, as it produces an abstraction automatically from the user-def... |

47 | Type Inference with Constrained Types
- Odersky, Sulzmann, et al.
- 1999
(Show Context)
Citation Context ...ational effects, and recent work extends these ideas to a flow-sensitive setting [10]. These two systems are more powerful than our type qualifiers, but they do not support full type inference. HM(X) =-=[11]-=- is a Hindley-Milner-style type inference system that is parameterized by the form of constraints. Our situation is dual to that one: while HM(X) has a fixed type system that is parameterized by a con... |

32 | Symbolic implementation of the best transformer
- Reps, Sagiv, et al.
- 2004
(Show Context)
Citation Context ...ce in our framework uses a fixed form of constraints but is parameterized by the qualifier rules. Rule inference is related to work on predicate abstraction [9, 1] and on finding the best transformer =-=[12, 13]-=-. These algorithms use decision procedures to precisely abstract a program with respect to a set of predicates. Rule inference is similar, as it produces an abstraction automatically from the user-def... |