Re: Question:TimeStamp

Thomas Russ <[email protected]>
Newsgroups gmane.comp.ai.powerloom
Message-ID <[email protected]>
On Nov 2, 2004, at 7:16 PM, kolli kavita wrote:

> hi,
>
> Is there a system clock in powerloom. Are there any
> commands that use time like before, after where i can
> compare two time stamps. Please let me know this.

There are the basic functions in the underlying Stella system that 
would allow for this type of reasoning.  In our internal research 
version we also have developed PowerLoom level access for specific 
timepoint reasoning that will do this as well -- but that will need to 
await the next release of PowerLoom.  We hope to have that out around 
the end of this year, but are a bit short of time to go through the 
release, documentation and testing process.

Unfortunately, the timepoint reasoning code does rely on some updates 
to both PowerLoom and Stella, so it can't be easily added to the 3.0.2 
version.




As a preview of what would be supported in the next version of 
PowerLoom, I offer the following trace:

? (deffunction timestamp-of (?x ?y))
|f|TIMESTAMP-OF

? (assert (timestamp-of this (timepoint-kb/timepoint-of "now")))
|P|(= (TIMESTAMP-OF THIS) (/TIMEPOINT-KB/TIMEPOINT-OF now))

? (assert (timestamp-of that (timepoint-kb/timepoint-of "yesterday")))
|P|(= (TIMESTAMP-OF THAT) (/TIMEPOINT-KB/TIMEPOINT-OF yesterday))

? (ask (< (timestamp-of this) (timestamp-of that)))
FALSE

? (ask (> (timestamp-of this) (timestamp-of that)))
TRUE

? (retrieve all (and (timestamp-of ?x (timepoint-kb/timepoint-of ?y))))
There are 2 solutions:
   #1: ?X=THAT, ?Y="2004-NOV-02 8:00:00.000 UTC"
   #2: ?X=THIS, ?Y="2004-NOV-04 1:48:54.000 UTC"

? (retrieve (timepoint-kb/duration-of ?x (timepoint-kb/time- 
(timestamp-of this) (timestamp-of that))))
There is 1 solution so far:
   #1: ?X="plus 1 days; 64134000 ms"


? (retrieve (unit-kb/units ?x "s"
                            (timepoint-kb/time- (timestamp-of this) 
(timestamp-of that) ) ))
There is 1 solution so far:
   #1: ?X=150534.0

? (retrieve (unit-kb/units ?x "h"
                            (timepoint-kb/time- (timestamp-of this) 
(timestamp-of that) ) ))
There is 1 solution so far:
   #1: ?X=41.815

? (retrieve (unit-kb/units ?x "day"
                            (timepoint-kb/time- (timestamp-of this) 
(timestamp-of that) ) ))
There is 1 solution so far:
   #1: ?X=1.7422916666666666


There is some chance that the arithmetic concerning units, dimensions 
and timepoints may be integrated with the standard arithmetic 
operators, but this isn't fully certain yet.  Time arithmetic may need 
to be handled separately for a little while yet...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.