;;; -*- Mode:Lisp; Syntax: Common-lisp; Package:ONTOLINGUA-USER; Syntax:COMMON-LISP; Base:10 -*- ;;; Basic Units ;;; (c) 1993 Greg Olsen and Thomas Gruber (in-package "ONTOLINGUA-USER") (define-theory standard-units-and-dimensions (physical-quantities) "This theory defines a set of basic units of measure, a set of fundamental dimensions and a few others. Each unit-of-measure is defined with its relationship to SI units for the fundamental dimensions. It is intended that this theory represent enough information to convert among any pair of units of the same dimension that are either defined as basic units here or built up from the basic units using the composition operators * and EXPT.") (in-theory 'standard-units-and-dimensions) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; SOME FUNDAMENTAL DIMENSIONS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; The IDENTITY-DIMENSION is defined in the base theory, PHYSICAL-QUANTITIES. (define-instance LENGTH-DIMENSION (physical-dimension) "The fundamental dimension of length, as defined by the SI standard.") (define-instance MASS-DIMENSION (physical-dimension) "The fundamental dimension of mass, as defined by the SI standard.") (define-instance TIME-DIMENSION (physical-dimension) "The fundamental dimension of physical, continuous time, as defined by the SI standard.") (define-instance ELECTRICAL-CURRENT-DIMENSION (physical-dimension) "The fundamental dimension of electrical current, as defined by the SI standard.") (define-instance THERMODYNAMIC-TEMPERATURE-DIMENSION (physical-dimension) "The fundamental dimension of temperature, as defined by the SI standard.") (define-instance AMOUNT-OF-SUBSTANCE-DIMENSION (physical-dimension) "The fundamental dimension of amount of substance, as defined by the SI standard.") (define-instance LUMINOUS-INTENSITY-DIMENSION (physical-dimension) "The fundamental dimension of luminous-intensity, as defined by the SI standard.") (define-instance FORCE-DIMENSION (physical-dimension) "The physical dimension of force is defined as mass times length over time squared. In some systems FORCE-DIMENSION is fundamental and MASS-DIMENSION is a derived dimension. This theory goes with the SI standard, but we include the definition of force as a non-fundamental built-in dimension." :axiom-def (= FORCE-DIMENSION (* MASS-DIMENSION (* LENGTH-DIMENSION (expt TIME-DIMENSION -2))))) (define-instance ENERGY-DIMENSION (physical-dimension) "The physical dimension of energy is defined as mass times length squared over time squared." :axiom-def (= ENERGY-DIMENSION (* MASS-DIMENSION (* (expt LENGTH-DIMENSION 2) (expt TIME-DIMENSION -2))))) (define-instance CURRENCY-DIMENSION (physical-dimension) "The fundamental dimension of currency or money. CURRENCY-DIMENSION is to currencies as US-dollar's and ECU's as the LENGTH-DIMENSION is to units of length such as meters.") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; SI (Systeme International) units ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define-class SI-unit (?unit) "The class of Systeme International units." :def (unit-of-measure ?unit) ;redundant but helpful :axiom-def (and (system-of-units SI-unit) (= (base-units SI-unit) (setof meter kilogram second ampere degree-kelvin mole candela identity-unit)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; BASIC UNITS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; The IDENTITY-UNIT is defined in the PHYSICAL-QUANTITIES theory (define-instance SECOND (unit-of-measure) "Time unit." :axiom-def (and (dimension second time-dimension) (SI-unit second))) (define-instance MINUTE (unit-of-measure) "Time unit." := (* second 60) :axiom-def (dimension minute time-dimension)) (define-instance HOUR (unit-of-measure) "Time unit." := (* minute 60) :axiom-def (dimension hour time-dimension)) (define-instance METER (unit-of-measure) "SI length unit. No conversion function is given because this is a standard." :axiom-def (and (dimension meter length-dimension) (SI-unit meter))) (define-instance KILOMETER (unit-of-measure) "" := (* meter 1000) :axiom-def (dimension kilometer length-dimension)) (define-instance INCH (unit-of-measure) "English length unit." := (/ meter 39.37) :axiom-def (dimension inch length-dimension)) (define-instance FOOT (unit-of-measure) "English length unit of feet." := (* inch 12) :axiom-def (dimension foot length-dimension)) (define-instance MILE (unit-of-measure) "English length unit." := (* foot 5280) :axiom-def (dimension mile length-dimension)) (define-instance ANGSTROM (unit-of-measure) "ang.strom \'a-strm also '-\ n (1897) [Anders J. ngstrm] :a unit of length equal to one ten-billionth of a meters -- used esp. for wavelengths of light." := (/ meter (expt 10 10)) :axiom-def (dimension angstrom length-dimension)) (define-instance KILOGRAM (unit-of-measure) "SI mass unit of kilogram." :axiom-def (and (dimension kilogram mass-dimension) (SI-unit kilogram))) (define-instance POUND-MASS (unit-of-measure) "English pound of mass." :axiom-def (dimension pound-mass mass-dimension) := (/ kilogram 2.2046)) (define-instance SLUG (unit-of-measure) "English mass unit." := (/ pound-mass 1000) :axiom-def (dimension slug mass-dimension)) (define-instance NEWTON (unit-of-measure) "SI force unit." := (* (* kilogram meter) (expt second -2)) :axiom-def (and (dimension newton force-dimension) (SI-unit newton))) (define-instance AMPERE (unit-of-measure) "SI electrical current unit." :axiom-def (and (dimension ampere electrical-current-dimension) (SI-unit ampere))) (define-instance POUND-FORCE (unit-of-measure) "English pound of force." :axiom-def (dimension pound-force force-dimension) := (/ newton 4.448)) (define-instance JOULE (unit-of-measure) "SI energy unit." := (* newton meter) :axiom-def (and (SI-unit joule) (dimension joule energy-dimension))) (define-instance BTU (unit-of-measure) "British thermal unit, a unit of energy." := (* 1055.0 joule) :axiom-def (dimension btu energy-dimension)) (define-instance PASCAL (unit-of-measure) "SI pressure unit." := (* newton (expt meter -2)) :axiom-def (and (SI-unit pascal) (dimension pascal (* force-dimension (expt length-dimension -2))))) (define-instance DEGREE-KELVIN (unit-of-measure) "A unit of thermodynamic temperature. The degree-Kelvin differs from the Celcius scale ..." :axiom-def (and (dimension degree-kelvin thermodynamic-temperature-dimension) (SI-unit degree-kelvin))) (define-instance DEGREE-RANKINE (unit-of-measure) "Being, according to, or relating to an absolute-temperature scale on which the unit of measurement equals a Fahrenheit degree and on which the freezing point of water is 491.67<^o> and the boiling point 671.67<^o>. [Webster]" := (* degree-kelvin (/ 5 9)) :axiom-def (dimension degree-rankine thermodynamic-temperature-dimension)) (define-instance RADIAN (unit-of-measure) "Angular measurement unit." := identity-unit :axiom-def (dimension radian identity-dimension)) (define-instance DEGREE (unit-of-measure) "Angular measurement unit." := (* radian (/ pi 180)) :axiom-def (dimension degree identity-dimension)) (define-instance CENT (unit-of-measure) "Currency measurement unit." := (/ DOLLAR 100) :axiom-def (dimension cent currency-dimension)) (define-instance DOLLAR (unit-of-measure) "Currency measurement unit." :axiom-def (dimension dollar currency-dimension)) (define-instance MOLE (unit-of-measure) "SI unit for amount of substance. A mole of a substance is the amount of that substance that contains 6.02252 x 10^23 elementary entities. Those entities may be atoms, molecules, ions, electrons, other particles, or specified groups of such particles. One mole of carbon atoms (the C^12 isotope) is exactly 12 grams [Halliday and Resnick]. In this ontology we say that the specified unit is the molecule, so that the MOLE stands by itself as a unit." :axiom-def (and (dimension MOLE amount-of-substance-dimension) (SI-unit MOLE))) (define-instance CANDELA (unit-of-measure) "The CANDELA is the SI unit for luminous intensity." :axiom-def (and (dimension CANDELA luminous-intensity-dimension) (SI-unit CANDELA)))