[Chore] Extract shared term constructors into Transform.Lib#7774
Open
[Chore] Extract shared term constructors into Transform.Lib#7774
Conversation
1088be1 to
cb93062
Compare
cb93062 to
17bf5d4
Compare
Move helpers (`var`, `lam`, `app`, `delay`, `case_`, `builtin`, `addInteger`) from `Transform.Inline.Spec` into a new shared `Transform.Lib` module, extend with `force`, `con`, `err`, `headList`, `ite`, `true`, `false`, `constr`, and a `T` alias for `Term Name DefaultUni DefaultFun ()`. Migrate `Transform.Simplify.Spec` to use these helpers throughout, replacing inline `LamAbs ()` / `Apply ()` / `Force ()` / `Delay ()` / `Var ()` / `Builtin ()` / `Error ()` / `mkConstant @integer ()` / `Constr ()` / `Case () _ (V.fromList _)` constructors and per-test `plus`/`con` duplicates. Inline trivial `let one = con 1` / `two = con 2` / `three = con 3` bindings. Local bindings that shadowed top-level helpers are renamed to semantic identifiers describing their role (`dupLam`, `forceAddLam`, `applyLam`, `delayLam`, `trueBranch`, `falseBranch`). No behaviour change; all goldens unchanged.
17bf5d4 to
6426ff9
Compare
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.
Preparatory refactor before changing CSE tests in a follow-up PR.
Transform.Inline.Specalready had a section of UPLC term-construction helpers (var,lam,app,delay,case_,builtin,addInteger).Transform.Libmodule reusable across other test specs in the same testlib.