"use strict";
// -*- mode: js; indent-tabs-mode: nil; js-basic-offset: 4 -*-
//
// This file is part of Genie
//
// Copyright 2020 The Board of Trustees of the Leland Stanford Junior University
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: Giovanni Campagna <gcampagn@cs.stanford.edu>
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
// Templates that describe results from a query
const assert_1 = __importDefault(require("assert"));
const thingtalk_1 = require("thingtalk");
const D = __importStar(require("../../dialogue_acts"));
const slot_bag_1 = require("../../slot_bag");
async function default_1($runtime, $ttUtils, $options, $locale, $grammar, $loader) {
    $grammar.declareSymbol("result_name_pair");
    $grammar.addRule("result_name_pair", [new $runtime.NonTerminal("ctx_with_result", undefined), new $runtime.NonTerminal("constant_name", ["value", 0, "id0"]), ",", new $runtime.NonTerminal("constant_name", ["value", 0, "id1"])], ((ctx, n1, $0, n2) => {
        const results = ctx.results;
        assert_1.default(results && results.length >= 2);
        assert_1.default(ctx.resultInfo.idType !== null);
        const r1 = results[0];
        const r2 = results[1];
        if (!r1.value.id.equals(n1)) // can happen if the types are different but the value is the same
            return null;
        if (!r2.value.id.equals(n2))
            return null;
        return { ctx, results: results.slice(0, 2) };
    }), D.nameListKeyFn, {});
    $grammar.declareSymbol("result_name_list");
    $grammar.addRule("result_name_list", [new $runtime.NonTerminal("ctx_with_result", undefined), new $runtime.NonTerminal("constant_name", ["value", 0, "id0"]), new $runtime.Choice(["and", "or"]), new $runtime.NonTerminal("constant_name", ["value", 0, "id1"])], ((ctx, n1, $0, n2) => {
        const results = ctx.results;
        assert_1.default(results && results.length >= 2);
        assert_1.default(ctx.resultInfo.idType !== null);
        const r1 = results[0];
        const r2 = results[1];
        if (!r1.value.id.equals(n1))
            return null;
        if (!r2.value.id.equals(n2))
            return null;
        return { ctx, results: results.slice(0, 2) };
    }), D.nameListKeyFn, { priority: (2) });
    $grammar.addRule("result_name_list", [new $runtime.NonTerminal("result_name_pair", undefined), new $runtime.Choice(["and", "or"]), new $runtime.NonTerminal("constant_name", ["value", 0, "id2"])], ((pair, $0, n3) => {
        const ctx = pair.ctx;
        const results = ctx.results;
        assert_1.default(results && results.length >= 3);
        assert_1.default(ctx.resultInfo.idType !== null);
        const r3 = results[2];
        if (!r3.value.id.equals(n3))
            return null;
        return { ctx, results: results.slice(0, 3) };
    }), D.nameListKeyFn, { priority: (3) });
    $grammar.declareSymbol("direct_result_info_phrase");
    $grammar.addRule("direct_result_info_phrase", [new $runtime.NonTerminal("one_param_direct_result_info_phrase", undefined)], (($0) => { return $0; }), D.resultPhraseKeyFn, { identity: (true) });
    $grammar.addRule("direct_result_info_phrase", [new $runtime.NonTerminal("two_param_direct_result_info_phrase", undefined)], (($0) => { return $0; }), D.resultPhraseKeyFn, { identity: (true) });
    $grammar.addRule("direct_result_info_phrase", [new $runtime.NonTerminal("three_param_direct_result_info_phrase", undefined)], (($0) => { return $0; }), D.resultPhraseKeyFn, { identity: (true) });
    $grammar.declareSymbol("one_param_direct_result_info_phrase");
    $grammar.addRule("one_param_direct_result_info_phrase", [new $runtime.NonTerminal("ctx_with_result", undefined), "the", new $runtime.NonTerminal("out_param_Any", ["functionName", 0, "currentFunction"]), "is", new $runtime.NonTerminal("constant_Any", ["type", 2, "type"])], ((ctx, $0, param, $1, v) => {
        assert_1.default(param.type.equals(v.getType()));
        const bag = new slot_bag_1.SlotBag(param.schema);
        bag.set(param.name, v);
        return D.makeResultPhrase(ctx, bag);
    }), D.resultPhraseKeyFn, {});
    $grammar.addRule("one_param_direct_result_info_phrase", [new $runtime.NonTerminal("ctx_with_result", undefined), "the distance is", new $runtime.NonTerminal("constant_Measure_m", undefined)], ((ctx, $0, v) => {
        const bag = new slot_bag_1.SlotBag(null);
        bag.set('distance', v);
        return D.makeResultPhrase(ctx, bag);
    }), D.resultPhraseKeyFn, {});
    $grammar.declareSymbol("two_param_direct_result_info_phrase");
    $grammar.addRule("two_param_direct_result_info_phrase", [new $runtime.NonTerminal("one_param_direct_result_info_phrase", undefined), "and", new $runtime.NonTerminal("one_param_direct_result_info_phrase", undefined)], ((b1, $0, b2) => D.mergeResultPhrase(b1, b2)), D.resultPhraseKeyFn, {});
    $grammar.declareSymbol("three_param_direct_result_info_phrase");
    $grammar.addRule("three_param_direct_result_info_phrase", [new $runtime.NonTerminal("one_param_direct_result_info_phrase", undefined), ",", new $runtime.NonTerminal("two_param_direct_result_info_phrase", undefined)], ((b1, $0, b2) => D.mergeResultPhrase(b1, b2)), D.resultPhraseKeyFn, {});
    $grammar.declareSymbol("result_info_phrase");
    $grammar.addRule("result_info_phrase", [new $runtime.NonTerminal("one_with_info_phrase", undefined)], (($0) => { return $0; }), D.resultPhraseKeyFn, { weight: (0.33 * 2), priority: (1), identity: (true) });
    $grammar.addRule("result_info_phrase", [new $runtime.NonTerminal("one_which_info_phrase", undefined)], (($0) => { return $0; }), D.resultPhraseKeyFn, { weight: (0.33 * 2), priority: (1), identity: (true) });
    $grammar.addRule("result_info_phrase", [new $runtime.NonTerminal("one_clean_info_phrase", undefined)], (($0) => { return $0; }), D.resultPhraseKeyFn, { weight: (0.33 * 2), priority: (1), identity: (true) });
    $grammar.addRule("result_info_phrase", [new $runtime.NonTerminal("two_with_info_phrase", undefined)], (($0) => { return $0; }), D.resultPhraseKeyFn, { weight: (0.33), priority: (2), identity: (true) });
    $grammar.addRule("result_info_phrase", [new $runtime.NonTerminal("two_which_info_phrase", undefined)], (($0) => { return $0; }), D.resultPhraseKeyFn, { weight: (0.33), priority: (2), identity: (true) });
    $grammar.addRule("result_info_phrase", [new $runtime.NonTerminal("two_clean_info_phrase", undefined)], (($0) => { return $0; }), D.resultPhraseKeyFn, { weight: (0.33), priority: (2), identity: (true) });
    $grammar.addRule("result_info_phrase", [new $runtime.NonTerminal("three_with_info_phrase", undefined)], (($0) => { return $0; }), D.resultPhraseKeyFn, { weight: (0.33 * 0.5), priority: (-1), identity: (true) });
    $grammar.addRule("result_info_phrase", [new $runtime.NonTerminal("three_which_info_phrase", undefined)], (($0) => { return $0; }), D.resultPhraseKeyFn, { weight: (0.33 * 0.5), priority: (-1), identity: (true) });
    $grammar.addRule("result_info_phrase", [new $runtime.NonTerminal("three_clean_info_phrase", undefined)], (($0) => { return $0; }), D.resultPhraseKeyFn, { weight: (0.33 * 0.5), priority: (-1), identity: (true) });
    $grammar.declareSymbol("base_result_phrase");
    $grammar.addRule("base_result_phrase", [new $runtime.NonTerminal("ctx_with_result", undefined), new $runtime.NonTerminal("base_table", ["functionName", 0, "currentFunction"])], ((ctx, table) => {
        assert_1.default(table.schema instanceof thingtalk_1.Ast.FunctionDef);
        return D.makeResultPhrase(ctx, new slot_bag_1.SlotBag(table.schema));
    }), D.resultPhraseKeyFn, {});
    $grammar.declareSymbol("one_with_info_phrase");
    $grammar.addRule("one_with_info_phrase", [new $runtime.NonTerminal("base_result_phrase", undefined), new $runtime.Choice(["with", "having"]), new $runtime.NonTerminal("npp_filter", ["functionName", 0, "functionName"])], ((table, $0, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.declareSymbol("one_which_info_phrase");
    $grammar.addRule("one_which_info_phrase", [new $runtime.NonTerminal("base_result_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("npi_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("one_which_info_phrase", [new $runtime.NonTerminal("base_result_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.NonTerminal("avp_filter", ["functionName", 0, "functionName"])], ((table, $0, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("one_which_info_phrase", [new $runtime.NonTerminal("base_result_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("apv_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, { priority: (-0.1) });
    $grammar.addRule("one_which_info_phrase", [new $runtime.NonTerminal("base_result_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("npv_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.declareSymbol("one_clean_info_phrase");
    $grammar.addRule("one_clean_info_phrase", [new $runtime.NonTerminal("apv_filter", undefined), new $runtime.NonTerminal("base_result_phrase", ["functionName", 0, "functionName"])], ((filter, table) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("one_clean_info_phrase", [new $runtime.NonTerminal("base_result_phrase", undefined), new $runtime.NonTerminal("pvp_filter", ["functionName", 0, "functionName"])], ((table, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("one_clean_info_phrase", [new $runtime.NonTerminal("base_result_phrase", undefined), new $runtime.NonTerminal("preposition_filter", ["functionName", 0, "functionName"])], ((table, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.declareSymbol("two_with_info_phrase");
    $grammar.addRule("two_with_info_phrase", [new $runtime.NonTerminal("one_with_info_phrase", undefined), "and", new $runtime.NonTerminal("npp_filter", ["functionName", 0, "functionName"])], ((table, $0, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("two_with_info_phrase", [new $runtime.NonTerminal("one_which_info_phrase", undefined), new $runtime.Choice(["and having", "and with", ", with"]), new $runtime.NonTerminal("npp_filter", ["functionName", 0, "functionName"])], ((table, $0, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("two_with_info_phrase", [new $runtime.NonTerminal("one_clean_info_phrase", undefined), new $runtime.Choice(["with", "having"]), new $runtime.NonTerminal("npp_filter", ["functionName", 0, "functionName"])], ((table, $0, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("two_with_info_phrase", [new $runtime.NonTerminal("apv_filter", undefined), new $runtime.NonTerminal("base_result_phrase", ["functionName", 0, "functionName"])], ((filter, table) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.declareSymbol("two_which_info_phrase");
    $grammar.addRule("two_which_info_phrase", [new $runtime.NonTerminal("one_with_info_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("npi_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("two_which_info_phrase", [new $runtime.NonTerminal("one_with_info_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.NonTerminal("avp_filter", ["functionName", 0, "functionName"])], ((table, $0, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("two_which_info_phrase", [new $runtime.NonTerminal("one_with_info_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("apv_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, { priority: (-0.1) });
    $grammar.addRule("two_which_info_phrase", [new $runtime.NonTerminal("one_with_info_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("npv_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("two_which_info_phrase", [new $runtime.NonTerminal("one_which_info_phrase", undefined), "and", new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("npi_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("two_which_info_phrase", [new $runtime.NonTerminal("one_which_info_phrase", undefined), "and", new $runtime.NonTerminal("avp_filter", ["functionName", 0, "functionName"])], ((table, $0, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("two_which_info_phrase", [new $runtime.NonTerminal("one_which_info_phrase", undefined), "and", new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("apv_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, { priority: (-0.1) });
    $grammar.addRule("two_which_info_phrase", [new $runtime.NonTerminal("one_which_info_phrase", undefined), "and", new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("npv_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("two_which_info_phrase", [new $runtime.NonTerminal("one_clean_info_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("npi_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("two_which_info_phrase", [new $runtime.NonTerminal("one_clean_info_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.NonTerminal("avp_filter", ["functionName", 0, "functionName"])], ((table, $0, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("two_which_info_phrase", [new $runtime.NonTerminal("one_clean_info_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("apv_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, { priority: (-0.1) });
    $grammar.addRule("two_which_info_phrase", [new $runtime.NonTerminal("one_clean_info_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("npv_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("two_which_info_phrase", [new $runtime.NonTerminal("apv_filter", undefined), new $runtime.NonTerminal("one_which_info_phrase", ["functionName", 0, "functionName"])], ((filter, table) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.declareSymbol("two_clean_info_phrase");
    $grammar.addRule("two_clean_info_phrase", [new $runtime.NonTerminal("apv_filter", undefined), new $runtime.NonTerminal("one_clean_info_phrase", ["functionName", 0, "functionName"])], ((filter, table) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("two_clean_info_phrase", [new $runtime.NonTerminal("one_clean_info_phrase", undefined), new $runtime.NonTerminal("pvp_filter", ["functionName", 0, "functionName"])], ((table, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("two_clean_info_phrase", [new $runtime.NonTerminal("one_clean_info_phrase", undefined), new $runtime.NonTerminal("preposition_filter", ["functionName", 0, "functionName"])], ((table, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.declareSymbol("three_with_info_phrase");
    $grammar.addRule("three_with_info_phrase", [new $runtime.NonTerminal("two_with_info_phrase", undefined), "and", new $runtime.NonTerminal("npp_filter", ["functionName", 0, "functionName"])], ((table, $0, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("three_with_info_phrase", [new $runtime.NonTerminal("two_which_info_phrase", undefined), new $runtime.Choice(["and having", "and with", ", with"]), new $runtime.NonTerminal("npp_filter", ["functionName", 0, "functionName"])], ((table, $0, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("three_with_info_phrase", [new $runtime.NonTerminal("two_clean_info_phrase", undefined), new $runtime.Choice(["with", "having"]), new $runtime.NonTerminal("npp_filter", ["functionName", 0, "functionName"])], ((table, $0, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("three_with_info_phrase", [new $runtime.NonTerminal("apv_filter", undefined), new $runtime.NonTerminal("two_with_info_phrase", ["functionName", 0, "functionName"])], ((filter, table) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.declareSymbol("three_which_info_phrase");
    $grammar.addRule("three_which_info_phrase", [new $runtime.NonTerminal("two_with_info_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("npi_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("three_which_info_phrase", [new $runtime.NonTerminal("two_with_info_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.NonTerminal("avp_filter", ["functionName", 0, "functionName"])], ((table, $0, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("three_which_info_phrase", [new $runtime.NonTerminal("two_with_info_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("apv_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("three_which_info_phrase", [new $runtime.NonTerminal("two_which_info_phrase", undefined), "and", new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("npi_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("three_which_info_phrase", [new $runtime.NonTerminal("two_which_info_phrase", undefined), "and", new $runtime.NonTerminal("avp_filter", ["functionName", 0, "functionName"])], ((table, $0, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("three_which_info_phrase", [new $runtime.NonTerminal("two_which_info_phrase", undefined), "and", new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("apv_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("three_which_info_phrase", [new $runtime.NonTerminal("two_clean_info_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("npi_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("three_which_info_phrase", [new $runtime.NonTerminal("two_clean_info_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.NonTerminal("avp_filter", ["functionName", 0, "functionName"])], ((table, $0, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("three_which_info_phrase", [new $runtime.NonTerminal("two_clean_info_phrase", undefined), new $runtime.Choice(["which", "that"]), new $runtime.Choice(["is", "are"]), new $runtime.NonTerminal("apv_filter", ["functionName", 0, "functionName"])], ((table, $0, $1, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("three_which_info_phrase", [new $runtime.NonTerminal("apv_filter", undefined), new $runtime.NonTerminal("two_which_info_phrase", ["functionName", 0, "functionName"])], ((filter, table) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.declareSymbol("three_clean_info_phrase");
    $grammar.addRule("three_clean_info_phrase", [new $runtime.NonTerminal("apv_filter", undefined), new $runtime.NonTerminal("two_clean_info_phrase", ["functionName", 0, "functionName"])], ((filter, table) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("three_clean_info_phrase", [new $runtime.NonTerminal("two_clean_info_phrase", undefined), new $runtime.NonTerminal("pvp_filter", ["functionName", 0, "functionName"])], ((table, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
    $grammar.addRule("three_clean_info_phrase", [new $runtime.NonTerminal("two_clean_info_phrase", undefined), new $runtime.NonTerminal("preposition_filter", ["functionName", 0, "functionName"])], ((table, filter) => D.addSlotToResultPhrase(table, filter)), D.resultPhraseKeyFn, {});
}
exports.default = default_1;
;
//# sourceMappingURL=results.genie.js.map