Compiling pattern matching to good decision trees

  • Authors:
  • Luc Maranget

  • Affiliations:
  • INRIA, Paris-Rocquencourt, France

  • Venue:
  • Proceedings of the 2008 ACM SIGPLAN workshop on ML
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

We address the issue of compiling ML pattern matching to compact and efficient decisions trees. Traditionally, compilation to decision trees is optimized by (1) implementing decision trees as dags with maximal sharing; (2) guiding a simple compiler with heuristics. We first design new heuristics that are inspired by necessity, a concept from lazy pattern matching that we rephrase in terms of decision tree semantics. Thereby, we simplify previous semantic frameworks and demonstrate a straightforward connection between necessity and decision tree runtime efficiency. We complete our study by experiments, showing that optimizing compilation to decision trees is competitive with the optimizing match compiler of Le Fessant and Maranget (2001).