On 4/18/13 10:16 AM, glen wrote:
When you pick up a rock and use it as a hammer, what is the satisfied predicate? It's certainly not "hammer(x)", because rocks are usually nothing like hammers.
An object with high mass and volume, low acceleration vs. low mass, low volume, and high acceleration? Even if you have a type that simply tracks physical properties, it can be embedded in other objects.

data PhysicalProperties = PhysicalProperties Mass Volume Location

data Hammer = Hammer PhysicalProperties

data Rock = Rock PhysicalProperties

or tagged instances..

data Tag = Hammer | Rock

data PhysicalProperties = PhysicalProperties Mass Volume Location Tag

hammer = PhysicalProperties 1 1 (0,0,1) Hammer

rock = PhysicalProperties 0.5 0.5 (0,0,0) Rock

mass :: PhysicalProperties -> Mass
mass (PhysicalProperties mass _ _) = mass

isCrushed :: PhysicalProperties -> Bool
isCrushed (PhysicalProperties _ volume _) = volume < 1e-6

impact :: PhysicalProperties -> PhysicalProperties > (Bool,PhysicalProperties,PhysicalProperties)

If you want to have both physical realism and rules, then decouple them using a physics engine. Let the physics engine move the objects around but have rules embedded in the objects be unaware of physical properties..

Marcus



============================================================
FRIAM Applied Complexity Group listserv
Meets Fridays 9a-11:30 at cafe at St. John's College
to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com

Reply via email to