On Fri, Apr 12, 2013 at 1:55 PM, Dmitry Kakurin <dmitry.kaku...@gmail.com>wrote:

> Here is where my question is coming from:
> If I were to use such parser in production I'd like it to be unambiguous.
> And I'd like to detect ambiguity early, before my software ships/deployed.
> Preferably during build/packaging/deployment time.
> But since for Clojure projects all these things are somewhat fuzzy, at
> very least I'd like to detect ambiguity during my app startup.
> I.e. I'd like to put a big fat assert during initialization phase.
>
> Is there a way to do it now (or planned in the future)?
>
>
>From the Wikipedia article on ambiguous grammars:
"The general decision
problem<http://en.wikipedia.org/wiki/Decision_problem>of whether a
grammar is ambiguous is
undecidable <http://en.wikipedia.org/wiki/Undecidable_problem>..."

So it is impossible to make a tool that can tell you whether a parser is
ambiguous.  I believe there are ways to detect certain classes of
ambiguity, or warn of potential problems.  I have no idea how well those
techniques work and how hard they are to implement.  I'll add that to my
list of things to research someday.  But for now, ambiguity has to be
tested with test cases, just as you'd do for other aspects of your code.

--Mark

P.S.  All the other things you stated, checking for understanding, were
correct.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to