/*
 * 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/.
 */

/**
 * \file    query/context.h
 * \brief   Represents reasoner's solution on [Context](/w/concepts/context)
 *
 * \class xreate::latex::LatexQuery
 */

#ifndef LATEXQUERY_H
#define LATEXQUERY_H

#include "transcendlayer.h"
#include "aux/latereasoning.h"
#include <list>

namespace xreate{
namespace latex{

typedef std::vector<std::string> Demand;

class LatexQuery: public IQuery{
public:
    VNameId LatexParametersOffset;
    
    Demand getFnDemand(const std::string& fnName);
    latereasoning::LateAnnotation getDecision(const std::string& subject, const CodeScope* scopeCaller);
    std::list<Gringo::Symbol> getSubjectDomain(const std::string& subject);
    void init(TranscendLayer* transcend);

private:
    TranscendLayer* __transcend;
    std::map<std::string, Demand> __demand;
    std::map<std::pair<ScopePacked, std::string>, Gringo::Symbol> __decisions;
    std::map<std::pair<ScopePacked, std::string>, latereasoning::LateAnnotation> __decisionsLate;
    std::map<std::string, std::list<Gringo::Symbol>> __domains;
};

}
}

#endif