Programming Languages (cs.PL)

  • PDF
    In this paper, we import tensor index notation including Einstein summation notation into programming by introducing two kinds of functions, tensor functions and scalar functions. Tensor functions are functions that contract the tensors given as an argument, and scalar functions are the others. As with ordinary functions, when a tensor function obtains a tensor as an argument, the tensor function treats the tensor as it is as a tensor. On the other hand, when a scalar function obtains a tensor as an argument, the scalar function is applied to each component of the tensor. This paper shows that, by introducing these two kinds of functions, index notation can be imported into whole programming, that means we can use index notation for arbitrary functions, without requiring annoying description to enable each function to handle tensors. This method can be applied to arbitrary programming languages.
  • PDF
    We present a novel algorithm that synthesizes imperative programs for introductory programming courses. Given a set of input-output examples and a partial program, our algorithm generates a complete program that is consistent with every example. Our key idea is to combine enumerative program synthesis and static analysis, which aggressively prunes out a large search space while guaranteeing to find, if any, a correct solution. We have implemented our algorithm in a tool, called SIMPL, and evaluated it on 30 problems used in introductory programming courses. The results show that SIMPL is able to solve the benchmark problems in 6.6 seconds on average.