Skip to content

Commit

Permalink
Merge branch 'main' of github.com:fmlab-iis/AutoQ
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyhuang1007 authored and johnnyhuang1007 committed Aug 27, 2024
2 parents b058567 + 3ed5c81 commit d2c2f21
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cli/autoq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ try {
adjust_N_in_nTuple(circuit2);
});

CLI::App* printC = app.add_subcommand("printC", "Print the Concrete Language");
printC->add_option("states.{hsl|spec}", pre, "the automaton file")->required()->type_name("");
CLI::App* printS = app.add_subcommand("printS", "Print the Symbolic Language");
printS->add_option("states.{hsl|spec}", pre, "the automaton file")->required()->type_name("");
CLI::App* printP = app.add_subcommand("printP", "Print the Predicate Language");
printP->add_option("states.{hsl|spec}", pre, "the automaton file")->required()->type_name("");

// bool short_time = false, long_time = false;
// app.add_flag("-t", short_time, "print times");
// app.add_flag("--time", long_time, "print times");
Expand Down Expand Up @@ -265,6 +272,15 @@ try {
} else {
std::cout << "The two quantum programs are verified to be [" << (result ? "equal" : "unequal") << "] in [" << AUTOQ::Util::Convert::toString(chrono::steady_clock::now() - start) << "] with [" << AUTOQ::Util::getPeakRSS() / 1024 / 1024 << "MB] memory usage.\n";
}
} else if (printC->parsed()) {
AUTOQ::TreeAutomata aut = AUTOQ::Parsing::TimbukParser<AUTOQ::Symbol::Concrete>::ReadAutomaton(pre);
aut.print_language();
} else if (printS->parsed()) {
AUTOQ::SymbolicAutomata aut = AUTOQ::Parsing::TimbukParser<AUTOQ::Symbol::Symbolic>::ReadAutomaton(pre);
aut.print_language();
} else if (printP->parsed()) {
AUTOQ::PredicateAutomata aut = AUTOQ::Parsing::TimbukParser<AUTOQ::Symbol::Predicate>::ReadAutomaton(pre);
aut.print_language();
}
/**************/
// if (long_time) {
Expand Down
2 changes: 2 additions & 0 deletions src/timbuk_parser-nobison.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ AUTOQ::Automata<Symbol> from_tree_to_automaton(std::string tree, const std::map<
predicate = predicates.at(t);
++it2;
}
if (default_prob.empty())
default_prob = "true";
typename AUTOQ::Automata<AUTOQ::Symbol::Predicate>::State pow_of_two = 1;
typename AUTOQ::Automata<AUTOQ::Symbol::Predicate>::State state_counter = 0;
for (int level=1; level<=aut.qubitNum; level++) {
Expand Down

0 comments on commit d2c2f21

Please sign in to comment.