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