#include <BasicEnumeration.h>
◆ BasicEnumeration()
template<typename Grammar_t >
◆ toInteger()
template<typename Grammar_t >
◆ toNode() [1/3]
template<typename Grammar_t >
This is a handy function to enumerate trees produced by the grammar. This works by encoding each tree into an integer using some "pairing functions" (see https://arxiv.org/pdf/1706.04129.pdf) Specifically, here is how we encode a tree: if it's a terminal, encode the index of the terminal in the grammar. If it's a nonterminal, encode the rule with a modular pairing function and then use Rosenberg-Strong encoding to encode each of the children. In this way, we can make a 1-1 pairing between trees and integers, and therefore store trees as integers in a reversible way as well as enumerate by giving this integers.
◆ toNode() [2/3]
template<typename Grammar_t >
◆ toNode() [3/3]
template<typename Grammar_t >
◆ grammar
template<typename Grammar_t >
The documentation for this class was generated from the following file: