20,319 research outputs found
Really Natural Linear Indexed Type Checking
Recent works have shown the power of linear indexed type systems for
enforcing complex program properties. These systems combine linear types with a
language of type-level indices, allowing more fine-grained analyses. Such
systems have been fruitfully applied in diverse domains, including implicit
complexity and differential privacy. A natural way to enhance the
expressiveness of this approach is by allowing the indices to depend on runtime
information, in the spirit of dependent types. This approach is used in DFuzz,
a language for differential privacy. The DFuzz type system relies on an index
language supporting real and natural number arithmetic over constants and
variables. Moreover, DFuzz uses a subtyping mechanism to make types more
flexible. By themselves, linearity, dependency, and subtyping each require
delicate handling when performing type checking or type inference; their
combination increases this challenge substantially, as the features can
interact in non-trivial ways. In this paper, we study the type-checking problem
for DFuzz. We show how we can reduce type checking for (a simple extension of)
DFuzz to constraint solving over a first-order theory of naturals and real
numbers which, although undecidable, can often be handled in practice by
standard numeric solvers
Extended macro grammars and stack controlled machines
K-extended basic macro grammars are introduced, where K is any class of languages. The class B(K) of languages generated by such grammars is investigated, together with the class LB(K) of languages generated by the corresponding linear basic grammars. For any full semi-AFL K, B(K) is a full AFL closed under iterated LB(K)-substitution, but not necessarily under substitution. For any machine type D, the stack controlled machine type corresponding to D is introduced, denoted S(D), and the checking-stack controlled machine type CS(D). The data structure of this machine is a stack which controls a pushdown of data structures from D. If D accepts K, then S(D) accepts B(K) and CS(D) accepts LB(K). Thus the classes B(K) are characterized by stack controlled machines and the classes LB(K), i.e., the full hyper-AFLs, by checking-stack controlled machines. A full basic-AFL is a full AFL K such that B(K)C K. Every full basic-AFL is a full hyper-AFL, but not vice versa. The class of OI macro languages (i.e., indexed languages, i.e., nested stack automaton languages) is a full basic-AFL, properly containing the smallest full basic-AFL. The latter is generated by the ultrabasic macro grammars and accepted by the nested stack automata with bounded depth of nesting (and properly contains the stack languages, the ETOL languages, i.e., the smallest full hyper-AFL, and the basic macro languages). The full basic-AFLs are characterized by bounded nested stack controlled machines
zoo: S3 Infrastructure for Regular and Irregular Time Series
zoo is an R package providing an S3 class with methods for indexed totally
ordered observations, such as discrete irregular time series. Its key design
goals are independence of a particular index/time/date class and consistency
with base R and the "ts" class for regular time series. This paper describes
how these are achieved within zoo and provides several illustrations of the
available methods for "zoo" objects which include plotting, merging and
binding, several mathematical operations, extracting and replacing data and
index, coercion and NA handling. A subclass "zooreg" embeds regular time series
into the "zoo" framework and thus bridges the gap between regular and irregular
time series classes in R.Comment: 24 pages, 5 figure
A Galois connection between classical and intuitionistic logics. II: Semantics
Three classes of models of QHC, the joint logic of problems and propositions,
are constructed, including a class of subset/sheaf-valued models that is
related to solutions of some actual problems (such as solutions of algebraic
equations) and combines the familiar Leibniz-Euler-Venn semantics of classical
logic with a BHK-type semantics of intuitionistic logic.
To test the models, we consider a number of principles and rules, which
empirically appear to cover all "sufficiently simple" natural conjectures about
the behaviour of the operators ! and ?, and include two hypotheses put forward
by Hilbert and Kolmogorov, as formalized in the language of QHC. Each of these
turns out to be either derivable in QHC or equivalent to one of only 13
principles and 1 rule, of which 10 principles and 1 rule are conservative over
classical and intuitionistic logics. The three classes of models together
suffice to confirm the independence of these 10 principles and 1 rule, and to
determine the full lattice of implications between them, apart from one
potential implication.Comment: 35 pages. v4: Section 4.6 "Summary" is added at the end of the paper.
v3: Major revision of a half of v2. The results are improved and rewritten in
terms of the meta-logic. The other half of v2 (Euclid's Elements as a theory
over QHC) is expected to make part III after a revisio
- …