logo       


Re: count operator in bddbddb: msg#00004

Subject: Re: count operator in bddbddb
Hi John,

Thanks for the pointers. Yeah, we actually needed a much simplified version of count() like you specified, finding out something similar to "Does this variable point to more than 1 object/ exactly one object or to no object"

regards,
Prakash

On 1/24/07, John Whaley <joewhaley@xxxxxxxxx> wrote:
Hi Prakash,

What would you use the count() for?  The only thing I could think of
is to compare it to an integer (or another count).  You could use the
BDD operation "satCount()" to get the number of tuples in a relation.
There is no support for a count() predicate in bddbddb, although it
would not be difficult to add.  See "dsize()" in BDDRelation for an
example of how to get the number of tuples in a relation, and
"update()/updateIncremental()" in BDDInferenceRule for a place to
integrate it within the rule solving.

If your count is small (1 or 2) you could always write a simple rule like this:

moreThanOne(a) :- relation(a,b), relation(a,c), a != c.
onlyOne(a) :- relation(a,_), !moreThanOne(a).

Likewise for two, three, etc.  It gets really tedious at higher #s, though.

-John


On 1/24/07, Prakash Prabhu < prakash.prabhu@xxxxxxxxx> wrote:
> Hi,
>
> Is there a way in bddbddb to count the number of tuples in a relation at
> runtime , ie, does bddbddb support a predicate of the form
> count(relation(a,_)) which would count the number of tuples in 'relation'
> which have 'a' in the first column ?
>
> If not, I would like to get some advice on how complex it would be to
> implement it in bddbddb (the files to look at would be of great help ) and
> whether it would be too expensive to incorporate the  'count' ( if
> implemented ) on the rhs of one of the rules of the Datalog program. Would
> implementing this mean counting the number of paths that lead to the 1 leaf
> in the corresponding BDD, then for each path filling in all possible values
> for BDD variables that do not appear on that path ?
>
> thanks.
> Prakash
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
> _______________________________________________
> bddbddb-devel mailing list
> bddbddb-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/bddbddb-devel
>
>
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
bddbddb-devel mailing list
bddbddb-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/bddbddb-devel
Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe