Re: Simple Example, How To Model It In RM

From: Neo <neo55592_at_hotmail.com>
Date: 3 Jul 2005 08:26:48 -0700
Message-ID: <1120404408.150257.31070_at_g44g2000cwa.googlegroups.com>


Gene and Tom, could give me a breif summary of your technical background and level of expertise related to databases and relational theory? Also could you show how to implement the following in RM?

// Create various types.
// Note: "inst" is an abbreviation for instance.
// Note: "it" refers to last new thing created by "*"
// at current depth of parenthesis.

(CREATE type inst *challenge & dir item it)
(CREATE type inst *solution)
(CREATE type inst *person)
(CREATE type inst *database)
(CREATE type inst *version)
(CREATE type inst *hardware)
(CREATE type inst *cpu)
(CREATE type inst *speed)
(CREATE type inst *"memory size")
(CREATE type inst *"execution time")

// Create verbs to relate things.
(CREATE verb inst *author)
(CREATE verb inst *cheerleader)
(CREATE verb inst *bookie)

// Create persons.
(CREATE person inst *neo)
(CREATE person inst *hugo

 & it cheerleader (CREATE person inst *gene)  & it bookie gene)

// Create a challenge and its solutions.
(CREATE challenge inst *"common ancestor report"
 & it solution (CREATE solution inst *"x#1a"

                & it author neo
                & it hardware (CREATE hardware inst *"dell server"
                               & it cpu (CREATE cpu inst *"P II"
                                         & it speed +"500 Mhz"))
                & it database (CREATE database inst *xdb1
                               & it version +4.5.9)
                & it "execution time" +"1.63 ms")
 & it solution (CREATE solution inst *"x#1b"
                & it author neo
                & it hardware (CREATE hardware inst *"pocket pc"
                               & it cpu (CREATE cpu inst *"ARM SA1110"
                                         & it speed +"233 Mhz")
                                         & it "memory size" +"32 MB")
                & it database xdb1
                & it "execution time" +"6.56 ms")
 & it solution (CREATE solution inst *"rm#2"
                & it author hugo
                & it hardware (CREATE hardware inst *"desk top"
                               & it cpu (CREATE cpu inst *"P III"
                                         & it speed +"1300 Mhz"))
                & it database (CREATE database inst *"sql server"
                               & it version +2000)
                & it "execution time" +"11.0 ms")
)
// Find neo solution's execution time
// on hardware with 500 Mhz CPU.
// Finds 1.63 ms.

(SELECT (solution inst *

 & * author neo
 & * hardware (* cpu (* speed "500 Mhz"))) "execution time" *)
// Find hugo's solution's execution speed
// on hardware with 1300 Mhz CPU.
// Finds 11.0 ms.

(SELECT (solution inst *

 & * author hugo
 & * hardware (* cpu (* speed "1300 Mhz"))) "execution time" *)

// Find hugo's cheerleader and bookie.
// Returns gene.
(SELECT hugo cheerleader * & hugo bookie *)
Received on Sun Jul 03 2005 - 17:26:48 CEST

Original text of this message