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

Better CESK machine pretty-printing #948

Merged
merged 8 commits into from
Jan 4, 2023
Merged

Better CESK machine pretty-printing #948

merged 8 commits into from
Jan 4, 2023

Conversation

byorgey
Copy link
Member

@byorgey byorgey commented Jan 2, 2023

Closes #644. Currently this only helps for debugging, but a first step towards #5.

Some kind-of-randomly-selected before/after examples:

BEFORE:

▶ say
  [_ "Ready!" | exec _]
◀ say
  [_ "Ready!" | exec _]
▶ "Ready!"
  [say _ | exec _]
◀ "Ready!"
  [say _ | exec _]
◀ say "Ready!"
  [exec _]
◀ ()
  []

AFTER:

E· (▶say◀ "Ready!")
E· (◀say▶ "Ready!")
E· (say ▶"Ready!"◀)
E· (say ◀"Ready!"▶)
E· ◀say "Ready!"▶
◀()▶

BEFORE:

▶ c
  [exec _ | b <- _ ; if b {noop} {force until c} | _ ∪ <Env> | _ ; grab | _ ∪ <Env> | loadEnv]
◀ as <a1> {has "Win"}
  [exec _ | b <- _ ; if b {noop} {force until c} | _ ∪ <Env> | _ ; grab | _ ∪ <Env> | loadEnv]
◀ false
  [b <- _ ; if b {noop} {force until c} | _ ∪ <Env> | _ ; grab | _ ∪ <Env> | loadEnv]
▶ if b {noop} {force until c}
  [exec _ | _ ∪ <Env> | _ ; grab | _ ∪ <Env> | loadEnv]
▶ if b {noop}
  [_ {force until c} | exec _ | _ ∪ <Env> | _ ; grab | _ ∪ <Env> | loadEnv]
▶ if b
  [_ {noop} | _ {force until c} | exec _ | _ ∪ <Env> | _ ; grab | _ ∪ <Env> | loadEnv]

AFTER:

L· ∪· ((b <- E· ▶c◀ ; if b {noop} {force until c}) ; grab)
L· ∪· ((b <- E· ◀as <a1> {has "Win"}▶ ; if b {noop} {force until c}) ; grab)
L· ∪· ((b <- ◀false▶ ; if b {noop} {force until c}) ; grab)
L· ∪· (∪· E· ▶if b {noop} {force until c}◀ ; grab)
L· ∪· (∪· E· (▶if b {noop}◀ {force until c}) ; grab)
L· ∪· (∪· E· (▶if b◀ {noop} {force until c}) ; grab)

@byorgey byorgey requested a review from xsebek January 2, 2023 22:27
Copy link
Member

@xsebek xsebek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks amazing! I really wish we could open some debugging window in the game and see all the robot frame updates during the last tick. 🤩

@byorgey byorgey added the merge me Trigger the merge process of the Pull request. label Jan 4, 2023
@mergify mergify bot merged commit 1fa13f2 into main Jan 4, 2023
@mergify mergify bot deleted the feature/pretty-CESK branch January 4, 2023 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Trigger the merge process of the Pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better pretty-printing for CESK machine states
2 participants