This paper presents an algorithm for synthesizing recursive functions that process algebraic datatypes. It is founded on proof-theoretic techniques that exploit both type information and input-output examples to prune the search space. The algorithm uses refinement trees, a data structure that succinctly represents constraints on the shape of generated code. We evaluate the algorithm by using a prototype implementation to synthesize more than 40 benchmarks and several non-trivial larger examples. Our results demonstrate that the approach meets or outperforms the state-of-the-art for this domain, in terms of synthesis time or attainable size of the generated programs.
In this paper we study the problem of interoperability -combining constructs from two separate programming languages within one program -in the case where one of the two languages is dependently typed and the other is simply typed. We present a core calculus called SD, which combines dependentlyand simply-typed sub-languages and supports user-defined (dependent) datatypes, among other standard features. SD has "boundary terms" that mediate the interaction between the two sub-languages. The operational semantics of SD demonstrates how the necessary dynamic checks, which must be done when passing a value from the simply-typed world to the dependently typed world, can be extracted from the dependent type constructors themselves, modulo user-defined functions for marshaling values across the boundary. We establish type-safety and other meta-theoretic properties of SD, and contrast this approach to others in the literature. Disciplines Disciplines Engineering Comments CommentsAbstract In this paper we study the problem of interoperability-combining constructs from two separate programming languages within one program-in the case where one of the two languages is dependently typed and the other is simply typed. We present a core calculus called SD, which combines dependentlyand simply-typed sub-languages and supports user-defined (dependent) datatypes, among other standard features. SD has "boundary terms" that mediate the interaction between the two sub-languages. The operational semantics of SD demonstrates how the necessary dynamic checks, which must be done when passing a value from the simply-typed world to the dependently typed world, can be extracted from the dependent type constructors themselves, modulo user-defined functions for marshaling values across the boundary. We establish type-safety and other meta-theoretic properties of SD, and contrast this approach to others in the literature.Lemma 19 (Substitution through types). If Γ T 1 : K and Γ t 2 ∼ = t 2 and y 2 ∈ dom (Γ), then Γ [t 2 /y 2 ]T 1 ≡ [t 2 /y 2 ]T 1 .Proof. Induction on the derivation of Γ, y:T 2 T 1 : K . The cases are Case wf dty arr: The rule looks like Γ T 1 : * Γ, y:T 1 T 2 : * Γ (y : T 1 ) → T 2 : * wf dty arrSince y is a bound variable we can pick it to be different from y 2 and push the substitution in, so we must show Γ (y :By eq dty pi it suffices to show Γ 1 , y :T 2 [t 2 /y 2 ]T 1 ≡ [t 2 /y 2 ]T 1 and Γ 1 [t 2 /y 2 ]T 2 ≡ [t 2 /y 2 ]T 2 , both of which follow by IH (noting again that y 2 = y).Case wf dty pair: Similar to the previous case.Case wf dty data: We must show Γ [t 2 /y 2 ]B ≡ [t 2 /y 2 ]B , that is to say, Γ B ≡ B . This follows by eq dty trefl.Case wf dty unit: Similar to the previous case. 41Case wf dty app: The rule looks like Γ T : T 1 ⇒ * Γ t : T 1 Γ T t : * wf dty app By distributing the substitution and using eq dty app, it suffices to show Γ [t 2 /y 2 ]T ≡ [t 2 /y 2 ]T (which is direct by IH) and Γ [t 2 /y 2 ]t ∼ = [t 2 /y 2 ]t (which is by eq dtm subst).Lemma 20 (Context conversion (types)). Suppose Γ T 1 ≡ T 2 and...
No abstract
No abstract
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Copyright © 2025 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.