;;;; -*- Mode: LISP; Syntax: Common-Lisp; Base: 10 -*- ;;;; --------------------------------------------------------------------- ;;;; File name: units.lsp ;;;; System: FIRE ;;;; Author: Praveen Paritosh ;;;; Created: September 22, 2002 12:25:23 ;;;; Purpose: Handling Units in FIRE ;;;; --------------------------------------------------------------------- ;;;; Modified: Friday, January 23, 2004 at 17:44:05 by paritosh ;;;; --------------------------------------------------------------------- ;;; The idea is to provide support for doing computation involving quantities ;;; which have associated SI units. This works on top of Gordon Novak's ;;; implementation of unit handling. ;;; The issues are -- ;;; 1. Compatibility with Cyc's representation of units. ;;; 2. Figuring out how exactly would one want to use this. ;;; 3. Adding to Novak's collection of units those that are not present there ;;; (like BillionDollars). ;;; 4. How to handle Cyc's ScalarInterval notion of quantity? ;;; ;;; The key idea is, that for every quantity, there is one right unit (SI, ;;; plus our own conventions). ;;; ;;; Cyc's representation of a quantity is ;;; (UnitOfMeasureFn ?NUM) or (UnitOfMeasureFn ?MIN ?MAX) ;;; where UnitOfMeasureFn is a member of the collection UnitOfMeasure, and ;;; the above stands for a ScalarPointValue or a ScalarInterval respectively. ;;; (standardUnit UnitOfSpeed MetersPerSecond) ;;; (unitMultiplicationFactor MilesPerHour MetersPerSecond 2.2369) ;;; The Cyc representation of units is not compositional. So, for example, ;;; it would have been more meaningful to say (/ Meter Second). Therefore ;;; for each of the derived units, we will add this knowledge to the KB. ;;; ;;; We have three kinds of things -- ;;; 1. Dimension -- For example, Distance ;;; 2. Unit -- For example, Meter ;;; 3. Quantity -- An instantiation of a specific value on a dimension ;;; e.g., (Meter 4.0) or (Meter 4 10), or ( ;;; The following kind of operations are supported -- ;;; ;;; (convert ) ;;; (convert-to-standard-units )