Memoization

Finite memoization partition fitness. A key collision is valid only when prefixes have the same residual language. Each mismatch costs 100000, more than the total number of states in any bundled finite corpus.
Imports
open Seq; open Pair;
Table of Contents

Functions

collisions

def collisions (key : Int) (label : Int) (seen : (Seq (Pair Int Int))) : Int

containsKey

def containsKey (key : Int) (seen : (Seq (Pair Int Int))) : Bool

scoreAcc

def scoreAcc (candidate : (prefix : (Seq Int)) → Int) (cases : (Seq (Pair (Seq Int) Int))) (seen : (Seq (Pair Int Int))) : Int

partitionScore

def partitionScore (candidate : (prefix : (Seq Int)) → Int) (cases : (Seq (Pair (Seq Int) Int))) : Int