## Expressing Polymorphic Types in a Many-Sorted Language (2011)

Citations: | 10 - 1 self |

### BibTeX

@MISC{Bobot11expressingpolymorphic,

author = {François Bobot and Andrei Paskevich},

title = {Expressing Polymorphic Types in a Many-Sorted Language},

year = {2011}

}

### OpenURL

### Abstract

Abstract. In this paper, we study translation from a first-order logic with polymorphic types à la ML (of which we give a formal description) to a many-sorted or one-sorted logic as accepted by mainstream automated theorem provers. We consider a three-stage scheme where the last stage eliminates polymorphic types while adding the necessary “annotations” to preserve soundness, and the first two stages serve to protect certain terms so that they can keep their original unannotated form. This protection allows us to make use of provers ’ built-in theories and operations. We present two existing translation procedures as sound and complete instances of this generic scheme. Our formulation generalizes over the previous ones by allowing us to protect terms of arbitrary monomorphic types. In particular, we can benefit from the built-in theory of arrays in SMT solvers such as Z3, CVC3, and Yices. The proposed methods are implemented in the Why3 tool and we compare their performance in combination with several automated provers. 1

### Citations

718 |
Isabelle/HOL — A Proof Assistant for HigherOrder Logic
- Nipkow, Paulson, et al.
- 2002
(Show Context)
Citation Context ...type-specific instances. Type systems employing polymorphism arise naturally in programming languages and they are a prominent feature of interactive proof assistants such as Coq [17] or Isabelle/HOL =-=[15]-=-. However, a proof task written in a language with polymorphic types is today a difficult subject for automation. This is not because polymorphism handling in a prover is complicated or inefficient pe... |

417 | Z3: An efficient SMT solver
- Moura, Bjørner
- 2008
(Show Context)
Citation Context ...s or booleans, but not instances of polymorphic types, like lists of integers or arrays of reals. Yet decision procedures for such “complex” types are implemented in some SMT solvers; for example, Z3 =-=[14]-=-, CVC3 [2], and Yices [6] have a built-in support for arrays. Secondly, type protection, as defined in [5], cannot be used to protect finite types such as booleans: given an axiom “every boolean is eq... |

62 |
Multi-prover Verification of C Programs
- Filliâtre, Marché
- 2004
(Show Context)
Citation Context ...ed Grd below) closely follows the description given in [10, Sect. 3.0]. We run our tests on 4123 verification conditions generated by the Why platform from 166 programs, which originate from Caduceus =-=[7]-=-, Jessie [12], or directly from Why. Translated tasks were sent to Z3, CVC3, and Yices with a time limit of 60 seconds. On the whole, 3993 proof obligations were proved by at least one prover. The ini... |

