Re: [Jsdsi-users] extending jsdsi.Tag
Status: Pre-Alpha
Brought to you by:
sajma
From: Sameer A. <aj...@cs...> - 2004-04-28 23:01:34
|
Comments below... > On Wed, 2004-04-28 at 18:38, Guillermo Navarro wrote: >> Hi, >> >> Thanks for your interest. I'm still working on it and as you said I >> may find a way to encode the tags so I can use the existing tags (I'm >> testing several approaches). >> >> At the moment I use a tag which looks like: >> >> (tag (my-kind-of-auth (index 3) (id 453455) (val <byte-string>))) >> >> It is an element of a hash chain. The "val" is an element "index" of >> the hash chain "id". >> >> The intersection function, is something like: given two tags, the >> resulting intersection is the one with a lower index, only if both >> id's are equal, and we can verify the value of the corresponding hash, >> otherwise the intersection is null. >> > As an idea, could the 'index' be a SetTag, where index 3 equates to > (index (* set 1 2 3)). Therefore the intersection of (index (* set 1 2 3 > 4)) and (index (* set 1 2)) is (index (* set 1 2)). Using SetTags won't scale well to large numbers of indexes. Instead, you can use a RangeTag to represent an arbitrarily large set: Represent index N as (index (*range numeric lt N)), for example: index 3 == (index (*range numeric lt 3)) index 1 == (index (*range numeric lt 1)) Then index 1 intersected with index 3 is the intersection of the ranges "less than 1" and "less than 3", which is "less than 1". (this is because the "less than" parameter is an _upper limit_, and a lower upper limit is more restrictive, and intersection returns the more restrictive range). Note also that "only if both id's are equal" works fine as you have it: (id 453455) will only intersect with another SimpleTag like (id 453455 ...) -- the "..." is there because SimpleTags can be extended (and so restricted), but this is irrelevant for what you're doing. I agree with Sean about the (val ...) tag -- what value did you hash? Sameer |