Skip to content
Brian Marco edited this page Nov 27, 2018 · 9 revisions

Idea

If we can think of queries as formal parsers then we can explore the exact characteristics of what a query with traces can and can't accomplish. We can then use this to know when traces will fail and a more complex syncing mechanism is required. Whatever we can define as a Parsing Expression Grammar (PEG) has a known linear time parser called a packrat parser

Regular Pull Expressions

I think pull expression are equivalent to regular expressions in their expressivity. This is why they are easier to trace. Maybe pull expressions are a slightly different type than regular expressions, I haven't thought too deeply on this point?

PEG Queries

Queries plus rules may be equivalent to a Parsing Expression Grammar.

  • Terminals - Strings, blobs, dates, etc
  • Nonterminals - refs/entities

If we can figure out a mapping then we can use a packrat parser to do the traces.

Mildly context sensitive

https://en.wikipedia.org/wiki/Mildly_context-sensitive_grammar_formalism

There are a few good candidates for adding context to queries aka datview (or maybe even for syncing queries)

Tree-adjoining

Combinatory categorial

Linear Indexed

Indexed

Some Parser Bulding Block Concepts

EAV

  • are labeled productions E -A-> V
  • EAV describe trees with rewrites???
  • EAV form graphs

Schema

  • entities that describe terminals and non-terminals