Closed RamonMeffert closed 3 years ago
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.
This'll also end up fixing #24 when I implement the package I mentioned above
(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:
A ∧ B ∨ (C ∧ D)
is valid, but A ∧ ∨ (C ∧ D)
is not)
And
or Or
(A) ∧ (B) ∧ ((C))
A ∧ ¬A
(A ∧(A ∧(A ∧(A ∧(A ∧(A ∧(A ∧(A ∧(A ∧ B))))))))
– that's hard to renderThen, 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 Bool
s 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.
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
I.e. a way to combine constituents in the UI to create a protocol