Re: object system...
- From: "cr88192" <cr88192@xxxxxxxxxxx>
- Date: Fri, 16 Jan 2009 00:41:16 +1000
"Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx> wrote in message
news:t15b6yjtquuw$.11rsjbtqm56k5.dlg@xxxxxxxxxxxxx
On Thu, 15 Jan 2009 10:13:54 +1000, cr88192 wrote:
"Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx> wrote in message
news:12cbzc4j7mkdd.1hdv3ksqztptf.dlg@xxxxxxxxxxxxx
On Thu, 15 Jan 2009 00:23:07 +1000, cr88192 wrote:
now, as for the barber:
it is a paradox if both possibilities are to be considered at the same
time (as in an axiom), however if on each day he makes this same
decision
(using the prior day as his current status, as is more typical in
procedural
logic), then he will only shave every-other day (the axiom will be true
at one try, but false at the next, then true, then false, ...).
He does not make decisions, he makes a statement about decisions. This
statement is self contradictory and thus cannot be used as a basis for
decision making. Other statements could be.
yes, I guess one would have to change the "does" to "did" to really make
this work...
Yes, but then it becomes uninteresting because it lacks its prediction
power. When you write +, you know that + will yield a result in a certain
way. This is the whole idea of programing. If you knew the result, you
would not need to program with +. If + is already executed then you also
know the result. So programming is a promise. But if the promise is that
"it will shave everybody except those who don't shave themselves," then
you
or your customers have a problem.
still to say he will do something implies a decision will be made as to the
matter, and when it comes to this decision, a decision will be made, and it
will come out one way or another.
it is only a problem if one demands that their logic be stateless, rather
than stateful, and thus come up to a paradox rather than an alternating
answer...
it is much like trying to use an integrator over a non-trivial segment of
the sine function. there is a problem, if only because one is trying to
integrate over a periodic function, rather than evaluating in the context of
discrete chains of events...
so, as I see it, the whole paradox is a misnomer, if anything, because this
would not turn out this way in practice (and, if set up, the barber would
invariably end up making an alternating set of decisions...).
he would evaluate "do I shave myself?" and would remember answer from the
last time. then it would work like a binary negation, and he would choose
the other way, and the next time, the opposite again.
granted, this assumes the barber used imperative logic, an actual human
being far more likely to realize that the whole thing is silly...
however, as can also be noted, software is based on code, not on
abstract
logic...
Well, that is an interesting statement. It is business logic I guess? If
your software is not based on formal logic, then you cannot reason about
it in formal terms. My condolences...
it is based on behavior...
one considers the behaviors that will be exhibited as one feeds in a
whole
range of inputs, abstractly considering the input space and the output
space, much like light through a lens or prism...
so, the central aspect is the algorithm, anything works so long as an
algorithm can be made for it, ...
Yes, but you have to define what it does do. You canot do it outside
formal
logic. Even the above is actually a logcal statement:
IF P does B AND A is defined as doing B THEN P implements A
or, regarding code as a sequence of discrete commands and events it may do
things not easily classified as such...
my logic is usually something I had regarded as latches and gears, but all
this would seem to be something different...
if we say that in reality the types do not exist, but are merely
manifestations of the present state, then there is not a problem with
saying that a type is represented by a type...
Where that follows from? Existence in "reality" is irrelevant to the
issue
of consistence. Does reality exist?
a type is a logical construct, rather than a physical one, and so if a
type
is in conflict, but the physical object exists, one opts with the
physical
object. logic is naturally opposed to cyclic dependencies and systems,
whereas physical reality contains them in abundance (as self-reinforcing
patterns...).
In that case you break semantical mapping that a computational object (or
state) corresponds to some definite value. The mapping is the context of
the program. When broken, the computer continues to exist and maybe is
computing something, but nobody can say what. It becomes a chunk of
silicon, plastic and some toxic heavy metals.
another way to regard computers is via the original concept of cybernetics
(before the time this word became de-facto associated with humanoid robots,
likely in connection to terminator or similar...).
but, in any case, the computer is its own self-reinforcing pattern, already
well beyond the stage of a formally-defined system operating purely on
input, output, and intermediate steps...
it is a model, but not one the reality of the matter is obligated to
follow...
but, yes, a relevant phrase here is "I think therefor I am", which could
be
reworded: "if I did not exist I could not consider whether or not I
exist".
and, so, the existence of reality can be asserted, even as lacking as the
substance of this existence would seem to be at times (for example, that
everything that exists, has this existance based primarily on state, and
that apart from state there is no form either...).
so, taken further, existance can be asserted to exist as an "absolute",
because if it did not exist at any other point along the chain, it would
not
exist "here" either...
similar reasoning can also be used for the existence of morals, ...
but, then one can debate whether or not this existence is absolute or
relative, the structure and form in which it all exists, ... (allowing
for a
world/truth which is at the same time both relative and absolute, where
the
form becomes relative, and anything can be considered as true so long as
it
can be reconciled with those things which can be said to exist...).
for example, it is reasonable to describe the sun and stars from a
geocentric perspective, or through the use of analogies and symbolism,
and
still regard this as true, but this is limited at which point they come
in
conflict with the actual sun and stars (so, a person can correctly
describe
them by analogies, but at which point they say that these analogies ARE
the
objects they refer to, then the statements are no longer correct).
so, the sun could be said to rise in the east and set in the west, but it
is
incorrect to say that the sun orbits the earth (and it is not in conflict
to
assert at the same time that the earth orbits the sun, and also that the
sun
rises and sets).
There is a fundamental principle that a logical system cannot reason about
itself. So any proposition like exists (self) as well as not esits (self)
is automatically either inconsistent or undecidable. It is a wonder how
humans managed to do this stuff all the time in the history of
pilosophy...
(:-))
well, I am not sure the basis of the above claim (that a system is unable to
reason about itself).
part of what I was going on was derived from my understanding of Descartes,
....
but, alas, philosophy is an area I don't like treading in too much... the
greater mystery is why I keep running into it...
but, then I am reminded of things, like many of the claims of Thomas
Aquinas, which though fairly good make one major and uncertain assumption:
that of a deterministic universe.
but, alas, it is probably an odd mix in my case to assert both a predestined
outcome and also a non-deterministic universe, but as I see it, there is an
easy answer: for predestination to require determinism also requires the
future to not exist prior to the past, and if one allows that the future
exists concurrently with the past, then no determinism is needed, and the
future is still fixed...
or such...
do you use an interface to access static methods?...
Static method? If you mean C++ static member, that is an artefact of
its
poor design, which confuses visibility issues with types.
close enough... I meant like Java and C# static methods, where the
class
can be accessed apart from its instance...
What for? If type is not a first-class citizen you cannot do anything
useful with it anyway.
both allow some methods and fields to be called without instancing the
object, these being static fields and methods (in contrast to
instance-fields or virtual functions, which require an instance...).
but, one can't use an interface to access a class by itself, and it does
not
make much sense to do so...
Interface too can have some properties defined in terms of third types
which can be queried without any instances. For example an interface of an
abstract modular number, might have a property the modulus. The result is
of a different type of course, than the instances of the interface. Or
consider an array interface. It has an operation that returns the
interface
of its index.
In general, types and iterfaces may have operations defined on them as on
first-class objects. These operations comprise type algebra. Usually they
are compile-time functions when types are static.
It makes little sense to allow the programmer to introduce new operations
of this kind. Unless, types become trully first-class.
yes, ok...
yet, both tend to use built-in fixed-size types, so the question is
whether
the feature in question can deliver these benefits over, for example,
what
is possible in the JVM or CIL?...
This is a wrong question. A numeric type is like any other type. Do you
have predefined "emploee" type? It is like to quest what benefits offer
programming, over what? Not programming? It is the program semantics that
determines the type, not the language or its target.
I suspect we regard "programming" in very different ways...
you seem to regard it more as mapping some pre-existing idea or purpose onto
the computer (ones' mind is mapped onto the computer, yet the "computer" in
this case is some sort of collection of abstractions?...).
this is in contrast apparently to regarding the computer in its own right,
and considering the relation between the user and computer (or the computer
and reality) as much more bidirectional (like, the computer and the software
world already exist, I more interact with it and try to work on it and make
things better...).
I guess another question is how one regards the concept of cybernetics and
how that plays into all this...
in most mainstream languages, they are not discouraged.
in fact, they are the only things offered.
(:-)) You know, the mainstream languages are quite miserable, and the
current state of software developing is even worse.
maybe, but it goes forwards at a fast pace...
Yes it worsens fast...
lots of people writing software, then rewriting software, making more
software, ...
Writing software to adopt other software, software to maintain software
etc. 80% of this software is just not needed. The system feeds and
produces
itself...
it all keeps going though...
if nothing grows or changes then the system is dead, as it were...
Nope, you forgot the rest of ring arithmetic:
a+b mod 20
a*b mod 20
...
20 bits, not base 20...
Yes. 2**20
'mod 20'
to me at least, implies the same as:
(a+b)%20
since 'mod' is usually used in a linear rather than an exponential sense...
(a+b)&((1<<20)-1)
(a*b)&((1<<20)-1)
That works only when N = 2**n. It would not do with a week day: Sunday +
one day = Monday.
((a+b)%7)
but then a left and right circular shift is a little harder...
while(cnt--)v=(v&1)?((v+7)>>1):(v>>1);
And sorry, do you call it a language?
?...
I call it MESS.
k...
Anyway, the point is, when you add values to the type, you get another
type. The argument about safe ranges is bogus.
The right technical term is substitutability = preservation of all
propositions about all possible programs using the type.
Substitutability
does not hold even with safe ranges. That means, each time when you
replace one type with a machine type you have to analyse each use case
of.
one can consider that a 32-bit integer has 32 bits, and usually that
seems
sufficient to consider its behavior...
part of its behavior may also be overflow, although personally I feel it
is
not a good idea to base algos around particular overflow behavior / ...
(apart from the use of explicit masking), since it could introduce bugs
if
more bits are used internally (for example, smaller types may actually
periodically be represented as bigger types, and then re-contracted
later,
creating the possibility that overflowed bits might still be in use).
If you ignore overflow exceptions, then necessary, the semantics becomes
one of arbitrary precision integer number. This is a possible way and some
languages go it. But it might be very inefficient and anyway, some
applications need ranged numbers from the application domain.
yes, I have implemented languages like this...
usually it requires one to check for overflow whenever doing an operation.
I remember there were a few little tricks to identify overflow without
needing to calculate or preserve the carry bit (useful when working with
full precision numbers), but I forget the details.
maybe something like:
((a^b)&0x80000000)
but this also detects adding values of different signs (possible borrow
bits), but maybe this was the point, I forget...
so, we may have a few rare algos which use 32-bit integers but confine
the
operating range to 28 or 30 bits (or even 16 bits for some operations).
but,
mostly this is when implementing bignums, which are something better off
implemented in assembler if possible (an ASM-based int128 multiply or
divide
is almost invariably faster than a C-based multiply or divide).
another option then is to use 32 bit values, but implement some algos
using
64 bit values internally (it is a tradeoff on x86...).
sadly, float128 operations are a bit more complicated, and so I have yet
to
write specific ASM versions of the operations...
Yes this is complicated so long you are trying to put it all together into
one numeric type. That is impossible.
So let the programmer decide. Give him ranged numbers, modular numbers and
arbitrary precision ones. He will choose what he actually need. Don't give
him any built-in integer. People are lazy to think. He must be forced to
scratch his head each time he feels a numeric type is necessary. It is a
design decision he must made. If he chooses a ranged integer, then he also
must specify the range, it is a part of the program, not of the language
or
an implementation of.
maybe like:
X PIC(99999)
but oh well, I am currently operating more in the domain of implementation
than design...
I am lazy and can just rip off designs for all this stuff designed by other
people, and verify that everything is compatible and working, ...
it can also be noted that most processors wont have built-in operations
for these cases anyways (and many expressions in the above would likely
be
reduced to constants by the compiler).
Exactly, this is why I want the compiler to implement the semantics of,
instead of writing tons of macros, so typical to C.
but, these sort of features don't come free...
I don't see why. OK, there is certainly language complexity issue and
compiler design ones. However, the text of the Ada language standard is
shorter than one of C++, being much more precise regarding the semantics.
So actually I think that a cleaner semantics pays off both for compiler
vendors and programmers.
not C is not C...
for example, Ada is not C or C++ (or one of the other majorly dominant
languages), and that in itself is a major problem...
it is like, if I went and endorsed Scheme, but even then it would still not
be, for example, JavaScript...
Well, if your customers accepted any rubbish, you could use random
generator in order to produce code... (:-))
actually... some of my algos are based on using random number
generators...
These use it as an input.
yes, true...
others use it as a core of the algo itself (in cases where the PRNG logic is
embedded as a part of the algo).
much like hash tables can have almost magical abilities to make code
faster,
random number generators can have almost magical ability to make many
self-organizing constructs...
I don't like hash tables. They have an unpredictable behaviour and
creating
good hash function requires a lot of work. It cannot be done routinely.
Then binary search containers have some advantages, such as ordering. This
allows to match, say, text against table looking for the longest prefix.
To
me this pays off a minor performance hit.
yeah, depends on the task what is better.
as for hash functions, I used to have this problem a lot, but when I had
more or less fused together the hash algo and a PRNG, the hash-function algo
issue largely went away, since a PRNG based algo seems to work fairly well
with almost any kind of data it is given (apart from maybe floating point
and geometric data, or purely random input values).
one can also use genetic algorithms, but the problem with these is that
they
are both too slow and too limited to really be of much use for solving
most
practical problems...
Genetic algorithms is a hype, a very old one, by the way. If I correctly
remember they were first proposed under a different name in 40s-50s, I
don't have the book at hand. They simply cannot work. The problem is that
you need a selection function that decides whether a try was good. In AI
area the complexity of this function is same as one of plain
classification, which was the whole goal of learning. Otherwise any other
method of learning will do better. (:-))
usually I just dealt with problems where the results could be tested and a
numerical weight assigned (the result being to either minimize or maximize
some value...).
but then a problem is that one spends a lot more time trying to tweak the
tests to get the desired results, and even then the results take a long time
and are inferior to a human-produced result...
now, these other issues could be glossed over if the result could at least
be given quickly...
none the less I include some code for both GAs and NNs in my library
code,
as there are rare cases where they are useful (one just doesn't want to
use
GAs for anything where they need the answer in a reasonable amount of
time,
and NNs aren't really applicable to most problems...).
Right, because that was known in 50s too. NN is just another name for that
time "perceptron" which is a linear classifier. As such it simply cannot
separate classes with non-linear edges, for example like one circle put in
another. What do guys do? They use a kernel that linearizes the problem.
And how to find the kernel for a given problem? Right, to think it out and
then to try it on. A great idea, it is the kernel which in fact does the
job. They could try arbitrary classifiers instead, with far less efforts
saving the community and rain forests from tons of quasi-scientific papers
on NN...
yeah...
I had partly reworked the notion of an NN a little for my uses, more into a
kind of associative node-graph with possible embedded procedural logic and
customizable neuron behavior (each neuron may have a type containing
customized behaviors). still doesn't make them all that useful for much (and
there is a major weak point that this particular design can't be "templated"
or "instanced", which is a little bit of a detractor for many possible
uses).
one would additionally have to find some additional abstractions to make
this approach more managable...
then there is the raw numerical-evaluation variety (where the NN is
essentially a big mass of numbers being operated on by some or other
transforms), which is at least is a lot more useful for many tasks.
but, to a large degree, NNs of this sort seem a good deal more like a big
glorified matrix multiply...
one can then add something similar to IIR filtering, to give it more
interesting (but less stable) behavior, or change the shape of the network,
since a huge-scale matmult would be computationally expensive (given the
like O(n^3) complexity costs of matrix multiplies, where they loose much of
their practicality before one even gets out of the single digits...).
in the past, some of my ideas had floated around similar but different
algos, which I have since learned are all sort of lumped together under the
general term "tensor calculus" (or "multilinear algebra"...).
but, oh well, specific algos also work, like how one can largely use vectors
and matrices on their own as a means to accomplishing specific tasks, and
generally forsake with all the generality and theory found in a typical
textbook...
so, one can instead imagine a NN as a 4D numerical associative-space (each
neuron interfacing with only those directly adjacent to it), and so relates
a 2D input to a 2D output. this could be done much cheaper at a much larger
scale than huge matmults could, but is far less general purpose...
alternatively it seems there are more efficient algos (aka: ones without an
O(n^3) complexity), which could be worth looking into given a combination of
huge-ass matrix multiplies does seem like a fairly general and direct way to
do some things...
matrices:
A forwards martix (FIR filtering);
B alternate matrix (IIR filtering);
C (possible), used in backpropagation, potentially just the inverse of A;
D (questionable), also backprop, potential inverse of B.
matrices then needing to be of sufficient size to transform the input space
into the output space, for example, transforming an 8x8 pixel block would
require a 64x64 matrix, or 4096 values, or about 16384 values for all 4
matrices (and several huge matmults and other large matrix operations...).
so, the different notions are different, but it is difficult to find much
good use for any of it...
The answer is much less efforts. This is the major reason why we chose
Ada.
now, can you convince the rest of the world of this?...
It would be quite useless to try. Software developing industry works in a
way that selects technologically inferior solutions. This includes
languages and libraries. There is no way anybody could change this. Maybe
US Congress could, by making all vendors of commercial software fully
liable. Since we have a global crisis, and many software vendors will
vanish anyway, so it would less painful to do this right now, but surely
they would not. So far I am glad to be able to convince some of our
customers not to push for C. This alone took years for work.
it selects typically for the cheapest options, whatever these are...
it is like the water that finds the shortest way down a hill and then carves
a ditch...
the ditch then becomes just as major of a factor as the optimal solution,
since a medium-optimal solution is to let the water keep running its course
and then erode the walls such that eventually the course gets better (the
water gets down the hill faster...).
or such...
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.
- Follow-Ups:
- Re: object system...
- From: Dmitry A. Kazakov
- Re: object system...
- References:
- object system...
- From: cr88192
- Re: object system...
- From: Dmitry A. Kazakov
- Re: object system...
- From: cr88192
- Re: object system...
- From: Dmitry A. Kazakov
- Re: object system...
- From: cr88192
- Re: object system...
- From: Dmitry A. Kazakov
- Re: object system...
- From: cr88192
- Re: object system...
- From: Dmitry A. Kazakov
- Re: object system...
- From: cr88192
- Re: object system...
- From: Dmitry A. Kazakov
- Re: object system...
- From: cr88192
- Re: object system...
- From: Dmitry A. Kazakov
- Re: object system...
- From: cr88192
- Re: object system...
- From: Dmitry A. Kazakov
- Re: object system...
- From: cr88192
- Re: object system...
- From: Dmitry A. Kazakov
- Re: object system...
- From: cr88192
- Re: object system...
- From: Dmitry A. Kazakov
- Re: object system...
- From: cr88192
- Re: object system...
- From: Dmitry A. Kazakov
- Re: object system...
- From: cr88192
- Re: object system...
- From: Dmitry A. Kazakov
- object system...
- Prev by Date: Re: object system...
- Next by Date: Re: object system...
- Previous by thread: Re: object system...
- Next by thread: Re: object system...
- Index(es):
Relevant Pages
|