/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * Author: pgess <v.melnychenko@xreate.org>
 * Created on June 23, 2018, 4:33 PM
 */

/**
 * \file    src/compilation/latex.h
 * \brief   Latex(Late Context) support
 */

#include "compilation/latex.h"
#include "analysis/interpretation.h"
#include "llvmlayer.h"

namespace xreate{
namespace latex{

ExpandedType
getSubjectDomain(const std::string& subject, LatexQuery* query){
    std::list<Gringo::Symbol>&& column = query->getSubjectDomain(subject);
    return ExpandedType(interpretation::collapseColumn(column));
}

llvm::Value*
ExtraArgsFnInvocation::operator() (std::vector<llvm::Value *>&& args, const std::string& hintDecl) {
    args.insert(args.end(), __argsLatex.begin(), __argsLatex.end());

    return __parent->operator ()(std::move(args), hintDecl);
}

}
}