1 research outputs found
Extending C++ static computation of polynomial-time algorithms
C++ templates were designed to provide generic programming, but they are also capable of performing static computation. It is known that any partial recursive function can be computed at compile time, using the C++ templates to define primitive recursion, composition, and minimalization. It is also known that polynomial-time com
putable functions can be computed statically, using
the same mechanism together with a fine tuning of
template specialization. In this paper, we define a
subset of C++ based on templates and we prove
that it characterizes the polytime functions; compared with the previous ones, our language captures
more algorithms using a restricted version of the
course-of-value recursion