 |
|
| Science Forum Index » Languages Forum » All languages are equally fit... |
|
Page 60 of 83 Goto page Previous 1, 2, 3 ... 59, 60, 61 ... 81, 82, 83 Next |
|
| Author |
Message |
| LEE Sau Dan... |
Posted: Fri Nov 06, 2009 10:44 pm |
|
|
|
Guest
|
[quote]"Herman" == Herman Rubin <hrubin at (no spam) odds.stat.purdue.edu> writes:
[/quote]
Herman> If it was code for purely mathematical operations, and I
Herman> knew the purpose, I suspect that I could "read" it and
Herman> interpret it without knowing the language.
OK. I'll let you figure out what the following Java code (in
particular, function 'magic') calculates! AND WHY does that work!?
class A {
public static void main(String args[]) {
for (String arg: args) {
int a;
try {
a = Integer.parseInt(arg);
System.out.println(a + "=>" + magic(a));
} catch (Exception e) {
System.out.println(arg + "=>" + e);
}
}
}
private static double magic(int z) {
if (z < 0)
throw new IllegalArgumentException("z<0");
double u = 0, v = 1;
double w = 1, x = 0;
for (;z>0; z>>>=1) {
if ((z & 1) == 1) {
final double a = w*u;
final double b = (w+x)*(u+v);
final double c = x*v;
w = c+a;
x = b-a;
}
final double a = u*u;
final double b = (u+v)*(u+v);
final double c = v*v;
u = c+a;
v = b-a;
}
return x;
}
}
--
Lee Sau Dan 窗 ~{ at (no spam) nJX6X~}
E-mail: danlee at (no spam) informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee |
|
|
| Back to top |
|
|
|
| LEE Sau Dan... |
Posted: Fri Nov 06, 2009 10:44 pm |
|
|
|
Guest
|
[quote]"Herman" == Herman Rubin <hrubin at (no spam) odds.stat.purdue.edu> writes:
What does Alfred Nobel have to do with the question of whether
bombs are weapons?
[/quote]
Herman> The reason that Alfred Nobel set up the peace prise was
Herman> BECAUSE dynamite could be used as an instrument of warfare,
Herman> and this was to make bombs.
And that was not what Nobel *intended* when he made his invention.
So, the original goal of a design or an invention doesn't have to
coincide with what that design/invention gets used for.
--
Lee Sau Dan 窗 ~{ at (no spam) nJX6X~}
E-mail: danlee at (no spam) informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee |
|
|
| Back to top |
|
|
|
| LEE Sau Dan... |
Posted: Fri Nov 06, 2009 10:44 pm |
|
|
|
Guest
|
[quote]"Ant贸nio" == Ant贸nio Marques <entonio at (no spam) gmail.com> writes:
A computer language should not be ambiguous. A good test is to
write a compiler and declare what the compiler does is the right
answer. 聽The attempt to define standards (to keep the various
compilers at least more or less in line) has never been
completely successful. Maybe someday it will be but I will not
hold my breath until it happens.
[/quote]
Ant贸nio> But it's not like a compiler will stop to ask you what you
Ant贸nio> mean,
It *could*. But most people prefer to get a warning message.
Ant贸nio> or make different decisions each time it's run.
It *could*. But most people prefer to get consistent results, even if
the results are erroneous.
So, compiler writers made some choices. But that doesn't rule out all
the other choices.
--
Lee Sau Dan 鏉庡畧鏁 ~{ at (no spam) nJX6X~}
E-mail: danlee at (no spam) informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee |
|
|
| Back to top |
|
|
|
| Nathan Sanders... |
Posted: Fri Nov 06, 2009 11:49 pm |
|
|
|
Guest
|
In article <87my2zi1c6.fsf at (no spam) informatik.uni-freiburg.de>,
LEE Sau Dan <danlee at (no spam) informatik.uni-freiburg.de> wrote:
[quote]"Nathan" == Nathan Sanders <nsanders at (no spam) williams.edu> writes:
That is indeed a crucial point. We use *OUR* language capacity
to interpret formal systems; we don't ordinarily use the defined
interpretation algorithms from within the formal systems
themselves.
Nathan> In fact, this is precisely one of the biggest problems I
Nathan> face when I teach logic. Students quite frequently ignore
Nathan> parts of the definition of well-formed formulas, because as
Nathan> humans, they see no meaningful difference between "(P & Q &
Nathan> R)" and "(P & Q) & R".
Maybe, you could try using the postfix notation instead to see if that
helps stopping them from thinking so. When people see something
unfamiliar (postfix notation in this case), they may refrain from
generalizing their past knowledge into the new field.
[/quote]
Why would I introduce a completely different notation from that that
is (a) most common and (b) used in the textbook?
[quote]Nathan> But there *is* a meaningful difference *within* the logical
Nathan> system itself! Because "&" is strictly defined as a binary
Nathan> connective, the first string is not well-formed and cannot
Nathan> be assigned an interpretation, but the second string is
Nathan> fine.
It depends.
[/quote]
No, it doesn't depend. That is how the system is defined.
Of course, we could use a different system, but then that wouldn't be
the system I'm talking about!
Nathan
--
Nathan Sanders
Linguistics Program
Williams College
http://wso.williams.edu/~nsanders/ |
|
|
| Back to top |
|
|
|
| Nathan Sanders... |
Posted: Fri Nov 06, 2009 11:51 pm |
|
|
|
Guest
|
In article <874op7gg7k.fsf at (no spam) gmail.com>,
LEE Sau Dan <danlee at (no spam) informatik.uni-freiburg.de> wrote:
[quote]"Nathan" == Nathan Sanders <nsanders at (no spam) williams.edu> writes:
I don't believe that the formal notation systems you are talking
about really exist except as idealisations.
Nathan> Isn't that precisely what mathematical notation is for?
That's the goal, but we are far far from that goal.
[/quote]
Nonsense. You've clearly not taken a course in mathematical logic, or
perhaps any mathematics course involving rigorous definitions.
[quote]Nathan> It'd be a shame if it couldn't do it's job!
It'd be a shame if you don't realize that:
In theory, theory and practice coincide;
in practice, they don't.
[/quote]
How people outside the system misuse the system is of no concern when
talking about the properties of the system itself.
Nathan
--
Nathan Sanders
Linguistics Program
Williams College
http://wso.williams.edu/~nsanders/ |
|
|
| Back to top |
|
|
|
| Nathan Sanders... |
Posted: Sat Nov 07, 2009 12:18 am |
|
|
|
Guest
|
In article <87aayzgg7l.fsf at (no spam) gmail.com>,
LEE Sau Dan <danlee at (no spam) informatik.uni-freiburg.de> wrote:
[quote]"Nathan" == Nathan Sanders <nsanders at (no spam) williams.edu> writes:
So you think that someone wrote a handbook of mathematical
notation that formally defines it and mathematicians are supposed
to stick to those rules. That somehow must have evaded my
attention.
Nathan> "A" handbook? No.
Then, are there any "language academy" for mathematical notations?
[/quote]
A single academy for all possible variations of mathematical notation?
No, not that I'm aware of. But there are plenty of textbooks and
other references that each provide the details and definitions for
individual instances of a mathematical notation.
[quote]In the case of mathematical notation however, we know the
rules, because we designed them!
But not in an organized plan, but as ad-hoc-addictions and
changes piling up, and governed by taste.
Nathan> How does that contradict what I said?
A patchy system usually has may flaws, due to the gaps and overlaps
between the different patches.
[/quote]
I still see nothing that contradicts what I said. Unless we are
struck by amnesia, we know the rules of any system we have designed,
therefore description is useless (description is what you do when you
*don't know* the rules and are trying to figure them out).
[quote]Nathan> The rules were designed, we know what they are,
That doesn't mean the rules are complete, or not self-conflicting.
Esperanto was also designed. So, is it flawless and free of ambiguities?
[/quote]
Where did you get that implication?
The implication is: designed -> rules are known.
[quote]Nathan> so it's reasonably to approach mathematical notation from a
Nathan> prescriptive standpoint.
Do linguists approach Esperanto from a prescriptive standpoint?
[/quote]
The various versions of Esperanto learnt as second languages (as well
as those reportedly acquired as first languages) are all different
from each other (every idiolect is a different language), and they all
have rules that are unknown. So if any linguistic analysis would be
applied (this is rare, since linguists focus more on natural languages
than constructed languages), then descriptive analysis would be the
first place to start.
[quote]Do Esperanto speakers really use the language that way?
[/quote]
According to Zamenhof's rules? No, his rules are insufficient to
account for all the details needed for Esperanto to be used as a human
language. For example, Zamenhof provided no phonetic rules (just
vague references to euphony), so it is unknown whether /t/ should be
dental or alveolar, aspirated or plain. Each speaker has to fill in
that information on his own.
Since we know the rules for Zamenhof's Esperanto, description is
pointless. But since the rules are inadequate, prescription doesn't
work very well either, since you can't prescribe a rule that doesn't
exist!
(Note that here I'm talking specifically and only about Zamenhof's
Esperanto, as designated by his list of rules. The other versions of
Esperanto are covered in the previous section.)
Nathan
--
Nathan Sanders
Linguistics Program
Williams College
http://wso.williams.edu/~nsanders/ |
|
|
| Back to top |
|
|
|
| Brian M. Scott... |
Posted: Sat Nov 07, 2009 12:35 am |
|
|
|
Guest
|
On Sat, 07 Nov 2009 11:35:07 +0800, LEE Sau Dan
<danlee at (no spam) informatik.uni-freiburg.de> wrote in
<news:87ljijgg7o.fsf at (no spam) gmail.com> in sci.lang:
[...]
[quote]Nathan> For the purposes of this discussion, I only care about how
Nathan> it's actually defined formally, not how it gets
Nathan> misinterpreted from outside the system.
Um... you're a prescriptivist?
[/quote]
Of course, when it comes to mathematical notation. If, for
example, you write -2^4 when you mean (-2)^4, you're simply
wrong -- *unless* you've explicitly redefined operator
precedence in whatever you're writing.
Brian |
|
|
| Back to top |
|
|
|
| Nathan Sanders... |
Posted: Sat Nov 07, 2009 12:36 am |
|
|
|
Guest
|
In article <87fx8rgg7m.fsf at (no spam) gmail.com>,
LEE Sau Dan <danlee at (no spam) informatik.uni-freiburg.de> wrote:
[quote]"Nathan" == Nathan Sanders <nsanders at (no spam) williams.edu> writes:
No. You seem to consider mathematical notation as a
prescriptivist considers English.
Nathan> Of course. Mathematical notation, unlike language, was
Nathan> consciously and intentionally designed.
Designed by whom? God?
[/quote]
By humans, obviously.
[quote]If you realized that it is designed by human beings, would you still
suppose that it is flawless?
[/quote]
I don't "suppose" it; I know it.
Are you really unaware that mathematical logic defines the notion of
well-formed formula?
Can humans design flawed notation systems? Of course. Those are
broken systems that good mathematicians would not use, because such
systems result in exactly the kind of ambiguity and imprecision that
mathematical notation is ordinarily designed to avoid. How terrible
it would be to have a mathematical notation with no defined order of
operations or grouping!
[quote]Nathan> Both systems have governing rules, but for language, we
Nathan> don't know what they are, so we can only describe the system
Nathan> through descriptive observation.
You don't know the *precise and complete* rules for mathematical
notations, either.
[/quote]
For any given well-defined notation, yes, we do. That's the whole
point of having a well-defined notation system.
[quote]And there is NO SINGLE system.
[/quote]
I never said there was. In fact, I've been quite clear that there are
multiple systems, and what you think is ambiguity is really just
someone not having yet picked a system to use.
[quote]Nathan> In the case of mathematical notation however, we know the
Nathan> rules, because we designed them!
No.
[/quote]
Are you suggesting that after we design a system, we magically forget
how we set it up? I should hope not!
[quote]Even if we designed them, there could be flaws to leave in holes
for ambiguities. Sometimes, the designers DELIBERATLY allow ambiguities
for flexibility. These are not bugs, but features! Just revisit the
SQL example.
[/quote]
As I explained in my response to the SQL example, there is no
ambiguity there. Just because someone without full knowledge of the
situation can't predict how a given command will be interpreted
doesn't mean that the command is ambiguous. It is fully predictable,
once you know all the relevant information (table statistics, queries,
etc.). A computer does have this knowledge, and so it will run the
command exactly the same way every single time if the information
necessary to run it stays constant.
[quote]Strange attitude for a linguist.
Nathan> Hardly strange at all! Linguists don't describe English by
Nathan> how French speakers interpret it.
What does this have to do with how *human programmers* interpret program
code written by another *human programmer*?
[/quote]
Human programmers are "outside the system". The have their own rules
that may be different from how the computer language is defined.
Why is so hard for you to understand that when I say "computer
language", I mean "computer language", and not "whatever bastard
interpretation could possibly be assigned to a computer language when
you are allowed to ignore how it has been defined"?
[quote]What does this have anything to do with how *mathematicians* read
mathematical formulae written by another *mathematician*?
[/quote]
Mathematicians are "outside the system". The have their own rules
that may be different from how the mathematical notation is defined.
Why is so hard for you to understand that when I say "mathematical
notation", I mean "mathematical notation", and not "whatever bastard
interpretation could possibly be assigned to a mathematical notation
when you are allowed to ignore how it has been defined"?
Nathan
--
Nathan Sanders
Linguistics Program
Williams College
http://wso.williams.edu/~nsanders/ |
|
|
| Back to top |
|
|
|
| Joachim Pense... |
Posted: Sat Nov 07, 2009 12:54 am |
|
|
|
Guest
|
Ant贸nio Marques (in sci.lang):
[quote]On Nov 7, 1:08聽am, LEE Sau Dan <dan... at (no spam) informatik.uni-freiburg.de
wrote:
"Nathan" == Nathan Sanders <nsand... at (no spam) williams.edu> writes:
There is an example where ambiguity is _not_ ungrammatical but by
design. In the database language SQL, you can write
select * from A where x > y
(Assuming that you have a table named A that has two number
columns x and y.) Now this will produce a list of all rows where
the x entry is bigger than the y entry, but the order in which
the rows appear is unpredictable. 聽(The database system will use
table statistics, recent buffered query results and whatever to
decide which order it can produce in the shortest time).
Nathan> "And whatever"? 聽Is it really undefined and random?
Yes. 聽The spec. 聽says clearly that 聽the order of the results rows are in
an unspecified 聽order. 聽i.e. 聽 you as a 聽programmer should not 聽make any
assumption on the ordering of 聽the resulting rows. 聽An implementation is
allowed to use any order, and the order does not have to be consistent a
second time you use an identical query.
The order 聽is arbitrary, unpredictable. 聽Whether 聽it is random 聽is up to
the 聽implementation. 聽(Not 聽that 聽"random" is 聽just 聽one possibility 聽to
realize "undefined", and it differs from "arbitrary".)
Is that hard to understand? 聽Is that ambiguous?
Sorry, but where is the ambiguity? Of course the results of a SELECT
query are unordered, unless there is an ORDER BY clause. What's
ambiguous about that? Where does that enter the discussion?
[/quote]
It is ambiguous in so far as the outcome is not predictable.
Joachim |
|
|
| Back to top |
|
|
|
| Nathan Sanders... |
Posted: Sat Nov 07, 2009 12:54 am |
|
|
|
Guest
|
In article <871vkag791.fsf at (no spam) informatik.uni-freiburg.de>,
LEE Sau Dan <danlee at (no spam) informatik.uni-freiburg.de> wrote:
[quote]"Nathan" == Nathan Sanders <nsanders at (no spam) williams.edu> writes:
Then, are there any "language academy" for mathematical
notations?
Nathan> A single academy for all possible variations of mathematical
Nathan> notation? No, not that I'm aware of. But there are plenty
Nathan> of textbooks and other references that each provide the
Nathan> details and definitions for individual instances of a
Nathan> mathematical notation.
Are you sure there are no conflicts between what each of these books
specifies?
[/quote]
WHich part of "individual instances" didn't you grasp?
[quote]Nathan> The rules were designed, we know what they are,
That doesn't mean the rules are complete, or not
self-conflicting.
Esperanto was also designed. So, is it flawless and free of
ambiguities?
Nathan> Where did you get that implication?
From what you said above. Namely, designed ==> flawless
[/quote]
That isn't what I said. What I said was: "The rules were designed, we
know what they are"
Where do you see anything having to do with flaws in that statement?
(Note that it was made in a context about prescription, not about
flaws.)
Nathan
--
Nathan Sanders
Linguistics Program
Williams College
http://wso.williams.edu/~nsanders/ |
|
|
| Back to top |
|
|
|
| Joachim Pense... |
Posted: Sat Nov 07, 2009 1:05 am |
|
|
|
Guest
|
Ant贸nio Marques (in sci.lang):
[quote]On Nov 6, 9:19聽pm, Joachim Pense <s... at (no spam) pense-mainz.eu> wrote:
Ant贸nio Marques (in sci.lang):
On 6 Nov, 18:44, Joachim Pense <s... at (no spam) pense-mainz.eu> wrote:
Why do you think higher level
programming languages exist? They have been invented because it is
easier to write complex programs in them than it is if you write
machine code that does the equivalent job. Some programming languages
are flexible in the code they accept precisely to allow for pragmatics
in the code.
I must be missing something. What exactly (in programming languages)
are you talking about?
Pragmatics. I had given an example before.
Must have missed it. Be so kind as to elaborate, give another example,
etc.
[/quote]
The following lines of Perl all do the same thing but are pragmatically
different:
if ($a != 1) {$b = 17}
unless ($a == 1) {$b = 17}
$b = 17 unless $a == 1
$a == 1 or $b = 17
$a != 1 and $b = 17
Joachim |
|
|
| Back to top |
|
|
|
| Nathan Sanders... |
Posted: Sat Nov 07, 2009 1:07 am |
|
|
|
Guest
|
In article <877hu2g7f0.fsf at (no spam) informatik.uni-freiburg.de>,
LEE Sau Dan <danlee at (no spam) informatik.uni-freiburg.de> wrote:
[quote]"Nathan" == Nathan Sanders <nsanders at (no spam) williams.edu> writes:
Maybe, you could try using the postfix notation instead to see if
that helps stopping them from thinking so. When people see
something unfamiliar (postfix notation in this case), they may
refrain from generalizing their past knowledge into the new
field.
Nathan> Why would I introduce a completely different notation from
Nathan> that that is (a) most common and (b) used in the textbook?
Not a completely different one. But you may need to use non-standard
things for:
1) new concepts;
[/quote]
Actually, we do cover concepts not formalized in the textbook
(pragmatics), and I do introduce new formal notation for those
concepts. However, this comes near the end of the semester, after
they're already long-accustomed to the standard notation in the
textbook (infixed binary logical connectives and prefixed quantifiers,
negation, and predicates), so I'm not going to switch things up on
them in the last few weeks. Especially not with postfix notation!
[quote]2) convenience (to introduce short-hands, such as Einstein's notation)
[/quote]
The point of the formal definitions is to have precision. Convenience
is nice, but is not the primary goal (or even a goal; it doesn't
really matter at all how "convenient" the logical system is).
You don't seem to have grasped the difference between how a formal
notation is defined and how it could be used beyond the scope of those
definitions. Until you understand that difference, it makes sense why
you've had trouble seeing that the difference between how the notation
will be interpreted according to its own definitions and how it could
be interpreted when subjected to interpretation rules from outside the
system (e.g., by humans).
Nathan
--
Nathan Sanders
Linguistics Program
Williams College
http://wso.williams.edu/~nsanders/ |
|
|
| Back to top |
|
|
|
| Ant髇io Marques... |
Posted: Sat Nov 07, 2009 1:08 am |
|
|
|
Guest
|
On 7 Nov, 06:05, Joachim Pense <s... at (no spam) pense-mainz.eu> wrote:
[quote]Ant髇io Marques (in sci.lang):
On Nov 6, 9:19爌m, Joachim Pense <s... at (no spam) pense-mainz.eu> wrote:
Ant髇io Marques (in sci.lang):
On 6 Nov, 18:44, Joachim Pense <s... at (no spam) pense-mainz.eu> wrote:
Why do you think higher level
programming languages exist? They have been invented because it is
easier to write complex programs in them than it is if you write
machine code that does the equivalent job. Some programming languages
are flexible in the code they accept precisely to allow for pragmatics
in the code.
I must be missing something. What exactly (in programming languages)
are you talking about?
Pragmatics. I had given an example before.
Must have missed it. Be so kind as to elaborate, give another example,
etc.
The following lines of Perl all do the same thing but are pragmatically
different:
if ($a != 1) {$b = 17}
unless ($a == 1) {$b = 17}
$b = 17 unless $a == 1
$a == 1 or $b = 17
$a != 1 and $b = 17
[/quote]
I see what you mean. Sorry I hadn't spotted it earlier and made you
repeat it.
However, I don't think these are examples of pragmatics. They are
structurally different ways of getting the exact same result; their
intent, as you mention, is to better model what's on the programmer's
mind - say, make the language more semantic programmer-wise. In what
way do you consider it to be an example of pragmatics? |
|
|
| Back to top |
|
|
|
| LEE Sau Dan... |
Posted: Sat Nov 07, 2009 1:45 am |
|
|
|
Guest
|
[quote]"Nathan" == Nathan Sanders <nsanders at (no spam) williams.edu> writes:
Maybe, you could try using the postfix notation instead to see if
that helps stopping them from thinking so. When people see
something unfamiliar (postfix notation in this case), they may
refrain from generalizing their past knowledge into the new
field.
[/quote]
Nathan> Why would I introduce a completely different notation from
Nathan> that that is (a) most common and (b) used in the textbook?
Not a completely different one. But you may need to use non-standard
things for:
1) new concepts;
2) convenience (to introduce short-hands, such as Einstein's notation)
--
Lee Sau Dan 窗 ~{ at (no spam) nJX6X~}
E-mail: danlee at (no spam) informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee |
|
|
| Back to top |
|
|
|
| LEE Sau Dan... |
Posted: Sat Nov 07, 2009 1:48 am |
|
|
|
Guest
|
[quote]"Nathan" == Nathan Sanders <nsanders at (no spam) williams.edu> writes:
Then, are there any "language academy" for mathematical
notations?
[/quote]
Nathan> A single academy for all possible variations of mathematical
Nathan> notation? No, not that I'm aware of. But there are plenty
Nathan> of textbooks and other references that each provide the
Nathan> details and definitions for individual instances of a
Nathan> mathematical notation.
Are you sure there are no conflicts between what each of these books
specifies?
Nathan> The rules were designed, we know what they are,
[quote]
That doesn't mean the rules are complete, or not
self-conflicting.
Esperanto was also designed. So, is it flawless and free of
ambiguities?
[/quote]
Nathan> Where did you get that implication?
From what you said above. Namely, designed ==> flawless
Nathan> The implication is: designed -> rules are known.
--
Lee Sau Dan 窗 ~{ at (no spam) nJX6X~}
E-mail: danlee at (no spam) informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee |
|
|
| Back to top |
|
|
|
|
|
All times are GMT - 5 Hours
The time now is Fri Dec 04, 2009 1:48 pm
|
|