Repository navigation
Repository cleanup: stray files, dead code and duplicated logic - #63
Merged
Merged
Conversation
- .DS_Store: macOS folder metadata (now ignored). - .travis.yml: Travis CI configuration for GCC 4.8; CI runs on GitHub Actions. - .vscode/settings.json: editor-specific file associations. - unit_tests/reference_answers/: not used by any test or script. The .aut files use a header the current parser rejects, and artifact_evaluation.sh calls a command-line syntax that no longer exists. - .gitignore: drop entries for directories that no longer exist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013gtFQRPe1eSSpmA7EJ2KNY
- AUTOQ::Constraint and AUTOQ::check_validity: no callers since the
commented-out SymbolicAutomata <= PredicateAutomata operator was
deleted. inclusion_symbolic.cc now includes <regex> itself.
- CLI: the SIGALRM timeout handler, set_timeout() and their globals and
constants were never armed (both calls were commented out); also
drop the unused `Aut` alias in run_verification_impl, and reuse the
already parsed precondition in run_verification instead of parsing
pre.hsl again.
- cli/CMakeLists.txt: -DCACHE_AC -DCACHE_OPT_CONGR are not referenced by
any source file.
- ReadTwoAutomata: the `|| find("Predicates")` clause had no effect,
because parse_constants_section returns at once without a Constants
section. The condition now matches ReadAutomaton.
- Remove the old hand-written parser headers (predicate_parser.hh,
complex_parser.hh, constraint_parser.hh, symboliccomplex_parser.hh).
Three were only includes, commented-out code and global
using-declarations; qualify the three uses of Complex that relied on
those.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013gtFQRPe1eSSpmA7EJ2KNY
…ser (fmlab-iis#57) EvaluationVisitor::switch_symbol_to_second started as false and was never set, so the operator()<Symbol2>() branches could not run. Remove the flag and the Symbol2/SymbolType2 template parameter; TimbukParser<Symbol, Symbol> is now written TimbukParser<Symbol>, and the TimbukParser<Symbolic, Predicate> instantiation goes away. In the unit tests, run_single_folder_benchmark had two identical branches (TimbukParser<Symbolic> and TimbukParser<Symbolic, Symbolic> were the same type); merge them and drop the flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013gtFQRPe1eSSpmA7EJ2KNY
Util::print_duration and Convert::ToString(duration) had drifted apart. Keep Convert::ToString and use it for the per-gate log too; the only visible difference is that a gate taking between one hour and one day is logged as 1h5m5s instead of 0d1h5m5s. Also drop the ss.fill('0') calls, which had no effect without a field width.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013gtFQRPe1eSSpmA7EJ2KNY
- ConstrainedComplex::operator*: the two size branches had identical bodies. The merge is symmetric, so bind the smaller and the larger operand and keep a single loop (and fix the comment on the local-constraint loop). - ConcreteAutomata inclusion: the ratio-consistency check ran four times per leaf pair inside a loop whose index was never used; run it once. - mapped_vector: compare through const references instead of copying both maps on every comparison. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013gtFQRPe1eSSpmA7EJ2KNY
…mlab-iis#57) Both loops were written twice: the header scan in the single and the n-ary *_from_istream parsers, the constraints loop in ReadAutomaton and ReadTwoAutomata. Move each into an inline helper (read_extended_dirac_body, append_constraints_as_smt) next to its callers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013gtFQRPe1eSSpmA7EJ2KNY
…lab-iis#57) The graph search in ConcreteAutomata::operator<<= and in the symbolic scaled inclusion was the same code twice (about 190 identical lines). Move it into include/autoq/inclusion_bfs.hh as a template; each variant now supplies a small leaf policy: Concrete checks that B's amplitudes are a common nonzero multiple of A's for each combination of transitions, Symbolic collects the leaf pairs of a vertex and asks the SMT solver at a leaf vertex. The inclusion-time statistics are recorded exactly as before. The Index variant enumerates B's transitions differently and stays separate. All three copies filled a possible_colors_for_qA map that was never read; it is gone, along with the commented-out code that used it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013gtFQRPe1eSSpmA7EJ2KNY
…s#57) These blocks belonged to an earlier way of numbering the copied states and have been commented out since. Only comments are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013gtFQRPe1eSSpmA7EJ2KNY
ondrik
marked this pull request as draft
October 20, 2026 10:17
alan23273850
marked this pull request as ready for review
October 21, 2026 07:16
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses most of #57 (the remaining item is listed below).
A cleanup of the repository with no change in behaviour: stray and obsolete files, and the items of #57 that are pure cleanups. Each commit covers one topic, so the PR is easiest to review commit by commit.
Files
.DS_Store(now ignored),.travis.yml(Travis configuration for GCC 4.8; CI runs on GitHub Actions) and.vscode/settings.json.unit_tests/reference_answers/. No test or script uses it. Its.autfiles use a header the current parser rejects, andartifact_evaluation.shcalls a command-line syntax that no longer exists..gitignore: drop entries for directories that no longer exist (python_interface,backup,equivalence_or_not,dyadic,revlib,POPL24).Code (#57)
Dead code
AUTOQ::ConstraintandAUTOQ::check_validity, which have no callers.Autalias.-DCACHE_AC -DCACHE_OPT_CONGRfromcli/CMakeLists.txt; no source file reads them.|| find("Predicates")clause inReadTwoAutomata.predicate_parser.hh,complex_parser.hh,constraint_parser.hh,symboliccomplex_parser.hh) and qualify the three uses ofComplexthat relied on their globalusing.switch_symbol_to_secondand the unused second symbol type ofEvaluationVisitor/TimbukParser:TimbukParser<Symbol, Symbol>is nowTimbukParser<Symbol>. Also remove the commented-outchildStateMapcode in CX, CZ and CCX.Duplicated logic
The inclusion search shared by Concrete and Symbolic automata now lives in
include/autoq/inclusion_bfs.hh. Each variant supplies a small leaf policy:The inclusion-time statistics are recorded as before. The Index variant enumerates B's transitions differently and stays separate; only its unused
possible_colors_for_qAmap is removed.Keep one duration formatter,
Convert::ToString. The only visible difference is in the per-gate debug log: a gate taking between 1 h and 1 day is logged as1h5m5sinstead of0d1h5m5s.Merge the two identical branches of
ConstrainedComplex::operator*and of the unit-test helperrun_single_folder_benchmark.Move the Extended Dirac header scan and the constraints-to-SMT loop, which were each written twice, into helpers.
Small inefficiencies
mapped_vectorcomparisons no longer copy both maps.run_verificationreuses the parsed precondition instead of parsingpre.hslagain.Not in this PR
Merging the four tree-duplication loops (CX with
c < t, CZ, CCX withc < c2 < t,diagonal_gate). They differ in details that change the resulting automata:diagonal_gatecreates an empty transition entry for every copied state;hasLooplevel;diagonal_gaterescales leaves;Merging them is a rewrite of the gate algorithms and deserves its own PR.
run_executionparsingpretwice throughReadTwoAutomata(pre, pre, circuit). That call also computes the joint qubit order, so it is not a pure cleanup.docs/old_README.md(the AutoQ 1.0 README) is kept. It may still serve as the CAV'23 artifact's documentation.Testing
ctestpasses (2/2).main: I ran 648 benchmark instances with bothverandex. They are drawn from every family inbenchmarks/andunit_tests/testcase: all instances of the smaller families and of the per-paper folders, and for the 1000-instance families the first 15 and every 50th. Each run had a 20 s limit.main, and all 645 outputs are identical with this branch, ignoring time and memory figures:ververdicts: 462[OK], 36[failed];exruns, each printing the full resulting set of states.🤖 Generated with Claude Code
https://claude.ai/code/session_013gtFQRPe1eSSpmA7EJ2KNY