49 | First-order proof tactics in higher-order logic theorem provers
- Hurd
- 2003
(Show Context)
Citation Context ...er-variable “type guards” (also known as “relativisation of quantifiers”, see [11] and [10, Sect. 3.0]), to throughout decoration of terms with their types [8, 5], to various flavours of type erasure =-=[9, 13, 10]-=-. The latter method is logicallyinria-00591414, version 4 - 26 Jul 2011 unsound, though adding type annotations can prevent certain unsound inference steps (see [13, Sect. 2.5,2.6] and [10, Sect. 3.1... |

35 | The SMT-LIB standard : Version 2.0
- Barrett, Stump, et al.
- 2010
(Show Context)
Citation Context ...procedure and does not impose any significant overhead. The fact is, advanced type systems have not yet become mainstream in automated deduction: SMT solvers use many-sorted languages such as SMT-LIB =-=[1]-=-, and TPTP provers are content with one-sorted first-order language. Thus, to apply a mainstream prover to a problem expressed in a polymorphic language, we have to translate it into an equivalent mon... |

32 | An LCF-style interface between HOL and first-order logic
- Hurd
- 2002
(Show Context)
Citation Context ...of solutions is known, ranging from adding per-variable “type guards” (also known as “relativisation of quantifiers”, see [11] and [10, Sect. 3.0]), to throughout decoration of terms with their types =-=[8, 5]-=-, to various flavours of type erasure [9, 13, 10]. The latter method is logicallyinria-00591414, version 4 - 26 Jul 2011 unsound, though adding type annotations can prevent certain unsound inference ... |

26 | L.C.: Translating higher-order clauses to first-order clauses
- Meng, Paulson
- 2008
(Show Context)
Citation Context ...er-variable “type guards” (also known as “relativisation of quantifiers”, see [11] and [10, Sect. 3.0]), to throughout decoration of terms with their types [8, 5], to various flavours of type erasure =-=[9, 13, 10]-=-. The latter method is logicallyinria-00591414, version 4 - 26 Jul 2011 unsound, though adding type annotations can prevent certain unsound inference steps (see [13, Sect. 2.5,2.6] and [10, Sect. 3.1... |

25 | Why3: Shepherd your herd of provers
- Bobot, Filliâtre, et al.
- 2011
(Show Context)
Citation Context ...ion can be handled in practice. We conclude by comparing the described techniques in combination with the SMT solvers Z3, CVC3, and Yices [6] on a set of about 4100 proof obligations in the Why3 tool =-=[4]-=- (Section 4).2 First-Order Logic With Polymorphic Types inria-00591414, version 4 - 26 Jul 2011 The logic FOLT, presented below, is an extension of classical first-order manysorted logic. In FOLT, ty... |

24 | A polymorphic intermediate verification language: Design and logical encoding
- Leino, Rümmer
- 2010
(Show Context)
Citation Context ...er-variable “type guards” (also known as “relativisation of quantifiers”, see [11] and [10, Sect. 3.0]), to throughout decoration of terms with their types [8, 5], to various flavours of type erasure =-=[9, 13, 10]-=-. The latter method is logicallyinria-00591414, version 4 - 26 Jul 2011 unsound, though adding type annotations can prevent certain unsound inference steps (see [13, Sect. 2.5,2.6] and [10, Sect. 3.1... |

12 | S.: Handling polymorphism in automated deduction
- Couchot, Lescuyer
- 2007
(Show Context)
Citation Context ...of solutions is known, ranging from adding per-variable “type guards” (also known as “relativisation of quantifiers”, see [11] and [10, Sect. 3.0]), to throughout decoration of terms with their types =-=[8, 5]-=-, to various flavours of type erasure [9, 13, 10]. The latter method is logicallyinria-00591414, version 4 - 26 Jul 2011 unsound, though adding type annotations can prevent certain unsound inference ... |

11 |
A.: Vampire 1.1
- Riazanov, Voronkov
- 2001
(Show Context)
Citation Context ... Indeed, in a monomorphic setting, Theorem 10 comes to: “if every sort admits an infinite domain, then we can safely erase the sort annotations”. Thus, if we want to use a TPTP prover such as Vampire =-=[16]-=- or SPASS [18], we start by translating a proof task to the many-sorted language, using any of the methods described above. Then we eliminate the protected finite sorts (if any) using projections; in ... |

10 | Implementing polymorphism in SMT solvers
- Bobot, Conchon, et al.
- 2008
(Show Context)
Citation Context ...h polymorphic types is today a difficult subject for automation. This is not because polymorphism handling in a prover is complicated or inefficient per se. As was demonstrated by the AltErgo project =-=[3]-=-, this only requires a straightforward extension of the unification procedure and does not impose any significant overhead. The fact is, advanced type systems have not yet become mainstream in automat... |

4 |
Extensions of First-Order Logic, Cambridge Tracts in Theoretical
- Manzano
- 1996
(Show Context)
Citation Context ...ers. We omit the Par transformation (see the remark in the end of Section 3.2) and we add the classical type encoding technique with per-variableinria-00591414, version 4 - 26 Jul 2011 “type guards” =-=[11]-=-. Our implementation of this method (denoted Grd below) closely follows the description given in [10, Sect. 3.0]. We run our tests on 4123 verification conditions generated by the Why platform from 16... |

1 |
A.: Why3: Shepherd your herd of provers. In: Boogie 2011 (co-loc. with CADE-23
- Bobot, Filliâtre, et al.
(Show Context)
Citation Context ...ion can be handled in practice. We conclude by comparing the described techniques in combination with the SMT solvers Z3, CVC3, and Yices [6] on a set of about 4100 proof obligations in the Why3 tool =-=[4]-=- (Section 4).2 First-Order Logic With Polymorphic Types The logic FOLT, presented below, is an extension of classical first-order manysorted logic. In FOLT, types are built from type constants (such ... |