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


Simeon Chaos

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:

code repository:

dao groups on google:,
(e-mail address removed)

old stuffs:, deprecated)

google+ pages:

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

* 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:


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'],
a(x), prin(x) ],


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



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.


* 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

* 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

* I have a long todo list, I hope someone else can join in dao project.


Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question