Commit 40915483 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

Updates to cpr submodule to get unix-socket support for curl. adding quilc...


Updates to cpr submodule to get unix-socket support for curl. adding quilc compiler leveraging curl calls to docker engine

Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent ac0a684e
Pipeline #101837 passed with stage
in 70 minutes and 53 seconds
......@@ -3,6 +3,55 @@ Extensions
Here we detail concrete implementations of various XACC interfaces as well as any
input parameters they expose.
Compilers
---------
xasm
++++
The XASM Compiler is the default compiler in XACC. It is the closest language to the underlying
XACC IR data model. The XASM compiler provides a quantum assembly like language with support
for custom Instructions and Composite Instruction generators as part of the language. Instructions
are provided to the language via the usual XACC service registry. Most common digital gates are provided
by default, and it is straightforward to add new Instructions.
quilc
++++++
XACC provides a Compiler implementation that delegates to the Rigetti-developed
quilc compiler. This is acheieved through the ``rigetti/quilc`` Docker image and
the internal XACC REST client API. The Quilc Compiler implementation makes direct
REST POSTs and GETs to the users local Docker Engine. Therefore,
in order to use this Compiler, you must pull down this image.
.. code:: bash
$ docker pull rigetti/quilc
With that image pulled, you can now use the Quilc compiler via the usual XACC API calls.
.. code:: cpp
auto compiler = xacc::getCompiler("quilc");
auto ir = compiler->compile(R"##(H 0
CNOT 0 1
)##");
std::cout << ir->getComposites()[0]->toString() << "\n";
or in Python
.. code:: python
compiler = xacc.getCompiler('quilc')
ir = compiler.compile('''__qpu__ void ansatz(qbit q, double x) {
X 0
CNOT 1 0
RY(x) 1
}''')
Note that you can structure your input to the compiler as a typical XACC kernel source string
or as a raw Quil string.
Optimizers
----------
XACC provides implementations for the ``Optimizer`` that delegate to NLOpt and MLPack. Here we demonstrate
......
......@@ -12,6 +12,7 @@
*******************************************************************************/
#include "Gate.hpp"
#include "xacc.hpp"
#include "xacc_service.hpp"
namespace xacc {
namespace quantum {
......@@ -27,8 +28,8 @@ Gate::Gate(std::string name, std::vector<std::size_t> qubts,
std::vector<InstructionParameter> params)
: gateName(name), qbits(qubts), parameters(params) {}
Gate::Gate(const Gate &inst)
: gateName(inst.gateName), qbits(inst.qbits), parameters(inst.parameters), arguments(inst.arguments),
enabled(inst.enabled) {}
: gateName(inst.gateName), qbits(inst.qbits), parameters(inst.parameters),
arguments(inst.arguments), enabled(inst.enabled) {}
const std::string Gate::name() const { return gateName; }
const std::string Gate::description() const {
......@@ -39,9 +40,10 @@ std::string Gate::getBufferName(const std::size_t bitIdx) {
return bitIdx < buffer_names.size() ? buffer_names[bitIdx] : "q";
}
void Gate::setBufferNames(const std::vector<std::string> bufferNamesPerIdx) {
void Gate::setBufferNames(const std::vector<std::string> bufferNamesPerIdx) {
if (bufferNamesPerIdx.size() != this->nRequiredBits()) {
xacc::error("Invalid number of buffer names for this instruction: " +name() + ", " + std::to_string(bufferNamesPerIdx.size()));
xacc::error("Invalid number of buffer names for this instruction: " +
name() + ", " + std::to_string(bufferNamesPerIdx.size()));
}
buffer_names = bufferNamesPerIdx;
}
......@@ -69,7 +71,8 @@ const std::string Gate::toString() {
int counter = 0;
for (auto q : bits()) {
str += (buffer_names.empty() ? "q" : buffer_names[counter]) + std::to_string(q) + ",";
str += (buffer_names.empty() ? "q" : buffer_names[counter]) +
std::to_string(q) + ",";
counter++;
}
......@@ -86,8 +89,8 @@ void Gate::enable() { enabled = true; }
const InstructionParameter Gate::getParameter(const std::size_t idx) const {
if (idx + 1 > parameters.size()) {
XACCLogger::instance()->error(
"Invalid Parameter requested from Parameterized Gate ("+name()+") Instruction: " +
std::to_string(idx) + ".");
"Invalid Parameter requested from Parameterized Gate (" + name() +
") Instruction: " + std::to_string(idx) + ".");
}
return parameters[idx];
......@@ -96,8 +99,8 @@ const InstructionParameter Gate::getParameter(const std::size_t idx) const {
void Gate::setParameter(const std::size_t idx, InstructionParameter &p) {
if (idx + 1 > parameters.size()) {
XACCLogger::instance()->error(
"Invalid Parameter being set in Parameterized Gate ("+name() +") Instruction: " +
std::to_string(idx) + ".");
"Invalid Parameter being set in Parameterized Gate (" + name() +
") Instruction: " + std::to_string(idx) + ".");
}
parameters[idx] = p;
......@@ -105,6 +108,36 @@ void Gate::setParameter(const std::size_t idx, InstructionParameter &p) {
std::vector<InstructionParameter> Gate::getParameters() { return parameters; }
void Gate::applyRuntimeArguments() {
if (!parsingUtil) {
parsingUtil = xacc::getService<ExpressionParsingUtil>("exprtk");
}
for (auto &kv : arguments) {
if (kv.second->type.find("std::vector<double>") != std::string::npos) {
parameters[kv.first] = kv.second->runtimeValue.get<std::vector<double>>(
INTERNAL_ARGUMENT_VALUE_KEY)[param_idx_to_vector_idx[kv.first]];
} else {
double val;
auto orig = parameters[kv.first].getOriginalExpression();
// std::cout << parameters[kv.first].toString() << ", "
// << parameters[kv.first].getOriginalExpression() << ", "
// << kv.second->name << ", " << kv.second->runtimeValue.get<double>(
// INTERNAL_ARGUMENT_VALUE_KEY) << "\n";
if (parsingUtil->evaluate(orig, {kv.second->name},
{kv.second->runtimeValue.get<double>(
INTERNAL_ARGUMENT_VALUE_KEY)},
val)) {
parameters[kv.first] = val;
parameters[kv.first].storeOriginalExpression(orig);
} else {
parameters[kv.first] =
kv.second->runtimeValue.get<double>(INTERNAL_ARGUMENT_VALUE_KEY);
}
}
}
}
bool Gate::isParameterized() { return nParameters() > 0; }
const int Gate::nParameters() { return parameters.size(); }
......
......@@ -16,6 +16,7 @@
#include "Instruction.hpp"
#include "Cloneable.hpp"
#include "Utils.hpp"
#include "expression_parsing_util.hpp"
namespace xacc {
namespace quantum {
......@@ -25,6 +26,8 @@ namespace quantum {
class Gate : public Instruction {
protected:
std::shared_ptr<ExpressionParsingUtil> parsingUtil;
std::string gateName;
std::vector<std::size_t> qbits;
bool enabled = true;
......@@ -66,18 +69,7 @@ public:
param_idx_to_vector_idx.insert({idx_1, idx_2});
}
void applyRuntimeArguments() override {
for (auto &kv : arguments) {
if (kv.second->type.find("std::vector<double>") != std::string::npos) {
parameters[kv.first] = kv.second->runtimeValue.get<std::vector<double>>(
INTERNAL_ARGUMENT_VALUE_KEY)[param_idx_to_vector_idx[kv.first]];
} else {
parameters[kv.first] =
kv.second->runtimeValue.get<double>(INTERNAL_ARGUMENT_VALUE_KEY);
}
}
}
void applyRuntimeArguments() override;
const std::vector<std::size_t> bits() override;
void setBits(const std::vector<std::size_t> bits) override { qbits = bits; }
std::string getBufferName(const std::size_t bitIdx) override;
......
......@@ -79,3 +79,5 @@ message(
STATUS "${BoldGreen}Building QCS Accelerator.${ColorReset}")
#add_subdirectory(qcs)
endif()
add_subdirectory(quilc)
\ No newline at end of file
......@@ -130,6 +130,7 @@ expression:
| <assoc = right> expression POWER expression # powerExp
| expression (TIMES | DIVIDE) expression # mulDivExp
| expression (PLUS | MINUS) expression # addSubExp
| expression LBRACKET expression RBRACKET # variablewithbracket
| function LPAREN expression RPAREN # functionExp
| segment # segmentExp
| number # numberExp
......
......@@ -59,7 +59,7 @@ bool QuilCompiler::canParse(const std::string &src) {
}
std::shared_ptr<IR> QuilCompiler::compile(const std::string &src,
std::shared_ptr<Accelerator> acc) {
std::cout << "SRC: " << src << "\n";
ANTLRInputStream input(src);
QuilLexer lexer(&input);
CommonTokenStream tokens(&lexer);
......
......@@ -91,20 +91,44 @@ void QuilToXACCListener::exitGate(quil::QuilParser::GateContext *ctx) {
xacc::debug("[XasmCompiler] Parameter added is " + std::to_string(value));
params.emplace_back(value);
} else {
xacc::debug("[XasmCompiler] Parameter added is " + ctx->param(i)->getText());
params.emplace_back(ctx->param(i)->getText());
xacc::debug("[XasmCompiler] Parameter added is " +
ctx->param(i)->getText());
InstructionParameter p(ctx->param(i)->getText());
p.storeOriginalExpression();
params.emplace_back(p);
// This depends on a function argument
auto arg = function->getArgument(ctx->param(i)->getText());
args.insert({i,arg});
if (!arg) {
// we may have a case where the parameter is an expression string,
// maybe something like 1.0 * theta[0]
for (auto &_arg : function->getArguments()) {
auto param_str = ctx->param(i)->getText();
param_str.erase(std::remove_if(param_str.begin(), param_str.end(),
[](char c) {
return !std::isalpha(c) ||
c == '[' || c == ']';
}),
param_str.end());
// std::cout << "PARAMSTR: " << param_str << "\n";
double val;
if (parsingUtil->validExpression(param_str, {_arg->name})) {
arg = _arg;
break;
}
}
}
args.insert({i, arg});
}
}
std::shared_ptr<xacc::Instruction> instruction =
gateRegistry->createInstruction(gateName, qubits, params);
for (auto& kv : args) instruction->addArgument(kv.second, kv.first);
for (auto &kv : args)
instruction->addArgument(kv.second, kv.first);
function->addInstruction(instruction);
}
......
......@@ -180,4 +180,4 @@ realN
atn:
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 64, 463, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 108, 10, 3, 12, 3, 14, 3, 111, 11, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 5, 4, 120, 10, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 132, 10, 6, 3, 6, 3, 6, 5, 6, 136, 10, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 145, 10, 6, 3, 6, 3, 6, 5, 6, 149, 10, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 155, 10, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 5, 8, 162, 10, 8, 3, 8, 3, 8, 7, 8, 166, 10, 8, 12, 8, 14, 8, 169, 11, 8, 3, 8, 3, 8, 3, 9, 5, 9, 174, 10, 9, 3, 9, 6, 9, 177, 10, 9, 13, 9, 14, 9, 178, 3, 9, 7, 9, 182, 10, 9, 12, 9, 14, 9, 185, 11, 9, 3, 9, 7, 9, 188, 10, 9, 12, 9, 14, 9, 191, 11, 9, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 197, 10, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 5, 11, 213, 10, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 7, 12, 220, 10, 12, 12, 12, 14, 12, 223, 11, 12, 3, 12, 3, 12, 5, 12, 227, 10, 12, 3, 12, 6, 12, 230, 10, 12, 13, 12, 14, 12, 231, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 7, 16, 246, 10, 16, 12, 16, 14, 16, 249, 11, 16, 3, 16, 3, 16, 5, 16, 253, 10, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 7, 18, 265, 10, 18, 12, 18, 14, 18, 268, 11, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 7, 19, 276, 10, 19, 12, 19, 14, 19, 279, 11, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 7, 20, 287, 10, 20, 12, 20, 14, 20, 290, 11, 20, 3, 20, 3, 20, 5, 20, 294, 10, 20, 3, 20, 7, 20, 297, 10, 20, 12, 20, 14, 20, 300, 11, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 5, 22, 310, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 317, 10, 23, 12, 23, 14, 23, 320, 11, 23, 3, 23, 3, 23, 5, 23, 324, 10, 23, 3, 23, 6, 23, 327, 10, 23, 13, 23, 14, 23, 328, 3, 24, 3, 24, 5, 24, 333, 10, 24, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 339, 10, 25, 12, 25, 14, 25, 342, 11, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 5, 26, 350, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 6, 28, 357, 10, 28, 13, 28, 14, 28, 358, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 7, 41, 399, 10, 41, 12, 41, 14, 41, 402, 11, 41, 3, 41, 5, 41, 405, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 5, 43, 426, 10, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 7, 43, 437, 10, 43, 12, 43, 14, 43, 440, 11, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 5, 47, 456, 10, 47, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 2, 3, 84, 50, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 2, 10, 4, 2, 7, 7, 42, 42, 3, 2, 26, 28, 3, 2, 29, 32, 3, 2, 45, 46, 3, 2, 42, 43, 3, 2, 40, 41, 3, 2, 35, 39, 3, 2, 46, 47, 2, 477, 2, 98, 3, 2, 2, 2, 4, 100, 3, 2, 2, 2, 6, 117, 3, 2, 2, 2, 8, 123, 3, 2, 2, 2, 10, 154, 3, 2, 2, 2, 12, 156, 3, 2, 2, 2, 14, 158, 3, 2, 2, 2, 16, 173, 3, 2, 2, 2, 18, 196, 3, 2, 2, 2, 20, 212, 3, 2, 2, 2, 22, 214, 3, 2, 2, 2, 24, 233, 3, 2, 2, 2, 26, 235, 3, 2, 2, 2, 28, 237, 3, 2, 2, 2, 30, 239, 3, 2, 2, 2, 32, 258, 3, 2, 2, 2, 34, 266, 3, 2, 2, 2, 36, 271, 3, 2, 2, 2, 38, 280, 3, 2, 2, 2, 40, 305, 3, 2, 2, 2, 42, 309, 3, 2, 2, 2, 44, 311, 3, 2, 2, 2, 46, 332, 3, 2, 2, 2, 48, 340, 3, 2, 2, 2, 50, 346, 3, 2, 2, 2, 52, 351, 3, 2, 2, 2, 54, 356, 3, 2, 2, 2, 56, 360, 3, 2, 2, 2, 58, 363, 3, 2, 2, 2, 60, 366, 3, 2, 2, 2, 62, 368, 3, 2, 2, 2, 64, 371, 3, 2, 2, 2, 66, 375, 3, 2, 2, 2, 68, 379, 3, 2, 2, 2, 70, 381, 3, 2, 2, 2, 72, 383, 3, 2, 2, 2, 74, 386, 3, 2, 2, 2, 76, 390, 3, 2, 2, 2, 78, 392, 3, 2, 2, 2, 80, 395, 3, 2, 2, 2, 82, 406, 3, 2, 2, 2, 84, 425, 3, 2, 2, 2, 86, 441, 3, 2, 2, 2, 88, 447, 3, 2, 2, 2, 90, 449, 3, 2, 2, 2, 92, 455, 3, 2, 2, 2, 94, 457, 3, 2, 2, 2, 96, 460, 3, 2, 2, 2, 98, 99, 5, 4, 3, 2, 99, 3, 3, 2, 2, 2, 100, 101, 7, 3, 2, 2, 101, 102, 7, 4, 2, 2, 102, 103, 5, 12, 7, 2, 103, 104, 7, 51, 2, 2, 104, 109, 5, 6, 4, 2, 105, 106, 7, 50, 2, 2, 106, 108, 5, 6, 4, 2, 107, 105, 3, 2, 2, 2, 108, 111, 3, 2, 2, 2, 109, 107, 3, 2, 2, 2, 109, 110, 3, 2, 2, 2, 110, 112, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 112, 113, 7, 52, 2, 2, 113, 114, 7, 5, 2, 2, 114, 115, 5, 16, 9, 2, 115, 116, 7, 6, 2, 2, 116, 5, 3, 2, 2, 2, 117, 119, 5, 10, 6, 2, 118, 120, 9, 2, 2, 2, 119, 118, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 121, 3, 2, 2, 2, 121, 122, 5, 8, 5, 2, 122, 7, 3, 2, 2, 2, 123, 124, 5, 12, 7, 2, 124, 9, 3, 2, 2, 2, 125, 155, 7, 8, 2, 2, 126, 135, 5, 12, 7, 2, 127, 128, 7, 9, 2, 2, 128, 131, 5, 12, 7, 2, 129, 130, 7, 50, 2, 2, 130, 132, 5, 12, 7, 2, 131, 129, 3, 2, 2, 2, 131, 132, 3, 2, 2, 2, 132, 133, 3, 2, 2, 2, 133, 134, 7, 10, 2, 2, 134, 136, 3, 2, 2, 2, 135, 127, 3, 2, 2, 2, 135, 136, 3, 2, 2, 2, 136, 155, 3, 2, 2, 2, 137, 138, 5, 12, 7, 2, 138, 139, 7, 11, 2, 2, 139, 148, 5, 12, 7, 2, 140, 141, 7, 9, 2, 2, 141, 144, 5, 12, 7, 2, 142, 143, 7, 50, 2, 2, 143, 145, 5, 12, 7, 2, 144, 142, 3, 2, 2, 2, 144, 145, 3, 2, 2, 2, 145, 146, 3, 2, 2, 2, 146, 147, 7, 10, 2, 2, 147, 149, 3, 2, 2, 2, 148, 140, 3, 2, 2, 2, 148, 149, 3, 2, 2, 2, 149, 155, 3, 2, 2, 2, 150, 151, 7, 12, 2, 2, 151, 152, 5, 10, 6, 2, 152, 153, 7, 10, 2, 2, 153, 155, 3, 2, 2, 2, 154, 125, 3, 2, 2, 2, 154, 126, 3, 2, 2, 2, 154, 137, 3, 2, 2, 2, 154, 150, 3, 2, 2, 2, 155, 11, 3, 2, 2, 2, 156, 157, 7, 45, 2, 2, 157, 13, 3, 2, 2, 2, 158, 159, 7, 45, 2, 2, 159, 161, 7, 51, 2, 2, 160, 162, 7, 45, 2, 2, 161, 160, 3, 2, 2, 2, 161, 162, 3, 2, 2, 2, 162, 167, 3, 2, 2, 2, 163, 164, 7, 50, 2, 2, 164, 166, 7, 45, 2, 2, 165, 163, 3, 2, 2, 2, 166, 169, 3, 2, 2, 2, 167, 165, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 170, 3, 2, 2, 2, 169, 167, 3, 2, 2, 2, 170, 171, 7, 52, 2, 2, 171, 15, 3, 2, 2, 2, 172, 174, 5, 18, 10, 2, 173, 172, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 183, 3, 2, 2, 2, 175, 177, 7, 61, 2, 2, 176, 175, 3, 2, 2, 2, 177, 178, 3, 2, 2, 2, 178, 176, 3, 2, 2, 2, 178, 179, 3, 2, 2, 2, 179, 180, 3, 2, 2, 2, 180, 182, 5, 18, 10, 2, 181, 176, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 189, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 188, 7, 61, 2, 2, 187, 186, 3, 2, 2, 2, 188, 191, 3, 2, 2, 2, 189, 187, 3, 2, 2, 2, 189, 190, 3, 2, 2, 2, 190, 17, 3, 2, 2, 2, 191, 189, 3, 2, 2, 2, 192, 197, 5, 30, 16, 2, 193, 197, 5, 38, 20, 2, 194, 197, 5, 20, 11, 2, 195, 197, 5, 14, 8, 2, 196, 192, 3, 2, 2, 2, 196, 193, 3, 2, 2, 2, 196, 194, 3, 2, 2, 2, 196, 195, 3, 2, 2, 2, 197, 19, 3, 2, 2, 2, 198, 213, 5, 22, 12, 2, 199, 213, 5, 50, 26, 2, 200, 213, 5, 56, 29, 2, 201, 213, 5, 60, 31, 2, 202, 213, 5, 62, 32, 2, 203, 213, 5, 64, 33, 2, 204, 213, 5, 66, 34, 2, 205, 213, 5, 68, 35, 2, 206, 213, 5, 70, 36, 2, 207, 213, 5, 72, 37, 2, 208, 213, 5, 74, 38, 2, 209, 213, 5, 76, 39, 2, 210, 213, 5, 78, 40, 2, 211, 213, 5, 80, 41, 2, 212, 198, 3, 2, 2, 2, 212, 199, 3, 2, 2, 2, 212, 200, 3, 2, 2, 2, 212, 201, 3, 2, 2, 2, 212, 202, 3, 2, 2, 2, 212, 203, 3, 2, 2, 2, 212, 204, 3, 2, 2, 2, 212, 205, 3, 2, 2, 2, 212, 206, 3, 2, 2, 2, 212, 207, 3, 2, 2, 2, 212, 208, 3, 2, 2, 2, 212, 209, 3, 2, 2, 2, 212, 210, 3, 2, 2, 2, 212, 211, 3, 2, 2, 2, 213, 21, 3, 2, 2, 2, 214, 226, 5, 24, 13, 2, 215, 216, 7, 51, 2, 2, 216, 221, 5, 28, 15, 2, 217, 218, 7, 50, 2, 2, 218, 220, 5, 28, 15, 2, 219, 217, 3, 2, 2, 2, 220, 223, 3, 2, 2, 2, 221, 219, 3, 2, 2, 2, 221, 222, 3, 2, 2, 2, 222, 224, 3, 2, 2, 2, 223, 221, 3, 2, 2, 2, 224, 225, 7, 52, 2, 2, 225, 227, 3, 2, 2, 2, 226, 215, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 229, 3, 2, 2, 2, 228, 230, 5, 26, 14, 2, 229, 228, 3, 2, 2, 2, 230, 231, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 23, 3, 2, 2, 2, 233, 234, 7, 45, 2, 2, 234, 25, 3, 2, 2, 2, 235, 236, 7, 46, 2, 2, 236, 27, 3, 2, 2, 2, 237, 238, 5, 84, 43, 2, 238, 29, 3, 2, 2, 2, 239, 240, 7, 13, 2, 2, 240, 252, 5, 24, 13, 2, 241, 242, 7, 51, 2, 2, 242, 247, 5, 32, 17, 2, 243, 244, 7, 50, 2, 2, 244, 246, 5, 32, 17, 2, 245, 243, 3, 2, 2, 2, 246, 249, 3, 2, 2, 2, 247, 245, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 248, 250, 3, 2, 2, 2, 249, 247, 3, 2, 2, 2, 250, 251, 7, 52, 2, 2, 251, 253, 3, 2, 2, 2, 252, 241, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 254, 3, 2, 2, 2, 254, 255, 7, 55, 2, 2, 255, 256, 7, 61, 2, 2, 256, 257, 5, 34, 18, 2, 257, 31, 3, 2, 2, 2, 258, 259, 7, 56, 2, 2, 259, 260, 7, 45, 2, 2, 260, 33, 3, 2, 2, 2, 261, 262, 5, 36, 19, 2, 262, 263, 7, 61, 2, 2, 263, 265, 3, 2, 2, 2, 264, 261, 3, 2, 2, 2, 265, 268, 3, 2, 2, 2, 266, 264, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 269, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 269, 270, 5, 36, 19, 2, 270, 35, 3, 2, 2, 2, 271, 272, 7, 60, 2, 2, 272, 277, 5, 84, 43, 2, 273, 274, 7, 50, 2, 2, 274, 276, 5, 84, 43, 2, 275, 273, 3, 2, 2, 2, 276, 279, 3, 2, 2, 2, 277, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, 37, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 280, 281, 7, 14, 2, 2, 281, 293, 5, 24, 13, 2, 282, 283, 7, 51, 2, 2, 283, 288, 5, 32, 17, 2, 284, 285, 7, 50, 2, 2, 285, 287, 5, 32, 17, 2, 286, 284, 3, 2, 2, 2, 287, 290, 3, 2, 2, 2, 288, 286, 3, 2, 2, 2, 288, 289, 3, 2, 2, 2, 289, 291, 3, 2, 2, 2, 290, 288, 3, 2, 2, 2, 291, 292, 7, 52, 2, 2, 292, 294, 3, 2, 2, 2, 293, 282, 3, 2, 2, 2, 293, 294, 3, 2, 2, 2, 294, 298, 3, 2, 2, 2, 295, 297, 5, 40, 21, 2, 296, 295, 3, 2, 2, 2, 297, 300, 3, 2, 2, 2, 298, 296, 3, 2, 2, 2, 298, 299, 3, 2, 2, 2, 299, 301, 3, 2, 2, 2, 300, 298, 3, 2, 2, 2, 301, 302, 7, 55, 2, 2, 302, 303, 7, 61, 2, 2, 303, 304, 5, 48, 25, 2, 304, 39, 3, 2, 2, 2, 305, 306, 7, 45, 2, 2, 306, 41, 3, 2, 2, 2, 307, 310, 5, 26, 14, 2, 308, 310, 5, 40, 21, 2, 309, 307, 3, 2, 2, 2, 309, 308, 3, 2, 2, 2, 310, 43, 3, 2, 2, 2, 311, 323, 5, 24, 13, 2, 312, 313, 7, 51, 2, 2, 313, 318, 5, 28, 15, 2, 314, 315, 7, 50, 2, 2, 315, 317, 5, 28, 15, 2, 316, 314, 3, 2, 2, 2, 317, 320, 3, 2, 2, 2, 318, 316, 3, 2, 2, 2, 318, 319, 3, 2, 2, 2, 319, 321, 3, 2, 2, 2, 320, 318, 3, 2, 2, 2, 321, 322, 7, 52, 2, 2, 322, 324, 3, 2, 2, 2, 323, 312, 3, 2, 2, 2, 323, 324, 3, 2, 2, 2, 324, 326, 3, 2, 2, 2, 325, 327, 5, 42, 22, 2, 326, 325, 3, 2, 2, 2, 327, 328, 3, 2, 2, 2, 328, 326, 3, 2, 2, 2, 328, 329, 3, 2, 2, 2, 329, 45, 3, 2, 2, 2, 330, 333, 5, 44, 23, 2, 331, 333, 5, 20, 11, 2, 332, 330, 3, 2, 2, 2, 332, 331, 3, 2, 2, 2, 333, 47, 3, 2, 2, 2, 334, 335, 7, 60, 2, 2, 335, 336, 5, 46, 24, 2, 336, 337, 7, 61, 2, 2, 337, 339, 3, 2, 2, 2, 338, 334, 3, 2, 2, 2, 339, 342, 3, 2, 2, 2, 340, 338, 3, 2, 2, 2, 340, 341, 3, 2, 2, 2, 341, 343, 3, 2, 2, 2, 342, 340, 3, 2, 2, 2, 343, 344, 7, 60, 2, 2, 344, 345, 5, 46, 24, 2, 345, 49, 3, 2, 2, 2, 346, 347, 7, 15, 2, 2, 347, 349, 5, 26, 14, 2, 348, 350, 5, 52, 27, 2, 349, 348, 3, 2, 2, 2, 349, 350, 3, 2, 2, 2, 350, 51, 3, 2, 2, 2, 351, 352, 7, 53, 2, 2, 352, 353, 5, 54, 28, 2, 353, 354, 7, 54, 2, 2, 354, 53, 3, 2, 2, 2, 355, 357, 7, 46, 2, 2, 356, 355, 3, 2, 2, 2, 357, 358, 3, 2, 2, 2, 358, 356, 3, 2, 2, 2, 358, 359, 3, 2, 2, 2, 359, 55, 3, 2, 2, 2, 360, 361, 7, 16, 2, 2, 361, 362, 5, 58, 30, 2, 362, 57, 3, 2, 2, 2, 363, 364, 7, 57, 2, 2, 364, 365, 7, 45, 2, 2, 365, 59, 3, 2, 2, 2, 366, 367, 7, 17, 2, 2, 367, 61, 3, 2, 2, 2, 368, 369, 7, 18, 2, 2, 369, 370, 5, 58, 30, 2, 370, 63, 3, 2, 2, 2, 371, 372, 7, 19, 2, 2, 372, 373, 5, 58, 30, 2, 373, 374, 5, 52, 27, 2, 374, 65, 3, 2, 2, 2, 375, 376, 7, 20, 2, 2, 376, 377, 5, 58, 30, 2, 377, 378, 5, 52, 27, 2, 378, 67, 3, 2, 2, 2, 379, 380, 7, 21, 2, 2, 380, 69, 3, 2, 2, 2, 381, 382, 7, 22, 2, 2, 382, 71, 3, 2, 2, 2, 383, 384, 9, 3, 2, 2, 384, 385, 5, 52, 27, 2, 385, 73, 3, 2, 2, 2, 386, 387, 9, 4, 2, 2, 387, 388, 5, 52, 27, 2, 388, 389, 5, 52, 27, 2, 389, 75, 3, 2, 2, 2, 390, 391, 7, 23, 2, 2, 391, 77, 3, 2, 2, 2, 392, 393, 7, 24, 2, 2, 393, 394, 7, 48, 2, 2, 394, 79, 3, 2, 2, 2, 395, 396, 7, 25, 2, 2, 396, 400, 7, 45, 2, 2, 397, 399, 5, 82, 42, 2, 398, 397, 3, 2, 2, 2, 399, 402, 3, 2, 2, 2, 400, 398, 3, 2, 2, 2, 400, 401, 3, 2, 2, 2, 401, 404, 3, 2, 2, 2, 402, 400, 3, 2, 2, 2, 403, 405, 7, 48, 2, 2, 404, 403, 3, 2, 2, 2, 404, 405, 3, 2, 2, 2, 405, 81, 3, 2, 2, 2, 406, 407, 9, 5, 2, 2, 407, 83, 3, 2, 2, 2, 408, 409, 8, 43, 1, 2, 409, 410, 7, 51, 2, 2, 410, 411, 5, 84, 43, 2, 411, 412, 7, 52, 2, 2, 412, 426, 3, 2, 2, 2, 413, 414, 5, 90, 46, 2, 414, 415, 5, 84, 43, 11, 415, 426, 3, 2, 2, 2, 416, 417, 5, 88, 45, 2, 417, 418, 7, 51, 2, 2, 418, 419, 5, 84, 43, 2, 419, 420, 7, 52, 2, 2, 420, 426, 3, 2, 2, 2, 421, 426, 5, 86, 44, 2, 422, 426, 5, 92, 47, 2, 423, 426, 5, 32, 17, 2, 424, 426, 7, 45, 2, 2, 425, 408, 3, 2, 2, 2, 425, 413, 3, 2, 2, 2, 425, 416, 3, 2, 2, 2, 425, 421, 3, 2, 2, 2, 425, 422, 3, 2, 2, 2, 425, 423, 3, 2, 2, 2, 425, 424, 3, 2, 2, 2, 426, 438, 3, 2, 2, 2, 427, 428, 12, 10, 2, 2, 428, 429, 7, 44, 2, 2, 429, 437, 5, 84, 43, 10, 430, 431, 12, 9, 2, 2, 431, 432, 9, 6, 2, 2, 432, 437, 5, 84, 43, 10, 433, 434, 12, 8, 2, 2, 434, 435, 9, 7, 2, 2, 435, 437, 5, 84, 43, 9, 436, 427, 3, 2, 2, 2, 436, 430, 3, 2, 2, 2, 436, 433, 3, 2, 2, 2, 437, 440, 3, 2, 2, 2, 438, 436, 3, 2, 2, 2, 438, 439, 3, 2, 2, 2, 439, 85, 3, 2, 2, 2, 440, 438, 3, 2, 2, 2, 441, 442, 7, 53, 2, 2, 442, 443, 7, 46, 2, 2, 443, 444, 7, 41, 2, 2, 444, 445, 7, 46, 2, 2, 445, 446, 7, 54, 2, 2, 446, 87, 3, 2, 2, 2, 447, 448, 9, 8, 2, 2, 448, 89, 3, 2, 2, 2, 449, 450, 9, 7, 2, 2, 450, 91, 3, 2, 2, 2, 451, 456, 5, 96, 49, 2, 452, 456, 5, 94, 48, 2, 453, 456, 7, 34, 2, 2, 454, 456, 7, 33, 2, 2, 455, 451, 3, 2, 2, 2, 455, 452, 3, 2, 2, 2, 455, 453, 3, 2, 2, 2, 455, 454, 3, 2, 2, 2, 456, 93, 3, 2, 2, 2, 457, 458, 5, 96, 49, 2, 458, 459, 7, 34, 2, 2, 459, 95, 3, 2, 2, 2, 460, 461, 9, 9, 2, 2, 461, 97, 3, 2, 2, 2, 41, 109, 119, 131, 135, 144, 148, 154, 161, 167, 173, 178, 183, 189, 196, 212, 221, 226, 231, 247, 252, 266, 277, 288, 293, 298, 309, 318, 323, 328, 332, 340, 349, 358, 400, 404, 425, 436, 438, 455]
\ No newline at end of file
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 64, 468, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 108, 10, 3, 12, 3, 14, 3, 111, 11, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 5, 4, 120, 10, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 132, 10, 6, 3, 6, 3, 6, 5, 6, 136, 10, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 145, 10, 6, 3, 6, 3, 6, 5, 6, 149, 10, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 155, 10, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 5, 8, 162, 10, 8, 3, 8, 3, 8, 7, 8, 166, 10, 8, 12, 8, 14, 8, 169, 11, 8, 3, 8, 3, 8, 3, 9, 5, 9, 174, 10, 9, 3, 9, 6, 9, 177, 10, 9, 13, 9, 14, 9, 178, 3, 9, 7, 9, 182, 10, 9, 12, 9, 14, 9, 185, 11, 9, 3, 9, 7, 9, 188, 10, 9, 12, 9, 14, 9, 191, 11, 9, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 197, 10, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 5, 11, 213, 10, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 7, 12, 220, 10, 12, 12, 12, 14, 12, 223, 11, 12, 3, 12, 3, 12, 5, 12, 227, 10, 12, 3, 12, 6, 12, 230, 10, 12, 13, 12, 14, 12, 231, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 7, 16, 246, 10, 16, 12, 16, 14, 16, 249, 11, 16, 3, 16, 3, 16, 5, 16, 253, 10, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 7, 18, 265, 10, 18, 12, 18, 14, 18, 268, 11, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 7, 19, 276, 10, 19, 12, 19, 14, 19, 279, 11, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 7, 20, 287, 10, 20, 12, 20, 14, 20, 290, 11, 20, 3, 20, 3, 20, 5, 20, 294, 10, 20, 3, 20, 7, 20, 297, 10, 20, 12, 20, 14, 20, 300, 11, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 5, 22, 310, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 7, 23, 317, 10, 23, 12, 23, 14, 23, 320, 11, 23, 3, 23, 3, 23, 5, 23, 324, 10, 23, 3, 23, 6, 23, 327, 10, 23, 13, 23, 14, 23, 328, 3, 24, 3, 24, 5, 24, 333, 10, 24, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 339, 10, 25, 12, 25, 14, 25, 342, 11, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 5, 26, 350, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 6, 28, 357, 10, 28, 13, 28, 14, 28, 358, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 7, 41, 399, 10, 41, 12, 41, 14, 41, 402, 11, 41, 3, 41, 5, 41, 405, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 5, 43, 426, 10, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 7, 43, 442, 10, 43, 12, 43, 14, 43, 445, 11, 43, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 5, 47, 461, 10, 47, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 2, 3, 84, 50, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 2, 10, 4, 2, 7, 7, 42, 42, 3, 2, 26, 28, 3, 2, 29, 32, 3, 2, 45, 46, 3, 2, 42, 43, 3, 2, 40, 41, 3, 2, 35, 39, 3, 2, 46, 47, 2, 483, 2, 98, 3, 2, 2, 2, 4, 100, 3, 2, 2, 2, 6, 117, 3, 2, 2, 2, 8, 123, 3, 2, 2, 2, 10, 154, 3, 2, 2, 2, 12, 156, 3, 2, 2, 2, 14, 158, 3, 2, 2, 2, 16, 173, 3, 2, 2, 2, 18, 196, 3, 2, 2, 2, 20, 212, 3, 2, 2, 2, 22, 214, 3, 2, 2, 2, 24, 233, 3, 2, 2, 2, 26, 235, 3, 2, 2, 2, 28, 237, 3, 2, 2, 2, 30, 239, 3, 2, 2, 2, 32, 258, 3, 2, 2, 2, 34, 266, 3, 2, 2, 2, 36, 271, 3, 2, 2, 2, 38, 280, 3, 2, 2, 2, 40, 305, 3, 2, 2, 2, 42, 309, 3, 2, 2, 2, 44, 311, 3, 2, 2, 2, 46, 332, 3, 2, 2, 2, 48, 340, 3, 2, 2, 2, 50, 346, 3, 2, 2, 2, 52, 351, 3, 2, 2, 2, 54, 356, 3, 2, 2, 2, 56, 360, 3, 2, 2, 2, 58, 363, 3, 2, 2, 2, 60, 366, 3, 2, 2, 2, 62, 368, 3, 2, 2, 2, 64, 371, 3, 2, 2, 2, 66, 375, 3, 2, 2, 2, 68, 379, 3, 2, 2, 2, 70, 381, 3, 2, 2, 2, 72, 383, 3, 2, 2, 2, 74, 386, 3, 2, 2, 2, 76, 390, 3, 2, 2, 2, 78, 392, 3, 2, 2, 2, 80, 395, 3, 2, 2, 2, 82, 406, 3, 2, 2, 2, 84, 425, 3, 2, 2, 2, 86, 446, 3, 2, 2, 2, 88, 452, 3, 2, 2, 2, 90, 454, 3, 2, 2, 2, 92, 460, 3, 2, 2, 2, 94, 462, 3, 2, 2, 2, 96, 465, 3, 2, 2, 2, 98, 99, 5, 4, 3, 2, 99, 3, 3, 2, 2, 2, 100, 101, 7, 3, 2, 2, 101, 102, 7, 4, 2, 2, 102, 103, 5, 12, 7, 2, 103, 104, 7, 51, 2, 2, 104, 109, 5, 6, 4, 2, 105, 106, 7, 50, 2, 2, 106, 108, 5, 6, 4, 2, 107, 105, 3, 2, 2, 2, 108, 111, 3, 2, 2, 2, 109, 107, 3, 2, 2, 2, 109, 110, 3, 2, 2, 2, 110, 112, 3, 2, 2, 2, 111, 109, 3, 2, 2, 2, 112, 113, 7, 52, 2, 2, 113, 114, 7, 5, 2, 2, 114, 115, 5, 16, 9, 2, 115, 116, 7, 6, 2, 2, 116, 5, 3, 2, 2, 2, 117, 119, 5, 10, 6, 2, 118, 120, 9, 2, 2, 2, 119, 118, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 121, 3, 2, 2, 2, 121, 122, 5, 8, 5, 2, 122, 7, 3, 2, 2, 2, 123, 124, 5, 12, 7, 2, 124, 9, 3, 2, 2, 2, 125, 155, 7, 8, 2, 2, 126, 135, 5, 12, 7, 2, 127, 128, 7, 9, 2, 2, 128, 131, 5, 12, 7, 2, 129, 130, 7, 50, 2, 2, 130, 132, 5, 12, 7, 2, 131, 129, 3, 2, 2, 2, 131, 132, 3, 2, 2, 2, 132, 133, 3, 2, 2, 2, 133, 134, 7, 10, 2, 2, 134, 136, 3, 2, 2, 2, 135, 127, 3, 2, 2, 2, 135, 136, 3, 2, 2, 2, 136, 155, 3, 2, 2, 2, 137, 138, 5, 12, 7, 2, 138, 139, 7, 11, 2, 2, 139, 148, 5, 12, 7, 2, 140, 141, 7, 9, 2, 2, 141, 144, 5, 12, 7, 2, 142, 143, 7, 50, 2, 2, 143, 145, 5, 12, 7, 2, 144, 142, 3, 2, 2, 2, 144, 145, 3, 2, 2, 2, 145, 146, 3, 2, 2, 2, 146, 147, 7, 10, 2, 2, 147, 149, 3, 2, 2, 2, 148, 140, 3, 2, 2, 2, 148, 149, 3, 2, 2, 2, 149, 155, 3, 2, 2, 2, 150, 151, 7, 12, 2, 2, 151, 152, 5, 10, 6, 2, 152, 153, 7, 10, 2, 2, 153, 155, 3, 2, 2, 2, 154, 125, 3, 2, 2, 2, 154, 126, 3, 2, 2, 2, 154, 137, 3, 2, 2, 2, 154, 150, 3, 2, 2, 2, 155, 11, 3, 2, 2, 2, 156, 157, 7, 45, 2, 2, 157, 13, 3, 2, 2, 2, 158, 159, 7, 45, 2, 2, 159, 161, 7, 51, 2, 2, 160, 162, 7, 45, 2, 2, 161, 160, 3, 2, 2, 2, 161, 162, 3, 2, 2, 2, 162, 167, 3, 2, 2, 2, 163, 164, 7, 50, 2, 2, 164, 166, 7, 45, 2, 2, 165, 163, 3, 2, 2, 2, 166, 169, 3, 2, 2, 2, 167, 165, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 170, 3, 2, 2, 2, 169, 167, 3, 2, 2, 2, 170, 171, 7, 52, 2, 2, 171, 15, 3, 2, 2, 2, 172, 174, 5, 18, 10, 2, 173, 172, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 183, 3, 2, 2, 2, 175, 177, 7, 61, 2, 2, 176, 175, 3, 2, 2, 2, 177, 178, 3, 2, 2, 2, 178, 176, 3, 2, 2, 2, 178, 179, 3, 2, 2, 2, 179, 180, 3, 2, 2, 2, 180, 182, 5, 18, 10, 2, 181, 176, 3, 2, 2, 2, 182, 185, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 183, 184, 3, 2, 2, 2, 184, 189, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 186, 188, 7, 61, 2, 2, 187, 186, 3, 2, 2, 2, 188, 191, 3, 2, 2, 2, 189, 187, 3, 2, 2, 2, 189, 190, 3, 2, 2, 2, 190, 17, 3, 2, 2, 2, 191, 189, 3, 2, 2, 2, 192, 197, 5, 30, 16, 2, 193, 197, 5, 38, 20, 2, 194, 197, 5, 20, 11, 2, 195, 197, 5, 14, 8, 2, 196, 192, 3, 2, 2, 2, 196, 193, 3, 2, 2, 2, 196, 194, 3, 2, 2, 2, 196, 195, 3, 2, 2, 2, 197, 19, 3, 2, 2, 2, 198, 213, 5, 22, 12, 2, 199, 213, 5, 50, 26, 2, 200, 213, 5, 56, 29, 2, 201, 213, 5, 60, 31, 2, 202, 213, 5, 62, 32, 2, 203, 213, 5, 64, 33, 2, 204, 213, 5, 66, 34, 2, 205, 213, 5, 68, 35, 2, 206, 213, 5, 70, 36, 2, 207, 213, 5, 72, 37, 2, 208, 213, 5, 74, 38, 2, 209, 213, 5, 76, 39, 2, 210, 213, 5, 78, 40, 2, 211, 213, 5, 80, 41, 2, 212, 198, 3, 2, 2, 2, 212, 199, 3, 2, 2, 2, 212, 200, 3, 2, 2, 2, 212, 201, 3, 2, 2, 2, 212, 202, 3, 2, 2, 2, 212, 203, 3, 2, 2, 2, 212, 204, 3, 2, 2, 2, 212, 205, 3, 2, 2, 2, 212, 206, 3, 2, 2, 2, 212, 207, 3, 2, 2, 2, 212, 208, 3, 2, 2, 2, 212, 209, 3, 2, 2, 2, 212, 210, 3, 2, 2, 2, 212, 211, 3, 2, 2, 2, 213, 21, 3, 2, 2, 2, 214, 226, 5, 24, 13, 2, 215, 216, 7, 51, 2, 2, 216, 221, 5, 28, 15, 2, 217, 218, 7, 50, 2, 2, 218, 220, 5, 28, 15, 2, 219, 217, 3, 2, 2, 2, 220, 223, 3, 2, 2, 2, 221, 219, 3, 2, 2, 2, 221, 222, 3, 2, 2, 2, 222, 224, 3, 2, 2, 2, 223, 221, 3, 2, 2, 2, 224, 225, 7, 52, 2, 2, 225, 227, 3, 2, 2, 2, 226, 215, 3, 2, 2, 2, 226, 227, 3, 2, 2, 2, 227, 229, 3, 2, 2, 2, 228, 230, 5, 26, 14, 2, 229, 228, 3, 2, 2, 2, 230, 231, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 23, 3, 2, 2, 2, 233, 234, 7, 45, 2, 2, 234, 25, 3, 2, 2, 2, 235, 236, 7, 46, 2, 2, 236, 27, 3, 2, 2, 2, 237, 238, 5, 84, 43, 2, 238, 29, 3, 2, 2, 2, 239, 240, 7, 13, 2, 2, 240, 252, 5, 24, 13, 2, 241, 242, 7, 51, 2, 2, 242, 247, 5, 32, 17, 2, 243, 244, 7, 50, 2, 2, 244, 246, 5, 32, 17, 2, 245, 243, 3, 2, 2, 2, 246, 249, 3, 2, 2, 2, 247, 245, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 248, 250, 3, 2, 2, 2, 249, 247, 3, 2, 2, 2, 250, 251, 7, 52, 2, 2, 251, 253, 3, 2, 2, 2, 252, 241, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 254, 3, 2, 2, 2, 254, 255, 7, 55, 2, 2, 255, 256, 7, 61, 2, 2, 256, 257, 5, 34, 18, 2, 257, 31, 3, 2, 2, 2, 258, 259, 7, 56, 2, 2, 259, 260, 7, 45, 2, 2, 260, 33, 3, 2, 2, 2, 261, 262, 5, 36, 19, 2, 262, 263, 7, 61, 2, 2, 263, 265, 3, 2, 2, 2, 264, 261, 3, 2, 2, 2, 265, 268, 3, 2, 2, 2, 266, 264, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 269, 3, 2, 2, 2, 268, 266, 3, 2, 2, 2, 269, 270, 5, 36, 19, 2, 270, 35, 3, 2, 2, 2, 271, 272, 7, 60, 2, 2, 272, 277, 5, 84, 43, 2, 273, 274, 7, 50, 2, 2, 274, 276, 5, 84, 43, 2, 275, 273, 3, 2, 2, 2, 276, 279, 3, 2, 2, 2, 277, 275, 3, 2, 2, 2, 277, 278, 3, 2, 2, 2, 278, 37, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 280, 281, 7, 14, 2, 2, 281, 293, 5, 24, 13, 2, 282, 283, 7, 51, 2, 2, 283, 288, 5, 32, 17, 2, 284, 285, 7, 50, 2, 2, 285, 287, 5, 32, 17, 2, 286, 284, 3, 2, 2, 2, 287, 290, 3, 2, 2, 2, 288, 286, 3, 2, 2, 2, 288, 289, 3, 2, 2, 2, 289, 291, 3, 2, 2, 2, 290, 288, 3, 2, 2, 2, 291, 292, 7, 52, 2, 2, 292, 294, 3, 2, 2, 2, 293, 282, 3, 2, 2, 2, 293, 294, 3, 2, 2, 2, 294, 298, 3, 2, 2, 2, 295, 297, 5, 40, 21, 2, 296, 295, 3, 2, 2, 2, 297, 300, 3, 2, 2, 2, 298, 296, 3, 2, 2, 2, 298, 299, 3, 2, 2, 2, 299, 301, 3, 2, 2, 2, 300, 298, 3, 2, 2, 2, 301, 302, 7, 55, 2, 2, 302, 303, 7, 61, 2, 2, 303, 304, 5, 48, 25, 2, 304, 39, 3, 2, 2, 2, 305, 306, 7, 45, 2, 2, 306, 41, 3, 2, 2, 2, 307, 310, 5, 26, 14, 2, 308, 310, 5, 40, 21, 2, 309, 307, 3, 2, 2, 2, 309, 308, 3, 2, 2, 2, 310, 43, 3, 2, 2, 2, 311, 323, 5, 24, 13, 2, 312, 313, 7, 51, 2, 2, 313, 318, 5, 28, 15, 2, 314, 315, 7, 50, 2, 2, 315, 317, 5, 28, 15, 2, 316, 314, 3, 2, 2, 2, 317, 320, 3, 2, 2, 2, 318, 316, 3, 2, 2, 2, 318, 319, 3, 2, 2, 2, 319, 321, 3, 2, 2, 2, 320, 318, 3, 2, 2, 2, 321, 322, 7, 52, 2, 2, 322, 324, 3, 2, 2, 2, 323, 312, 3, 2, 2, 2, 323, 324, 3, 2, 2, 2, 324, 326, 3, 2, 2, 2, 325, 327, 5, 42, 22, 2, 326, 325, 3, 2, 2, 2, 327, 328, 3, 2, 2, 2, 328, 326, 3, 2, 2, 2, 328, 329, 3, 2, 2, 2, 329, 45, 3, 2, 2, 2, 330, 333, 5, 44, 23, 2, 331, 333, 5, 20, 11, 2, 332, 330, 3, 2, 2, 2, 332, 331, 3, 2, 2, 2, 333, 47, 3, 2, 2, 2, 334, 335, 7, 60, 2, 2, 335, 336, 5, 46, 24, 2, 336, 337, 7, 61, 2, 2, 337, 339, 3, 2, 2, 2, 338, 334, 3, 2, 2, 2, 339, 342, 3, 2, 2, 2, 340, 338, 3, 2, 2, 2, 340, 341, 3, 2, 2, 2, 341, 343, 3, 2, 2, 2, 342, 340, 3, 2, 2, 2, 343, 344, 7, 60, 2, 2, 344, 345, 5, 46, 24, 2, 345, 49, 3, 2, 2, 2, 346, 347, 7, 15, 2, 2, 347, 349, 5, 26, 14, 2, 348, 350, 5, 52, 27, 2, 349, 348, 3, 2, 2, 2, 349, 350, 3, 2, 2, 2, 350, 51, 3, 2, 2, 2, 351, 352, 7, 53, 2, 2, 352, 353, 5, 54, 28, 2, 353, 354, 7, 54, 2, 2, 354, 53, 3, 2, 2, 2, 355, 357, 7, 46, 2, 2, 356, 355, 3, 2, 2, 2, 357, 358, 3, 2, 2, 2, 358, 356, 3, 2, 2, 2, 358, 359, 3, 2, 2, 2, 359, 55, 3, 2, 2, 2, 360, 361, 7, 16, 2, 2, 361, 362, 5, 58, 30, 2, 362, 57, 3, 2, 2, 2, 363, 364, 7, 57, 2, 2, 364, 365, 7, 45, 2, 2, 365, 59, 3, 2, 2, 2, 366, 367, 7, 17, 2, 2, 367, 61, 3, 2, 2, 2, 368, 369, 7, 18, 2, 2, 369, 370, 5, 58, 30, 2, 370, 63, 3, 2, 2, 2, 371, 372, 7, 19, 2, 2, 372, 373, 5, 58, 30, 2, 373, 374, 5, 52, 27, 2, 374, 65, 3, 2, 2, 2, 375, 376, 7, 20, 2, 2, 376, 377, 5, 58, 30, 2, 377, 378, 5, 52, 27, 2, 378, 67, 3, 2, 2, 2, 379, 380, 7, 21, 2, 2, 380, 69, 3, 2, 2, 2, 381, 382, 7, 22, 2, 2, 382, 71, 3, 2, 2, 2, 383, 384, 9, 3, 2, 2, 384, 385, 5, 52, 27, 2, 385, 73, 3, 2, 2, 2, 386, 387, 9, 4, 2, 2, 387, 388, 5, 52, 27, 2, 388, 389, 5, 52, 27, 2, 389, 75, 3, 2, 2, 2, 390, 391, 7, 23, 2, 2, 391, 77, 3, 2, 2, 2, 392, 393, 7, 24, 2, 2, 393, 394, 7, 48, 2, 2, 394, 79, 3, 2, 2, 2, 395, 396, 7, 25, 2, 2, 396, 400, 7, 45, 2, 2, 397, 399, 5, 82, 42, 2, 398, 397, 3, 2, 2, 2, 399, 402, 3, 2, 2, 2, 400, 398, 3, 2, 2, 2, 400, 401, 3, 2, 2, 2, 401, 404, 3, 2, 2, 2, 402, 400, 3, 2, 2, 2, 403, 405, 7, 48, 2, 2, 404, 403, 3, 2, 2, 2, 404, 405, 3, 2, 2, 2, 405, 81, 3, 2, 2, 2, 406, 407, 9, 5, 2, 2, 407, 83, 3, 2, 2, 2, 408, 409, 8, 43, 1, 2, 409, 410, 7, 51, 2, 2, 410, 411, 5, 84, 43, 2, 411, 412, 7, 52, 2, 2, 412, 426, 3, 2, 2, 2, 413, 414, 5, 90, 46, 2, 414, 415, 5, 84, 43, 12, 415, 426, 3, 2, 2, 2, 416, 417, 5, 88, 45, 2, 417, 418, 7, 51, 2, 2, 418, 419, 5, 84, 43, 2, 419, 420, 7, 52, 2, 2, 420, 426, 3, 2, 2, 2, 421, 426, 5, 86, 44, 2, 422, 426, 5, 92, 47, 2, 423, 426, 5, 32, 17, 2, 424, 426, 7, 45, 2, 2, 425, 408, 3, 2, 2, 2, 425, 413, 3, 2, 2, 2, 425, 416, 3, 2, 2, 2, 425, 421, 3, 2, 2, 2, 425, 422, 3, 2, 2, 2, 425, 423, 3, 2, 2, 2, 425, 424, 3, 2, 2, 2, 426, 443, 3, 2, 2, 2, 427, 428, 12, 11, 2, 2, 428, 429, 7, 44, 2, 2, 429, 442, 5, 84, 43, 11, 430, 431, 12, 10, 2, 2, 431, 432, 9, 6, 2, 2, 432, 442, 5, 84, 43, 11, 433, 434, 12, 9, 2, 2, 434, 435, 9, 7, 2, 2, 435, 442, 5, 84, 43, 10, 436, 437, 12, 8, 2, 2, 437, 438, 7, 53, 2, 2, 438, 439, 5, 84, 43, 2, 439, 440, 7, 54, 2, 2, 440, 442, 3, 2, 2, 2, 441, 427, 3, 2, 2, 2, 441, 430, 3, 2, 2, 2, 441, 433, 3, 2, 2, 2, 441, 436, 3, 2, 2, 2, 442, 445, 3, 2, 2, 2, 443, 441, 3, 2, 2, 2, 443, 444, 3, 2, 2, 2, 444, 85, 3, 2, 2, 2, 445, 443, 3, 2, 2, 2, 446, 447, 7, 53, 2, 2, 447, 448, 7, 46, 2, 2, 448, 449, 7, 41, 2, 2, 449, 450, 7, 46, 2, 2, 450, 451, 7, 54, 2, 2, 451, 87, 3, 2, 2, 2, 452, 453, 9, 8, 2, 2, 453, 89, 3, 2, 2, 2, 454, 455, 9, 7, 2, 2, 455, 91, 3, 2, 2, 2, 456, 461, 5, 96, 49, 2, 457, 461, 5, 94, 48, 2, 458, 461, 7, 34, 2, 2, 459, 461, 7, 33, 2, 2, 460, 456, 3, 2, 2, 2, 460, 457, 3, 2, 2, 2, 460, 458, 3, 2, 2, 2, 460, 459, 3, 2, 2, 2, 461, 93, 3, 2, 2, 2, 462, 463, 5, 96, 49, 2, 463, 464, 7, 34, 2, 2, 464, 95, 3, 2, 2, 2, 465, 466, 9, 9, 2, 2, 466, 97, 3, 2, 2, 2, 41, 109, 119, 131, 135, 144, 148, 154, 161, 167, 173, 178, 183, 189, 196, 212, 221, 226, 231, 247, 252, 266, 277, 288, 293, 298, 309, 318, 323, 328, 332, 340, 349, 358, 400, 404, 425, 441, 443, 460]
\ No newline at end of file
......@@ -168,6 +168,9 @@ public:
virtual void enterAddSubExp(QuilParser::AddSubExpContext * /*ctx*/) override { }
virtual void exitAddSubExp(QuilParser::AddSubExpContext * /*ctx*/) override { }
virtual void enterVariablewithbracket(QuilParser::VariablewithbracketContext * /*ctx*/) override { }
virtual void exitVariablewithbracket(QuilParser::VariablewithbracketContext * /*ctx*/) override { }
virtual void enterFunctionExp(QuilParser::FunctionExpContext * /*ctx*/) override { }
virtual void exitFunctionExp(QuilParser::FunctionExpContext * /*ctx*/) override { }
......
......@@ -166,6 +166,9 @@ public:
virtual void enterAddSubExp(QuilParser::AddSubExpContext *ctx) = 0;
virtual void exitAddSubExp(QuilParser::AddSubExpContext *ctx) = 0;
virtual void enterVariablewithbracket(QuilParser::VariablewithbracketContext *ctx) = 0;
virtual void exitVariablewithbracket(QuilParser::VariablewithbracketContext *ctx) = 0;
virtual void enterFunctionExp(QuilParser::FunctionExpContext *ctx) = 0;
virtual void exitFunctionExp(QuilParser::FunctionExpContext *ctx) = 0;
......
......@@ -3409,6 +3409,36 @@ void QuilParser::AddSubExpContext::exitRule(tree::ParseTreeListener *listener) {
if (parserListener != nullptr)
parserListener->exitAddSubExp(this);
}
//----------------- VariablewithbracketContext ------------------------------------------------------------------
std::vector<QuilParser::ExpressionContext *> QuilParser::VariablewithbracketContext::expression() {
return getRuleContexts<QuilParser::ExpressionContext>();
}
QuilParser::ExpressionContext* QuilParser::VariablewithbracketContext::expression(size_t i) {
return getRuleContext<QuilParser::ExpressionContext>(i);
}
tree::TerminalNode* QuilParser::VariablewithbracketContext::LBRACKET() {
return getToken(QuilParser::LBRACKET, 0);
}
tree::TerminalNode* QuilParser::VariablewithbracketContext::RBRACKET() {
return getToken(QuilParser::RBRACKET, 0);
}
QuilParser::VariablewithbracketContext::VariablewithbracketContext(ExpressionContext *ctx) { copyFrom(ctx); }
void QuilParser::VariablewithbracketContext::enterRule(tree::ParseTreeListener *listener) {
auto parserListener = dynamic_cast<QuilListener *>(listener);
if (parserListener != nullptr)
parserListener->enterVariablewithbracket(this);
}
void QuilParser::VariablewithbracketContext::exitRule(tree::ParseTreeListener *listener) {
auto parserListener = dynamic_cast<QuilListener *>(listener);
if (parserListener != nullptr)
parserListener->exitVariablewithbracket(this);
}
//----------------- FunctionExpContext ------------------------------------------------------------------
QuilParser::FunctionContext* QuilParser::FunctionExpContext::function() {
......@@ -3486,7 +3516,7 @@ QuilParser::ExpressionContext* QuilParser::expression(int precedence) {
setState(411);
sign();
setState(412);
expression(9);
expression(10);
break;
}
......@@ -3552,7 +3582,7 @@ QuilParser::ExpressionContext* QuilParser::expression(int precedence) {
throw NoViableAltException(this);
}
_ctx->stop = _input->LT(-1);
setState(436);
setState(441);
_errHandler->sync(this);
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 37, _ctx);
while (alt != 2 && alt != atn::ATN::INVALID_ALT_NUMBER) {
......@@ -3560,7 +3590,7 @@ QuilParser::ExpressionContext* QuilParser::expression(int precedence) {
if (!_parseListeners.empty())
triggerExitRuleEvent();
previousContext = _localctx;
setState(434);
setState(439);
_errHandler->sync(this);
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 36, _ctx)) {
case 1: {
......@@ -3569,11 +3599,11 @@ QuilParser::ExpressionContext* QuilParser::expression(int precedence) {
pushNewRecursionContext(newContext, startState, RuleExpression);
setState(425);
if (!(precpred(_ctx, 8))) throw FailedPredicateException(this, "precpred(_ctx, 8)");
if (!(precpred(_ctx, 9))) throw FailedPredicateException(this, "precpred(_ctx, 9)");
setState(426);
match(QuilParser::POWER);
setState(427);
expression(8);
expression(9);
break;
}
......@@ -3583,7 +3613,7 @@ QuilParser::ExpressionContext* QuilParser::expression(int precedence) {
pushNewRecursionContext(newContext, startState, RuleExpression);
setState(428);
if (!(precpred(_ctx, 7))) throw FailedPredicateException(this, "precpred(_ctx, 7)");
if (!(precpred(_ctx, 8))) throw FailedPredicateException(this, "precpred(_ctx, 8)");
setState(429);
_la = _input->LA(1);
if (!(_la == QuilParser::TIMES
......@@ -3596,7 +3626,7 @@ QuilParser::ExpressionContext* QuilParser::expression(int precedence) {
consume();
}
setState(430);
expression(8);
expression(9);
break;
}
......@@ -3606,7 +3636,7 @@ QuilParser::ExpressionContext* QuilParser::expression(int precedence) {
pushNewRecursionContext(newContext, startState, RuleExpression);
setState(431);
if (!(precpred(_ctx, 6))) throw FailedPredicateException(this, "precpred(_ctx, 6)");
if (!(precpred(_ctx, 7))) throw FailedPredicateException(this, "precpred(_ctx, 7)");
setState(432);
_la = _input->LA(1);
if (!(_la == QuilParser::PLUS
......@@ -3619,13 +3649,29 @@ QuilParser::ExpressionContext* QuilParser::expression(int precedence) {
consume();
}
setState(433);
expression(7);
expression(8);
break;
}
case 4: {
auto newContext = _tracker.createInstance<VariablewithbracketContext>(_tracker.createInstance<ExpressionContext>(parentContext, parentState));
_localctx = newContext;
pushNewRecursionContext(newContext, startState, RuleExpression);
setState(434);
if (!(precpred(_ctx, 6))) throw FailedPredicateException(this, "precpred(_ctx, 6)");
setState(435);
match(QuilParser::LBRACKET);
setState(436);
expression(0);
setState(437);
match(QuilParser::RBRACKET);
break;
}
}
}
setState(438);
setState(443);
_errHandler->sync(this);
alt = getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 37, _ctx);
}
......@@ -3690,15 +3736,15 @@ QuilParser::SegmentContext* QuilParser::segment() {
});
try {
enterOuterAlt(_localctx, 1);
setState(439);
setState(444);
match(QuilParser::LBRACKET);
setState(440);
setState(445);
match(QuilParser::INT);
setState(441);
setState(446);
match(QuilParser::MINUS);
setState(442);
setState(447);
match(QuilParser::INT);
setState(443);
setState(448);
match(QuilParser::RBRACKET);
}
......@@ -3764,7 +3810,7 @@ QuilParser::FunctionContext* QuilParser::function() {
});
try {
enterOuterAlt(_localctx, 1);
setState(445);
setState(450);
_la = _input->LA(1);
if (!((((_la & ~ 0x3fULL) == 0) &&
((1ULL << _la) & ((1ULL << QuilParser::SIN)
......@@ -3830,7 +3876,7 @@ QuilParser::SignContext* QuilParser::sign() {
});
try {
enterOuterAlt(_localctx, 1);
setState(447);
setState(452);
_la = _input->LA(1);
if (!(_la == QuilParser::PLUS
......@@ -3899,33 +3945,33 @@ QuilParser::NumberContext* QuilParser::number() {
exitRule();
});
try {
setState(453);
setState(458);
_errHandler->sync(this);
switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 38, _ctx)) {
case 1: {
enterOuterAlt(_localctx, 1);
setState(449);
setState(454);
realN();
break;
}
case 2: {
enterOuterAlt(_localctx, 2);
setState(450);
setState(455);
imaginaryN();
break;
}
case 3: {
enterOuterAlt(_localctx, 3);
setState(451);
setState(456);
match(QuilParser::I);
break;
}
case 4: {
enterOuterAlt(_localctx, 4);
setState(452);
setState(457);
match(QuilParser::PI);
break;
}
......@@ -3982,9 +4028,9 @@ QuilParser::ImaginaryNContext* QuilParser::imaginaryN() {
});
try {
enterOuterAlt(_localctx, 1);
setState(455);
setState(460);
realN();
setState(456);
setState(461);
match(QuilParser::I);
}
......@@ -4038,7 +4084,7 @@ QuilParser::RealNContext* QuilParser::realN() {
});
try {
enterOuterAlt(_localctx, 1);
setState(458);
setState(463);
_la = _input->LA(1);
if (!(_la == QuilParser::INT
......@@ -4072,9 +4118,10 @@ bool QuilParser::sempred(RuleContext *context, size_t ruleIndex, size_t predicat
bool QuilParser::expressionSempred(ExpressionContext *_localctx, size_t predicateIndex) {
switch (predicateIndex) {
case 0: return precpred(_ctx, 8);
case 1: return precpred(_ctx, 7);
case 2: return precpred(_ctx, 6);
case 0: return precpred(_ctx, 9);
case 1: return precpred(_ctx, 8);
case 2: return precpred(_ctx, 7);
case 3: return precpred(_ctx, 6);
default:
break;
......@@ -4142,7 +4189,7 @@ QuilParser::Initializer::Initializer() {
_serializedATN = {
0x3, 0x608b, 0xa72a, 0x8133, 0xb9ed, 0x417c, 0x3be7, 0x7786, 0x5964,
0x3, 0x40, 0x1cf, 0x4, 0x2, 0x9, 0x2, 0x4, 0x3, 0x9, 0x3, 0x4, 0x4,
0x3, 0x40, 0x1d4, 0x4, 0x2, 0x9, 0x2, 0x4, 0x3, 0x9, 0x3, 0x4, 0x4,
0x9, 0x4, 0x4, 0x5, 0x9, 0x5, 0x4, 0x6, 0x9, 0x6, 0x4, 0x7, 0x9, 0x7,
0x4, 0x8, 0x9, 0x8, 0x4, 0x9, 0x9, 0x9, 0x4, 0xa, 0x9, 0xa, 0x4, 0xb,
0x9, 0xb, 0x4, 0xc, 0x9, 0xc, 0x4, 0xd, 0x9, 0xd, 0x4, 0xe, 0x9, 0xe,
......@@ -4211,250 +4258,253 @@ QuilParser::Initializer::Initializer() {
0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b,
0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x5, 0x2b, 0x1aa,
0xa, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3,
0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x3, 0x2b, 0x7, 0x2b, 0x1b5, 0xa, 0x2b,
0xc, 0x2b, 0xe, 0x2b, 0x1b8, 0xb, 0x2b, 0x3, 0x2c, 0x3, 0x2c, 0x3, 0x2c,
0x3, 0x2c, 0x3, 0x2c, 0x3, 0x2c, 0x3, 0x2d, 0x3, 0x2d, 0x3, 0x2e, 0x3,
0x2e, 0x3, 0x2f, 0x3, 0x2f, 0x3, 0x2f, 0x3, 0x2f, 0x5, 0x2f, 0x1c8,
0xa, 0x2f, 0x3, 0x30, 0x3, 0x30, 0x3, 0x30, 0x3, 0x31, 0x3, 0x31, 0x3,
0x31, 0x2, 0x3, 0x54, 0x32, 0x2, 0x4, 0x6, 0x8, 0xa, 0xc, 0xe, 0x10,
0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e, 0x20, 0x22, 0x24, 0x26, 0x28,
0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e, 0x40,
0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58,
0x5a, 0x5c, 0x5e, 0x60, 0x2, 0xa, 0x4, 0x2, 0x7, 0x7, 0x2a, 0x2a, 0x3,
0x2, 0x1a, 0x1c, 0x3, 0x2, 0x1d, 0x20, 0x3, 0x2, 0x2d, 0x2e, 0x3, 0x2,
0x2a, 0x2b, 0x3, 0x2, 0x28, 0x29, 0x3, 0x2, 0x23, 0x27, 0x3, 0x2, 0x2e,
0x2f, 0x2, 0x1dd, 0x2, 0x62, 0x3, 0x2, 0x2, 0x2, 0x4, 0x64, 0x3, 0x2,
0x2, 0x2, 0x6, 0x75, 0x3, 0x2, 0x2, 0x2, 0x8, 0x7b, 0x3, 0x2, 0x2, 0x2,