[mercury-users] rtree, time and constraints?

Ralph Becket rafe at cs.mu.OZ.AU
Thu Apr 13 10:07:59 AEST 2006


doug.auclair at logicaltypes.com, Wednesday, 12 April 2006:
> I have not yet begun to use rtree to implement
> this indexing system, but I have a question before
> I may reinvent the wheel.  Does rtree give a
> region that is spacial and temporal?

An rtree(K, V) takes regions K as keys to values V.

The type K must be an instance of rtree.region, which specifies methods
for intersection, containment, size, and so forth.

K can therefore have as many dimensions as you wish.  For example, a
region in simple spacetime might be defined using a pair of
{x, y, z, t} coordinates defining opposite corners of a bounding box.


> Questions:
> 
> * Given that each image is time-stamped, is it
> possible to narrow the search to not only that
> region in space but also, say, within a 3 day
> period of two weeks ago?

Use rtree.search_intersects over a region of spacetime spanning the
appropriate times and places.

> But only during the
> nighttime?

You'd either have to filter the results or make mulitple
search_intersects queries.

> Is this trivial? Instead, are there 
> papers or other resources to assist me in 
> understanding this data structure for this 
> purpose?

Googling lists several explanatory papers.

> * Would having a constraint system over the rtree 
> make the implementation simpler or more concise?

Region keys have to be completely specified for the algorithm to work,
and values are not manipulated in any way, so I'd guess that nothing
would be gained by using a CLP approach.

> * Where are good examples of end-to-end use (i.e.
> establishing the store, constraining the 
> variables and then reading out the results)
> of a constraint system in the Mercury compiler
> that wouldn't be to much of a stretch for me
> to follow to look into using constraints for
> purposes like these?

There aren't any as yet.  Solver types are still somewhat experimental
and we'd rather not use them in the compiler until we have fully nailed
down some solver-type related corner cases.  We do have a module in the
compiler that performs constraint based program analysis to aid mode
checking, but it doesn't currently use solver types.  If you're
interested, have a look at compiler/prop_mode_constraints.m.

Cheers,
-- Ralph
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list