We propose a novel approach to stream definition and manipulation. Our solution is based on two key ideas. Regular corecursion, which avoids non termination by detecting cyclic calls, is enhanced, by allowing in equations defining streams other operators besides the stream constructor. In this way, some non-regular streams are definable. Furthermore, execution includes a runtime check to ensure that the stream generated by a function call is well-defined, in the sense that access to an arbitrary index always succeeds. We extend the technique beyond the simple stream operators considered in previous work, notably by adding an interleaving combinator which has a non-trivial recursion scheme.
翻译:我们建议一种新颖的方法来定义和操纵流。 我们的解决方案基于两个关键理念。 常规核心通过探测循环电话避免不终止,通过在方程式中定义流体除流体构造器外的其他运行者而得到加强。 这样,一些非常规流体是可以定义的。 此外, 执行还包括运行时间检查, 以确保函数呼叫生成的流体定义明确, 即获取任意索引总是成功的。 我们将技术推广到以往工作中考虑的简单流体操作者之外, 特别是增加一个具有非三角循环循环计划的互换组合器 。