Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete substitutions #8

Open
blamario opened this issue Feb 7, 2022 · 2 comments
Open

Incomplete substitutions #8

blamario opened this issue Feb 7, 2022 · 2 comments

Comments

@blamario
Copy link

blamario commented Feb 7, 2022

When I feed shrinkScript this UPLC: "(program 1.0.0 ((\i0 -> force i1 (\i0 -> \i0 -> \i0 -> i2)) ((\i0 -> \i0 -> \i0 -> (\i0 -> \i0 -> i2 i4 6 "Hello") (\i0 -> \i0 -> \i0 -> delay (\i0 -> i1 i4 i3 i2)) (\i0 -> i1)) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1)) (\i0 -> i1))))"`

I get "(program 1.0.0 (force ((\\i0 -> delay (\\i0 -> i1 (delay (\\i0 -> \\i0 -> i1)) 6 i2)) \"Hello\") (\\i0 -> \\i0 -> \\i0 -> i2)))"

but there's obvious opportunity to reduce it further: (\\i0 -> delay (\\i0 -> i1 (delay (\\i0 -> \\i0 -> i1)) 6 i2)) \"Hello\") ==> (delay (\\i0 -> i1 (delay (\\i0 -> \\i0 -> i1)) 6 \"Hello\")))

@blamario
Copy link
Author

blamario commented Feb 7, 2022

@blamario
Copy link
Author

I worked around the problem by running the shrinker thrice:

printShrunkCode :: CompiledCode a -> String
printShrunkCode = printScript . shrink . shrink . shrink . fromCompiledCode
  where
    shrink = shrinkScriptSp (withoutTactics ["strongUnsubs", "weakUnsubs"])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant