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

Replace recursive synthesis tree via flat Map #241

Open
ryukzak opened this issue Mar 31, 2023 · 0 comments
Open

Replace recursive synthesis tree via flat Map #241

ryukzak opened this issue Mar 31, 2023 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@ryukzak
Copy link
Owner

ryukzak commented Mar 31, 2023

Motivation:

  • simplify data structures.
  • minor optimisation.

Current:

data Tree m tag v x t = Tree
    { sID :: Sid
    , sState :: SynthesisState m tag v x t
    , sDecision :: SynthesisDecision (SynthesisState m tag v x t) m
    , sSubForestVar :: TMVar [Tree m tag v x t]
    -- ^ lazy mutable field with different synthesis options and sub nodes
    }

Which allow to represent the following synthesis tree, where sSubForestVar will evaluated on request:

  • - - A
    • -1 - B
      • -1-1 - C
      • -1-2 - D
    • -2 - E
      • -2-1 - F
      • -2-2 - G

What to need to change here (naming and detail may variate, also we need to estimate what is better: Map or HashMap for our task):

data Tree m tag v x t = TVar (Map Sid Node)

data Node = Node
    { sID :: Sid
    , sState :: SynthesisState m tag v x t
    , sDecision :: SynthesisDecision (SynthesisState m tag v x t) m
    }

Which represent the same tree in the following way:

M.fromlist [
    ("-", A),
    ("-1", B),
    ("-1-1", C),
    ("-1-2", D),
    ("-2", E),
    ("-2-1", F),
    ("-2-2", G),
]
@ryukzak ryukzak changed the title Replace real synthesis tree via Replace recursive synthesis tree via flat Map Mar 31, 2023
@OlegMatveevS OlegMatveevS moved this to 🏗 In progress in NITTA Project Apr 3, 2023
@OlegMatveevS OlegMatveevS self-assigned this Apr 3, 2023
@ryukzak ryukzak added the help wanted Extra attention is needed label Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Status: To triage
Status: 🏗 In progress
Development

No branches or pull requests

2 participants