Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!uunet!math.fu-berlin.de!opal!unido!ecrc!ecrc!thom From: thom@ecrc.de (Thom Fruehwirth) Newsgroups: comp.lang.prolog Subject: Re: general data structures are impossible Message-ID: <1991Mar1.083108.27594@ecrc.de> Date: 1 Mar 91 08:31:08 GMT References: <1991Feb12.013413.24312@cs.ubc.ca> <4765@goanna.cs.rmit.oz.au> <1991Feb19.235323.7748@newcastle.ac.uk> <4818@goanna.cs.rmit.oz.au> <1991Feb28.153621.3524@newcastle.ac.uk> Sender: news@ecrc.de Reply-To: thom@ecrc.de (Thom Fruehwirth) Organization: ecrc Lines: 30 Instead of encoding the problem with a data-structure, one could encode it with a program-structure. Functions become predicates: properties(snow,white). properties(snow,crystalline). properties(snow,cold). substances(white,snow). substances(white,paper). substances(white,salt). substances(crystalline,snow). substances(crystalline,salt). substances(crystalline,diamond). substances(cold,snow). substances(cold,liquid_nitrogen). substances(frozen,snow). substances(frozen,ice_cream). Adding that snow melts ar 32 degrees F: :- assert(melting_point(snow,32_degrees_F)). Asking the melting point of something white and frozen: :- substances(white,S),substances(frozen,S),melting_point(S,MP). yields S=snow, MP=32_degrees_F. Thom Fruehwirth