Giter Club home page Giter Club logo

Comments (5)

RamonMeffert avatar RamonMeffert commented on May 26, 2024

When this is done, it might be a nice idea to integrate a way to simplify protocols (normal forms are probably useful for this). This would then also allow us to check whether a newly created protocol isn't just the same as an older one.

from elm-gossip.

RamonMeffert avatar RamonMeffert commented on May 26, 2024

https://package.elm-lang.org/packages/annaghi/dnd-list/latest/

from elm-gossip.

RamonMeffert avatar RamonMeffert commented on May 26, 2024

This'll also end up fixing #24 when I implement the package I mentioned above

from elm-gossip.

RamonMeffert avatar RamonMeffert commented on May 26, 2024

(These are basically some notes for myself)

I have a rough draft for a drag-'n-drop system for boolean combinations of gossip protocol constituents that I think is pretty neat, but it needs:

  • validation (so A ∧ B ∨ (C ∧ D) is valid, but A ∧ ∨ (C ∧ D) is not)
    • All constituents or groups must be separated by And or Or
    • Groups should not contain singletons (so don't allow (or at least warn against) (A) ∧ (B) ∧ ((C))
    • Don't allow groups to self-nest by dragging
  • (Possibly) valuation checking to warn against (some) constructions that are impossible, e.g. A ∧ ¬A
  • conversion (i.e. parsing) to usable protocol
  • A way to make groups (i.e. stuff in parentheses) draggable, probably with drag handles
  • A way to restrict grouping depth, so people don't start making protocols like (A ∧(A ∧(A ∧(A ∧(A ∧(A ∧(A ∧(A ∧(A ∧ B)))))))) – that's hard to render

Then, I need to convert the current predefined protocols to the new format.

Currently, I'm using the following type:

type BoolElement 
    = And
    | Or
    | Token Bool Constituent
    | Group Bool (List BoolElement)

The Bools are negation parameters, so Token True IsEmpty would mean σₓ = ϵ and Token False IsEmpty would mean σₓ ≠ ϵ (or ¬(σₓ = ϵ))

Based loosely on the following LL(1) grammar:

Expression   -> Token Expression'
Expression'  -> or Token Expression' | ε
Token        -> Final Token'
Token'       -> and Final Token' | ε
Final        -> Negation Final'
Negation     -> not | ε
Final'       -> ( Expression ) | constituent

Note that the use of Group makes parsing a lot easier. Also, by constraining the type and allowing only certain modifications in the interface, it should be possible to use the validation step to make sure parsing is possible, using a couple of relatively simple rules.

from elm-gossip.

RamonMeffert avatar RamonMeffert commented on May 26, 2024

Plan for the showable version: Add a note saying that this is in progress w/ a link to (the cleaned up version of) a live version of the repository mentioned above, and include it in the query as a hypothetical

from elm-gossip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.