simpler over view on dao: a functional logic solver with builtinparsing power, and dinpy, the sugar

Discussion in 'Python' started by Simeon Chaos, Nov 8, 2011.

  1. Simeon Chaos

    Simeon Chaos Guest

    Dao is a a functional logic solver (similar to lambdaProlog, Curry)
    written in python. The links related to dao are here:

    pypi distribution and document: http://pypi.python.org/pypi/daot

    code repository: https://github.com/chaosim/dao

    dao groups on google: http://groups.google.com/group/daot,


    old stuffs: http://code.google.com/p/daot(old, deprecated)

    google+ pages: https://plus.google.com/112050694070234685790

    Dao has the features such as

    * lisp style programming:

    * call/cc, block/return-from, unwind-protect, catch/throw;

    * function and macro;

    * eval, so called meta circular evaluation.

    * prolog style programming:

    * logic variable and unify;

    * backtracking;

    * findall, repeat/fail, call, once, and so on;

    * cut.

    * many other useful builtins that simulate lisp and prolog
    primitives.

    * some builtins that cooperate with python.

    * builtin parser, which is the most powerful parser I have seen, it
    support the features as below:

    * paramater grammar, similar to DCG( definite clause grammar),
    but more flexible
    * dynamic grammar,
    * left recursive
    * memoriaziont parsing result
    * many builtins, include terminal and cominative matchers.

    -------------------------------------------------------------------------

    Dinpy: a child language born and live in python.

    Dinpy can be looked as the syntax sugar for dao in python. A piece
    of code in dinpy is listed as below:

    parse_text(char(x1)+any(~char('b')+some(char(x1)))+eoi,
    'abaaaa'),

    let( i<<0 ). do[ repeat, prin(i), ++i, iff(i<3).do[fail] ],

    letr( a << fun(x) [ and_p(b(x),c(x)) ]
    [ d(x) ],
    b << fun(1) ['b1']
    (4) ['b4'],
    c << fun(4) ['c4'],
    d << fun(3) ['d3'],
    ).do[
    a(x), prin(x) ],

    each(i)[1:3].
    loop[prin(i)],

    i << 0,
    loop[ i << i+1, prin(i)].when(i==3),

    case(1).
    of(1)[prin(1)].
    of(2)[prin(2)]

    --------------------------------------------------------------------------

    Some Chinese documents for dao is written, but few English. The
    Chinese document is not complete yet.

    With the functional logic programming and dynamic grammar on the
    shoulders of the great python, many possibilities arises with dao,
    such as parsing, inventing embedded DSL with operator syntax,
    independent domain specific language or general language, text
    processing, natural language processing, expert system, artificial
    intelligence, web application, and so on.

    Now:

    * I hope more people know and use dao. Or maybe something wrong in dao
    prevent it being used in real application, and I hope to know what it
    is.

    * Maybe anyone have interest and time to join in developing dao or
    writing some documents or articles?

    * More tests are needed always, and I hope to get some bug report from
    any other people.

    * the benchmarks of the dao, comparation with similar package, and so
    on.

    * I have a long todo list, I hope someone else can join in dao project.
     
    Simeon Chaos, Nov 8, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    8
    Views:
    371
    Mark Dickinson
    Apr 17, 2008
  2. spike
    Replies:
    8
    Views:
    1,471
    Steve Holden
    Feb 9, 2010
  3. Parthiv Joshi
    Replies:
    1
    Views:
    689
    Samuel L Matzen
    Jul 6, 2004
  4. Simeon Chaos
    Replies:
    0
    Views:
    186
    Simeon Chaos
    Nov 6, 2011
  5. Philip Rhoades
    Replies:
    4
    Views:
    104
    James Britt
    Jun 29, 2008
Loading...

Share This Page