Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!uflorida!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.arch Subject: Re: Semantics (was Software Distribution) Keywords: functions, domains, partial functions Message-ID: <13914@mimsy.UUCP> Date: 8 Oct 88 17:03:28 GMT References: <13889@mimsy.UUCP> <2472@uhccux.uhcc.hawaii.edu> <13898@mimsy.UUCP> <16603@shemp.CS.UCLA.EDU> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 44 In article <16603@shemp.CS.UCLA.EDU> casey@admin.cognet.ucla.edu (Casey Leedom) writes: > As Steve pointed out, what we're probably dealing with is a >misunderstanding about the usage of the word "define". Probably true. Someone wanted a Machine Independent Intermediate Language to include assertions that would pin down the exact action of various `undefined' actions (1/0, *(type*)NULL, etc). I claim that this is, or should be, unnecessary (regardless of the feasibility of MIILs). That these actions are `defined as undefined' is not self contradictory, but it certainly does make for misunderstandings! >... whether you get floating point truncation or rounding (and if >this isn't one of the ANSI C machparam.h defined machine constants, >it should be (or is that a POSIX standard?)), This one is in ; others are in . The name is not in the ANSI standard (wrong directory, and more important, too many characters---the magic limit is six, not including the `.h' part). > I think that all Steve is asking is that we don't leave any loop >holes. Standards have very particular language for this; the key words are `defined', `implementation defined', and `undefined'. Defined behaviour is simply that: integer multiplication of 2 and 3 always gives 6. Implementation-defined means that the standard itself does not say what you get, but that the system must tell you what happens: -1>>1 might be -1; it might be 32767; it might be something else; but -1>>1 will always be something predictable (and usually chosen from a limited set of possibilities). `Undefined' means that anything can happen: to borrow one of my own silly examples, maybe the machine sometimes expodes, sending shrapnel through the computer room. When I say `leave some semantics undefined', I mean in this last sense. We will tell you that *(type *)NULL is unpredictable; we will not even limit it to (type)0 or `segmentation fault, core dumped'. If you use it, it is your error. By making it undefined, we need not pin down the semantics of *(type *)NULL in a MIIL for that language. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris