Re: Suggestions for alternate UPDATE command syntax

From: Neo <neo55592_at_hotmail.com>
Date: 4 Apr 2005 15:04:37 -0700
Message-ID: <1112649599.502467.144500_at_z14g2000cwz.googlegroups.com>


To keep the prior example simple, values such as "500 Mhz" and "1.63 ms" were not normalized. They can be normalized with the following script:

// Create types to normalize above values.
(CREATE type inst *qty)
(CREATE type inst *unit)

// Normalize "500 Mhz" an additional step.
(CREATE (speed inst * & * name "500 Mhz") qty +500)
(CREATE (speed inst * & * name "500 Mhz") unit +Mhz)
(DELETE "500 Mhz" name)

// Normalize "1.63 ms" an additional step.
(CREATE ("execution time" inst * & * name "1.63 ms") qty +1.63)
(CREATE ("execution time" inst * & * name "1.63 ms") unit +ms)
(DELETE "1.63 ms" name)

// The query then becomes:
// Find neo solution's execution time on hardware with 500 Mhz CPU.
// Finds an "execution time" whose qty is 1.63 and unit is ms.

(SELECT (solution inst *
& * author neo & * hardware (* cpu (* speed (* qty 500 & * unit Mhz)))) "execution
time" *)

Now suppose we want to add comments to solutions, it would go like this:

// Create comment type.
(CREATE type inst *comment)

// Add a comment to neo's solutions.
(CREATE x#1a comment +"normalized to symbols")
(CREATE x#1b comment +"normalized to symbols")

// Add two comments to hugo's solution.
(CREATE rm#2 comment +"non-normalized and non-generic")
(CREATE rm#2 comment +"unable to generate common ancestors for class

hierarchy")

// Find authors of "non-normalized and non-generic" solutions. // Finds hugo.
(SELECT (solution inst *

         & * comment "non-normalized and non-generic") author *) Received on Tue Apr 05 2005 - 00:04:37 CEST

Original text of this message