Repository navigation
Conversation
…erify io/printf (new, mechanical both ways) turns a literal printf format into an f-string field by field and carries out the format's recycling statically; one array argument recycles it per element or per column as a loop (or a "".join for sprintf). %d of a value not known to be a whole number, %s of a number, %x/%c/%u, * widths, file ids other than 1, empty arrays and disp of a number are declined by name. io/display keeps the missing-semicolon case and stays guided. builtins/filter (new) is scipy.signal.lfilter, axis=0 for a matrix; SciPy becomes a dependency. types/double (new) covers double()/logical() and x.astype(float)/astype(bool), which the filter translation needs. verify gains `% dualect: stdout`, comparing printed text exactly (the .m side captured with evalc), and `% dualect: shape r` for random values; translations that print add the directive themselves. -0 now keeps its sign. corpus/beam_deflection.m and corpus/signal_filter.m translate fully and verify in both directions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rules teach the analysis what their built-ins return (infer_call, infer_outputs, pyinfer_call in translate.py), so a new built-in stays one folder; multi-output built-ins lift through their own rule's lift_multi. New rules, with cases in both languages: cumsum-cumprod, diff, any-all, sort (stable index output), unique, flip, reshape (column-major), repmat, concatenation-functions (cat/horzcat/vertcat), meshgrid, rand-randn (compared by shape), norm, dot-cross-kron, linear-algebra (inv/det/trace/ rank), std-var (N-1), median, interp1 (NaN outside the range), polyfit- polyval, trapz, type-tests, num2str, tic-toc (guided). Extended: constants (true/false/Inf/NaN with sizes), elementwise-math (floor division, real/imag/conj/log1p/expm1, mod/rem sign rules), size-numel- length (ndims), sum-mean-max (min case, dtype=float lift). Forms that cannot be proved are declined by name. The Octave runner resets `format` between scripts (a `format long` leaked into later display output), and Python-to-.m verification honours the source's shape and stdout directives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rpus scripts Promoted to mechanical after `dualect rules check` qualified them: functions/multiple-returns (.m -> Python: tuple unpacking, `_`, output slices; nargout-dependent bodies split into a guided functions/nargout), functions/nargin (both ways: literal defaults in the header, None defaults with `is None`/isempty when no caller may pass an empty value), indexing/grow-on-assign (both ways: np.append, np.pad, np.zeros) and syntax/command-syntax (display-only commands dropped with a comment, `clear a b` is `del a, b`). io/display stays guided: the display format of a missing semicolon depends on the value. Integer powers: every exponent of 2 or more on an integer array, or on an element read out of one, is a float, and an integer matrix power works in floats (x .^ 2 wrapped around above 3037000499). A tall A \ b is a least-squares solve; [m, i] = max(A) of a matrix gives per-column rows. Adversarial probes of every new rule, both directions, against Octave: tests/test_adversarial*.py. New corpus scripts: least_squares_fit.m, data_statistics.m, grid_heat.m. README, docs/index.html, CLAUDE.md and design.md carry the new numbers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plain `octave` resolves to octave-gui, which macOS treats as a foreground app and shows in the Dock on every test run. An explicit OCTAVE_EXECUTABLE still wins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Makes dualect useful on more real scripts.
Changes
printf/fprintf/sprintf/dispformat translation andfilter()→scipy.signal.lfilter.beam_deflectionandsignal_filternow translate fully and verify in both directions. Verify can now compare printed output (% dualect: stdout)..m→ Python: 58 mechanical, 3 guided. Python →.m: 54 mechanical, 1 guided. Each rule supplies its own inference facts through hooks, so a new built-in stays one folder.nargin, grow-on-assign, command-syntax. Still guided: display,nargout,tic/toc.x .^ 2andA ^ 3, lost sign of-0,format longleaking between scripts, and several shape/view/dtype bugs; NaN-sensitive and other unprovable forms are declined by name. Regression tests added.least_squares_fit(26/27),data_statistics(27/28),grid_heat(20/26); holes are reported, not hidden.octave-cliso macOS does not show a Dock icon per run.docs/index.html(TagCheck: 0 errors, 0 warnings), CLAUDE.md andllms.txtupdated.Test plan
uv run pytest(1409 passed locally, Octave 11)dualect rules check🤖 Generated with Claude Code