I was wondering if anyone on the list is aware of research of adding
temporal conditionals (pre/post) to PEGs to generate context sentiments
grammars capable of modeling transitions of a state machine. Has anyone
explored using a set of preconditional or postconditional predicates to
modify a given pattern? Also, has any looked at using multiple matches to
mimic concurrency or parallelism?
I was thinking of it in terms of a washing machine example, say a washing
machine operation grammar defined a language as:
Precondition <- Predicate. # defines a match only when the left hand
side has been matched, <- is read precedes
wash -> fill with water.
wash -> release soap.
wash -> agitate drum.
Insert quarter {18} <- wash. # need $4.50 in quarters to start machine
{18} repeats
Select cycle <- wash.
Lock door <- wash.
wash 20 minutes <- spin. # can not enter spin till we see wash 20
minutes on input stream
If you think of a program as a sequence of messages passing by the PEG
producing matches over time, you could see how nicely this can map to
certain classes of difficult distributed programming problems. Some tasks
which can happen in parallel like filling the drum with water, releasing
the soap, and spinning the drum, are naturally parallel if no order is
imposed by the rule engine. Preconditions provide a way to ensure
dependencies are met prior to a match being found. I would love to see if
anyone did any research into this sort of application.
Dave
--
-=-=-=-=-=-=-=-=-=-=- http://blog.dloh.org/
_______________________________________________
fonc mailing list
[email protected]
http://vpri.org/mailman/listinfo/fonc