Unit Knowledge Management Jonathan Stratford & James H. Davenport Department of Computer Science University of Bath Bath BA2 7AY England Jonathan.Stratford@alumni.bath.ac.uk J.H.Davenport@bath.ac.uk July 29, 2008
Unit Converters ▼❛♥② ♦♥ t❤❡ ✇❡❜ ◆♦t ❡①t❡♥s✐❜❧❡✱ tr❛♥s♣❛r❡♥t ❡t❝✳ ◆♦t t②♣❡❞ ✭♥♦r♠❛❧❧②✮ ❆❧t❤♦✉❣❤ ❞✐♠❡♥s✐♦♥s t②♣❡ ✉♥✐ts ●❡♥❡r❛❧❧② ♠♦♥♦❧✐t❤✐❝ 1
Unit Converters Many on the web ◆♦t ❡①t❡♥s✐❜❧❡✱ tr❛♥s♣❛r❡♥t ❡t❝✳ ◆♦t t②♣❡❞ ✭♥♦r♠❛❧❧②✮ ❆❧t❤♦✉❣❤ ❞✐♠❡♥s✐♦♥s t②♣❡ ✉♥✐ts ●❡♥❡r❛❧❧② ♠♦♥♦❧✐t❤✐❝ 2
Unit Converters Many on the web Not extensible, transparent etc. ◆♦t t②♣❡❞ ✭♥♦r♠❛❧❧②✮ ❆❧t❤♦✉❣❤ ❞✐♠❡♥s✐♦♥s t②♣❡ ✉♥✐ts ●❡♥❡r❛❧❧② ♠♦♥♦❧✐t❤✐❝ 3
Unit Converters Many on the web Not extensible, transparent etc. Not typed (normally) ❆❧t❤♦✉❣❤ ❞✐♠❡♥s✐♦♥s t②♣❡ ✉♥✐ts ●❡♥❡r❛❧❧② ♠♦♥♦❧✐t❤✐❝ 4
Unit Converters Many on the web Not extensible, transparent etc. Not typed (normally) Although dimensions type units ●❡♥❡r❛❧❧② ♠♦♥♦❧✐t❤✐❝ 5
Unit Converters Many on the web Not extensible, transparent etc. Not typed (normally) Although dimensions type units Generally monolithic 6
Units in OpenMath ✎ ❉❡s❝r✐❜❡❞ ❜② ❉❛✈❡♥♣♦rt ✫ ◆❛②❧♦r ✎ ❯s❡s ❙✐♠♣❧❡ ❚②♣❡ ❙②st❡♠ t♦ ❞♦ ❞✐♠❡♥s✐♦♥s ✎ ❍❛♥❞❧❡s ❙■ ♣r❡☞①✐♥❣ 7
Units in OpenMath • Described by Davenport & Naylor ✎ ❯s❡s ❙✐♠♣❧❡ ❚②♣❡ ❙②st❡♠ t♦ ❞♦ ❞✐♠❡♥s✐♦♥s ✎ ❍❛♥❞❧❡s ❙■ ♣r❡☞①✐♥❣ 8
Units in OpenMath • Described by Davenport & Naylor • Uses Simple Type System to do dimensions ✎ ❭❍❛♥❞❧❡s✧ ❙■ ♣r❡☞①✐♥❣ 9
Units in OpenMath • Described by Davenport & Naylor • Uses Simple Type System to do dimensions • “Handles” SI prefixing 10
Typing is Important Distinguishes Between ✎ ❨♦✉ ❝❛♥✬t ❝♦♥✈❡rt ❳ t♦ ❨ ❡✳❣✳ ♠❡tr❡s t♦ ❦✐❧♦❣r❛♠s ✎ ■ ❞♦♥✬t ❦♥♦✇ ❤♦✇ t♦ ❝♦♥✈❡rt ❳ t♦ ❨ ❡✳❣✳ ❞❛②s t♦ ❝❛❧❡♥❞❛r ♠♦♥t❤s ❡✳❣✳ ❡❧❡❝tr♦♥✈♦❧ts t♦ ❥♦✉❧❡s ✭❜② ❡①♣❡r✐♠❡♥t❛❧ ❞❡✲ t❡r♠✐♥❛t✐♦♥✮ 11
Typing is Important Distinguishes Between • You can’t convert X to Y ❡✳❣✳ ♠❡tr❡s t♦ ❦✐❧♦❣r❛♠s ✎ ■ ❞♦♥✬t ❦♥♦✇ ❤♦✇ t♦ ❝♦♥✈❡rt ❳ t♦ ❨ ❡✳❣✳ ❞❛②s t♦ ❝❛❧❡♥❞❛r ♠♦♥t❤s ❡✳❣✳ ❡❧❡❝tr♦♥✈♦❧ts t♦ ❥♦✉❧❡s ✭❜② ❡①♣❡r✐♠❡♥t❛❧ ❞❡✲ t❡r♠✐♥❛t✐♦♥✮ 12
Typing is Important Distinguishes Between • You can’t convert X to Y e.g. metres to kilograms ✎ ■ ❞♦♥✬t ❦♥♦✇ ❤♦✇ t♦ ❝♦♥✈❡rt ❳ t♦ ❨ ❡✳❣✳ ❞❛②s t♦ ❝❛❧❡♥❞❛r ♠♦♥t❤s ❡✳❣✳ ❡❧❡❝tr♦♥✈♦❧ts t♦ ❥♦✉❧❡s ✭❜② ❡①♣❡r✐♠❡♥t❛❧ ❞❡✲ t❡r♠✐♥❛t✐♦♥✮ 13
Typing is Important Distinguishes Between • You can’t convert X to Y e.g. metres to kilograms • I don’t know how to convert X to Y e.g. days to calendar months ❡✳❣✳ ❡❧❡❝tr♦♥✈♦❧ts t♦ ❥♦✉❧❡s ✭❜② ❡①♣❡r✐♠❡♥t❛❧ ❞❡✲ t❡r♠✐♥❛t✐♦♥✮ 14
Typing is Important Distinguishes Between • You can’t convert X to Y e.g. metres to kilograms • I don’t know how to convert X to Y e.g. days to calendar months e.g. electronvolts to joules (by experimental de- termination) 15
Aren’t Intervals the Answer Here? ❭❆♥②♦♥❡ ✇❤♦ t❤✐♥❦s ✐♥t❡r✈❛❧s ❛r❡ t❤❡ ❛♥s✇❡r ❞♦❡s♥✬t ✉♥❞❡rst❛♥❞ ✐♥t❡r✈❛❧s ❛♥❞ ❞♦❡s♥✬t ✉♥✲ ❞❡rst❛♥❞ t❤❡ q✉❡st✐♦♥✧✳ ❬❑❛❤❛♥❄❪ ✎ ❋♦r ♣❤②s✐❝❛❧ ✉♥✐ts✱ ✇❤❛t ✇❡ ❣❡♥❡r❛❧❧② ❤❛✈❡ ✐s ❛ st❛♥❞❛r❞ ❞❡✈✐❛t✐♦♥✱ ♥♦t ❛♥ ✐♥t❡r✈❛❧ ✎ ❈♦rr❡❧❛t✐♦♥s ❛r❡ ♥♦t ♥♦r♠❛❧❧② r❡❝♦r❞❡❞ ✐♥ ✇❤❛t ✐s ♣✉❜❧✐s❤❡❞ ✎ ❈❛❧❡♥❞r✐❝ t✐♠❡ ✐s ❛ ❝♦♠♣❧❡t❡ ♠❡ss 16
Aren’t Intervals the Answer Here? “Anyone who thinks intervals are the answer doesn’t understand intervals and doesn’t un- derstand the question”. [Kahan?] ✎ ❋♦r ♣❤②s✐❝❛❧ ✉♥✐ts✱ ✇❤❛t ✇❡ ❣❡♥❡r❛❧❧② ❤❛✈❡ ✐s ❛ st❛♥❞❛r❞ ❞❡✈✐❛t✐♦♥✱ ♥♦t ❛♥ ✐♥t❡r✈❛❧ ✎ ❈♦rr❡❧❛t✐♦♥s ❛r❡ ♥♦t ♥♦r♠❛❧❧② r❡❝♦r❞❡❞ ✐♥ ✇❤❛t ✐s ♣✉❜❧✐s❤❡❞ ✎ ❈❛❧❡♥❞r✐❝ t✐♠❡ ✐s ❛ ❝♦♠♣❧❡t❡ ♠❡ss 17
Aren’t Intervals the Answer Here? “Anyone who thinks intervals are the answer doesn’t understand intervals and doesn’t un- derstand the question”. [Kahan?] • For physical units, what we generally have is a standard deviation, not an interval ✎ ❈♦rr❡❧❛t✐♦♥s ❛r❡ ♥♦t ♥♦r♠❛❧❧② r❡❝♦r❞❡❞ ✐♥ ✇❤❛t ✐s ♣✉❜❧✐s❤❡❞ ✎ ❈❛❧❡♥❞r✐❝ t✐♠❡ ✐s ❛ ❝♦♠♣❧❡t❡ ♠❡ss 18
Aren’t Intervals the Answer Here? “Anyone who thinks intervals are the answer doesn’t understand intervals and doesn’t un- derstand the question”. [Kahan?] • For physical units, what we generally have is a standard deviation, not an interval • Correlations are not normally recorded in what is published ✎ ❈❛❧❡♥❞r✐❝ t✐♠❡ ✐s ❛ ❝♦♠♣❧❡t❡ ♠❡ss 19
Aren’t Intervals the Answer Here? “Anyone who thinks intervals are the answer doesn’t understand intervals and doesn’t un- derstand the question”. [Kahan?] • For physical units, what we generally have is a standard deviation, not an interval • Correlations are not normally recorded in what is published • Calendric time is a complete mess 20
month = 12; month year ∈ [28 , 31] = { 28 , 29 , 30 , 31 } day but year ∈ [365 , 366] day [12 ∗ 28 , 12 ∗ 31] ⊆ { 12 ∗ 28 , 12 ∗ 29 , 12 ∗ 30 , 12 ∗ 31 } ∈ / 21
Convert Months into Days ✶✳ ❚❤❡② ❛r❡ ❜♦t❤ t✐♠❡ ✱ s♦ t❤❡ ❝♦♥✈❡rs✐♦♥ ✐s ♠❡❛♥✐♥❣❢✉❧✱ ❜✉t ■ ❞♦♥✬t ❤❛✈❡ ❛♥ ❡①❛❝t ❝♦♥✲ ✈❡rs✐♦♥ ❢❛❝t♦r ✭♦✉r s♦❧✉t✐♦♥✮ ✷✳ ❚❤❡r❡ ❛r❡ ✸✵ ❂ ✸✵ ✿ ✹✸✻✽✼✺✵✵ ❞❛②s ✐♥ ❛ ♠♦♥t❤✿ ❝♦rr❡❝t ♦♥ ❛✈❡r❛❣❡✱ ❜✉t ❢❛❧s❡ ❢♦r ❡✈❡r② ♠♦♥t❤ ✭●♦♦❣❧❡ ✉s❡s ✸✵✳✹✸✻✽✹✾✾✮✦ ✸✳ ❚❤❡r❡ ❛r❡ ✸✵ ❞❛②s ✐♥ ❛ ♠♦♥t❤✱ ✇❤✐❝❤ ✐s ❭t❤❡ ♥❡❛r❡st✧✱ ❜✉t ♥♦t t❤❡ ♠♦st ❝♦♠♠♦♥✳ ▲❡❛❞s t♦ ❭✶ ❞❡❝❛❞❡ ❂ ✶✷✶ ♠♦♥t❤s✧✳ ✹✳ ■ ❞♦♥✬t ❦♥♦✇ ❛❜♦✉t ♠♦♥t❤s✳ 22
Convert Months into Days 1. They are both time , so the conversion is meaningful, but I don’t have an exact con- version factor (our solution) ✷✳ ❚❤❡r❡ ❛r❡ ✸✵ ❂ ✸✵ ✿ ✹✸✻✽✼✺✵✵ ❞❛②s ✐♥ ❛ ♠♦♥t❤✿ ❝♦rr❡❝t ♦♥ ❛✈❡r❛❣❡✱ ❜✉t ❢❛❧s❡ ❢♦r ❡✈❡r② ♠♦♥t❤ ✭●♦♦❣❧❡ ✉s❡s ✸✵✳✹✸✻✽✹✾✾✮✦ ✸✳ ❚❤❡r❡ ❛r❡ ✸✵ ❞❛②s ✐♥ ❛ ♠♦♥t❤✱ ✇❤✐❝❤ ✐s ❭t❤❡ ♥❡❛r❡st✧✱ ❜✉t ♥♦t t❤❡ ♠♦st ❝♦♠♠♦♥✳ ▲❡❛❞s t♦ ❭✶ ❞❡❝❛❞❡ ❂ ✶✷✶ ♠♦♥t❤s✧✳ ✹✳ ■ ❞♦♥✬t ❦♥♦✇ ❛❜♦✉t ♠♦♥t❤s✳ 23
Convert Months into Days 1. They are both time , so the conversion is meaningful, but I don’t have an exact con- version factor (our solution) 2. There are 30 699 1600 = 30 . 43687500 days in a month: correct on average, but false for every month (Google uses 30.4368499)! ✸✳ ❚❤❡r❡ ❛r❡ ✸✵ ❞❛②s ✐♥ ❛ ♠♦♥t❤✱ ✇❤✐❝❤ ✐s ❭t❤❡ ♥❡❛r❡st✧✱ ❜✉t ♥♦t t❤❡ ♠♦st ❝♦♠♠♦♥✳ ▲❡❛❞s t♦ ❭✶ ❞❡❝❛❞❡ ❂ ✶✷✶ ♠♦♥t❤s✧✳ ✹✳ ■ ❞♦♥✬t ❦♥♦✇ ❛❜♦✉t ♠♦♥t❤s✳ 24
Recommend
More recommend