|
Boost : |
From: Darren Cook (darren_at_[hidden])
Date: 2004-09-13 23:59:17
> =========== Is UBL feasible?===================
>
> The short answer is yes. I already have the prototype up and running in VC++
> 7.1. The 8-queen problem takes less than 28 seconds on my Athlon 2200+ to
> find all answers.
How much does the plain prolog version take on the same hardware? I assume
the motivation for using C++ is a speed-up?
And how many lines of code was the C++ version compared to the prolog one?
Is there a native C or C++ solution to the 8 queen problem for comparison?
> 2. syntax wise UBL predicates are not as straight-forward or visually
> appealing as the equivalent predicates in Prolog.
[Example included at bottom]
I think you will have an uphill battle to persuade people to use the library
because of this. Is a compiler or macro feasible to allow me to write the
prolog one liner and have it turned into the C++ equivalent. (I don't use
prolog but could understand and appreciate the prolog code example.)
Darren
Here is a predicate in
> UBL:
>
> BOOST_UBL_PREDICATE_2_( is_grandfather_of, Person, Person )
> {
> BOOST_UBL_VARIABLES_3
> (
> Person, X
> , Person, Y
> , Person, Z
> );
>
> typedef clause< LHS<X, Y>
> , is_father_of< X, Z >
> , is_father_of< Z, Y >
> > type;
> };
>
> Here is the equivalent predicates in Prolog:
>
> is_grandfather_of(X, Y) :- is_father_of(X, Z), is_father_of( Z, Y).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk