Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Artificial intelligence

1 view
Skip to first unread message

pointer

unread,
Nov 18, 2009, 9:56:58 PM11/18/09
to
At first i posted this on comp.ai, but there wasnt any answers. Im not
even sure it was received there, although i was able to see it in my
topics list on some news servers (others didnt show it). So i will
assume they didnt like it there :)
I m not sure that this is right group for that, but i will hope its ok.
It is about programming after all...


I am trying to learn from the book AI modern approach. And as you can
imagine, i have lost of question, although posts here make be believe
this is not a good place for beginners.

I was wondering are there any code examples for this book written in c,
c++, php, maybe pascal.
I am trying to learn alone so it would be easier if i could see some
known things in those examples. I dont have experience with python, java
or lisp. If there arent such examples, what do you think i should do?
Learn one of theese languages or try to do it with one of theese i
already know? Sorry if i used wrong group, but i didnt see any better.
If there is one,(more for beginners) please guide me there.

Do you think its not so smart to learn AI like this? Any chance i can
learn something all by myself, without teacher? (although internet is a
nice place for those eager to learn:).

Thank you.

p.s. I would also like to find out about some other literature, so if
you can suggest any, i will appreciate it.

Jonathan Campbell

unread,
Nov 19, 2009, 12:32:57 PM11/19/09
to
pointer wrote:
> At first i posted this on comp.ai, but there wasnt any answers. Im not
> even sure it was received there, although i was able to see it in my
> topics list on some news servers (others didnt show it). So i will
> assume they didnt like it there :)
> I m not sure that this is right group for that, but i will hope its ok.
> It is about programming after all...
>
>
> I am trying to learn from the book AI modern approach.

And as you can
> imagine, i have lost of question, although posts here make be believe
> this is not a good place for beginners.
>
> I was wondering are there any code examples for this book written in c,
> c++, php, maybe pascal.

Russell and Norvig? Second edition? If so the preface mentions a website
and availability of programs.

> I am trying to learn alone so it would be easier if i could see some
> known things in those examples. I dont have experience with python, java
> or lisp.

If you know C, C++ and Pascal, then Java should be easy enough. And also
Python.


If there arent such examples, what do you think i should do?
> Learn one of theese languages or try to do it with one of theese i
> already know? Sorry if i used wrong group, but i didnt see any better.
> If there is one,(more for beginners) please guide me there.
>
> Do you think its not so smart to learn AI like this? Any chance i can
> learn something all by myself, without teacher? (although internet is a
> nice place for those eager to learn:).
>
> Thank you.
>
> p.s. I would also like to find out about some other literature, so if
> you can suggest any, i will appreciate it.

To my mind Russell and Norvig may be too broad for undirected
self-learning. I agree that to learn any part of it properly would
require some practical (programming) work. But it would take many years
yo get through the whole lot.

Hence, pick an area (or better still) a problem that you would like to
solve and focus on that.

Mention a topic (or problem) that interests you and maybe we can help.

Best regards,

Jon C.

--
Jonathan Campbell www.jgcampbell.com BT48, UK.

pointer

unread,
Nov 19, 2009, 10:16:06 PM11/19/09
to
Jonathan Campbell wrote:
> pointer wrote:
>> At first i posted this on comp.ai, but there wasnt any answers. Im not
>> even sure it was received there, although i was able to see it in my
>> topics list on some news servers (others didnt show it). So i will
>> assume they didnt like it there :)
>> I m not sure that this is right group for that, but i will hope its
>> ok. It is about programming after all...
>>
>>
>> I am trying to learn from the book AI modern approach.
>
> And as you can
>> imagine, i have lost of question, although posts here make be believe
>> this is not a good place for beginners.
>>
>> I was wondering are there any code examples for this book written in
>> c, c++, php, maybe pascal.
>
> Russell and Norvig? Second edition? If so the preface mentions a website
> and availability of programs.
>
>> I am trying to learn alone so it would be easier if i could see some
>> known things in those examples. I dont have experience with python,
>> java or lisp.
>
> If you know C, C++ and Pascal, then Java should be easy enough. And also
> Python.
>
Somehow i always wanted to avoid java...
It looks kinda strange, but i guess i should start with it :D
Why cant AI be made in c :(

> If there arent such examples, what do you think i should do?
>> Learn one of theese languages or try to do it with one of theese i
>> already know? Sorry if i used wrong group, but i didnt see any better.
>> If there is one,(more for beginners) please guide me there.
>>
>> Do you think its not so smart to learn AI like this? Any chance i can
>> learn something all by myself, without teacher? (although internet is
>> a nice place for those eager to learn:).
>>
>> Thank you.
>>
>> p.s. I would also like to find out about some other literature, so if
>> you can suggest any, i will appreciate it.
>
> To my mind Russell and Norvig may be too broad for undirected
> self-learning. I agree that to learn any part of it properly would
> require some practical (programming) work. But it would take many years
> yo get through the whole lot.
>
> Hence, pick an area (or better still) a problem that you would like to
> solve and focus on that.
>
> Mention a topic (or problem) that interests you and maybe we can help.
>
> Best regards,
>
> Jon C.

Well, the book (Norvig and Russell) takes 2 semesters normally, i guess
it will take me more. :)
I dont mind programming work, i like doing that, i would just love to
use different languages then those in the book, but hey, what u have to
do, u have to do...
What u think when u say whole lot?
It doesnt surprise me that AI is a subject that needs years of learning.
I only wish that one day that becomes serious work for me. (You think
thats possible without some sort of college?)

I am not quite good at picking a problem that interest me specially. I
would like to make something to pass Turing test, but i guess that will
take some time to do :)

Last days i was reading a lot about subject, and i can say neural nets
looks like interesting topic.

I found a tons of stuff to learn about AI, but sometimes more is less,
and i hope i wont lose time on wrong things, so i would appreciate a
good literature (google does have a good search engine, but i still
believe real people know better).

I hope i get some good answers:) I dont know why so little people
response on these topics. I tried couple news groups and this was only
answer i got. You know any good forum for stuff like this, or is it
really so little people interested on AI (or they just dont like beginners?)

Sorry for all those questions, but except you, i only talked about AI
with chat robots, and they dont know much ;)

Richard Heathfield

unread,
Nov 20, 2009, 5:19:10 AM11/20/09
to
In <he51ll$fen$1...@news.eternal-september.org>, pointer wrote:

<snip>



> Somehow i always wanted to avoid java...
> It looks kinda strange, but i guess i should start with it :D
> Why cant AI be made in c :(

If you can do it in Java, you can sure as eggs is eggs do it in C.
Unfortunately, you can't do it in Java OR C, because Artificial
Intelligence is pretty much defined as "task that we don't yet know
how to do". The moment we discover how to implement an AI project, it
suddenly becomes obvious that it isn't AI!

(By the same logic, it doesn't matter who you vote for, because the
Government always seems to get in. Sometimes the winner is
Conservative/Republican, and sometimes it's Labour/Democrat, but it's
always Government!)

Having said that, there are some cool not-quite-AI things you can do -
e.g. neural networks - and you can certainly do those in C.

<snip>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within

Jonathan Campbell

unread,
Nov 20, 2009, 9:31:28 AM11/20/09
to
pointer wrote:
> Jonathan Campbell wrote:
>> pointer wrote:
>>> At first i posted this on comp.ai, but there wasnt any answers. Im
>>> not even sure it was received there, although i was able to see it in
>>> my topics list on some news servers (others didnt show it). So i will
>>> assume they didnt like it there :)
>>> I m not sure that this is right group for that, but i will hope its
>>> ok. It is about programming after all...
>>>
>>>
>>> I am trying to learn from the book AI modern approach.
>>
>> And as you can
>>> imagine, i have lost of question, although posts here make be believe
>>> this is not a good place for beginners.
>>>
>>> I was wondering are there any code examples for this book written in
>>> c, c++, php, maybe pascal.
>>
>> Russell and Norvig? Second edition? If so the preface mentions a
>> website and availability of programs.
>>
[...]

>
> Well, the book (Norvig and Russell) takes 2 semesters normally, i guess
> it will take me more. :)
> I dont mind programming work, i like doing that, i would just love to
> use different languages then those in the book, but hey, what u have to
> do, u have to do...
> What u think when u say whole lot?
> It doesnt surprise me that AI is a subject that needs years of learning.
> I only wish that one day that becomes serious work for me. (You think
> thats possible without some sort of college?)

Forget about learning "AI", at least for the meanwhile. Learn some part
of it that interests you.

For the meanwhile too (I'm prompted by Richard's comment) treat AI as an
often unrelated collection of "algorithms"; do you know what an
algorithms is? It is a set of program steps that may achieve a goal (or
not achieve, in which case it informs you that it has failed). No magic.

>
> I am not quite good at picking a problem that interest me specially. I
> would like to make something to pass Turing test, but i guess that will
> take some time to do :)
>
> Last days i was reading a lot about subject, and i can say neural nets
> looks like interesting topic.

Yes, neural nets is a nice practical and useful area. But approach them
from a level a good bit lower than emulating mammalian brains.

You could write you own NN software, but I'd advise against it. Use a
package, or an NN API for your favourite language. Although I once wrote
my own NN software (in C), when I need to use an NN these days, I use
the R statistical package (free and supported by some of the best
statisticians in the world). Incidentally, we see that a feedforward
neural network is a 'statistical /algorithm/' (no magic).

An introduction to what I use NNs for is given in:

http://www.jgcampbell.com/ip/pr.pdf

If you have a look in:

http://www.jgcampbell.com/ip/ip9.txt

you'll find some toy data sets that an NN can work on.

Another topic that is sometimes called AI is pathfinding algorithms
(used in games); very simple 2D examples in:

http://www.jgcampbell.com/adsgp/adsgp.pdf

and C++ software available on the page.

In computer games "an AI" is an (internal) player that behaves
'algorithmically', i.e. it attempts to achieve a goal through following
an algorithm (a well defined set of program steps). Incidentally, I've
seen neural networks covered in computer games books; I've never seen
any convincing evidence that NN are used, or would be any use, in a
computer game.

I would probably advise you to use C++ in preference to C just because
of the nice data structures and algorithms and other high-level stuff
provided by the C++ standard library (STL).

Incidentally, the notes referred to above have no special merit and
certainly no originality except that they are collections of stuff that
I have gathered for my own use as a teacher.

Pascal J. Bourguignon

unread,
Nov 20, 2009, 10:18:05 AM11/20/09
to
pointer <ppoka...@gmail.com> writes:

> Why cant AI be made in c :(

Because C is an assembler, that is a low level programming language,
and AI is a complex problem, which requires your brain to burn cycles
on the real problem and not on the details of implementation such as
how many bits you have in a register.

> It doesnt surprise me that AI is a subject that needs years of learning.
> I only wish that one day that becomes serious work for me. (You think
> thats possible without some sort of college?)

Well, really, any craft needs ten years of hard study and work to master.

--
__Pascal Bourguignon__

gremnebulin

unread,
Nov 20, 2009, 10:34:31 AM11/20/09
to
On 20 Nov, 15:18, p...@informatimago.com (Pascal J. Bourguignon)
wrote:

> pointer <ppokazi...@gmail.com> writes:
> > Why cant AI be made in c :(
>
> Because C is an assembler, that is a low level programming language,
> and AI is a complex problem, which requires your brain to burn cycles
> on the real problem and not on the details of implementation such as
> how many bits you have in a register.

More of a "stricly speaking you can, but you really wouldn't want to"

Pascal J. Bourguignon

unread,
Nov 20, 2009, 11:56:34 AM11/20/09
to
gremnebulin <peter...@yahoo.com> writes:

No, it's not "you can", it's "you have".


One problem is that writing:

a = b+c;

in C (C++, and most of the follow suit languages) actually means:

a ≣ b+c [2^w];

with w changing depending on the compiler and processor...


Therefore even for the most trivial tasks, you have to deal with these
low-level considerations, and you must wrap them in higher level
abstractions. This is unfortunately something that most programmers
are too lazy to do.


Another problem is the manual management of memory. Without an
automatic memory management, it is much more difficult to write code
in a non-procedural paradigm, like functional code (because you have
to deal with the temporary values returned by each embedded function
calls).


And there's a long list of et caetera.


Either you spend you time dealing with this issues (for example, if
you make the erroneous choice of using C++ because you imagine it's
higher level than C, you will have to spend an inordinate amount of
time deciding what features of C++ to use and not to use, and
complement it with the right library),
or you spend you time thinking about the complex problems of AI.
Your choice.

--
__Pascal Bourguignon__

Pascal J. Bourguignon

unread,
Nov 20, 2009, 12:01:34 PM11/20/09
to
p...@informatimago.com (Pascal J. Bourguignon) writes:
> One problem is that writing:
>
> a = b+c;
>
> in C (C++, and most of the follow suit languages) actually means:
>
> a ≣ b+c [2^w];
>
> with w changing depending on the compiler and processor...

Sorry, I forgot to adjoin this URL as an example of what I mean:

http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html


Notice that in Common Lisp, (setf a (+ b c)) gives mathematically
exact results when b and c are integers or rational numbers, as long
as you have enough memory to store the numbers. (And when you don't,
most CL implementations can deal gracefully with the out-of-memory
condition, raising an exception that is manageable by the
application).

--
__Pascal Bourguignon__

pointer

unread,
Nov 20, 2009, 10:22:12 PM11/20/09
to
Richard Heathfield wrote:
> In <he51ll$fen$1...@news.eternal-september.org>, pointer wrote:
>
> <snip>
>
>> Somehow i always wanted to avoid java...
>> It looks kinda strange, but i guess i should start with it :D
>> Why cant AI be made in c :(
>
> If you can do it in Java, you can sure as eggs is eggs do it in C.
> Unfortunately, you can't do it in Java OR C, because Artificial
> Intelligence is pretty much defined as "task that we don't yet know
> how to do". The moment we discover how to implement an AI project, it
> suddenly becomes obvious that it isn't AI!
>
> (By the same logic, it doesn't matter who you vote for, because the
> Government always seems to get in. Sometimes the winner is
> Conservative/Republican, and sometimes it's Labour/Democrat, but it's
> always Government!)
>
> Having said that, there are some cool not-quite-AI things you can do -
> e.g. neural networks - and you can certainly do those in C.
>

well, i preety much agree with everything you said, and i would rather
try certain things in c, but would that be a better way?
Would u advise me to do some not-quite-AI things in c or in java?

pointer

unread,
Nov 20, 2009, 10:40:27 PM11/20/09
to
Jonathan Campbell wrote:

> Forget about learning "AI", at least for the meanwhile. Learn some part
> of it that interests you.
>
> For the meanwhile too (I'm prompted by Richard's comment) treat AI as an
> often unrelated collection of "algorithms"; do you know what an
> algorithms is? It is a set of program steps that may achieve a goal (or
> not achieve, in which case it informs you that it has failed). No magic.

Well, i know what algorithms are...I am not that much beginner:)
Actually, i collected some literature about them, some of them are
mentioned a lot in AI, so i guess its not a bad idea to know them better.


>
> Yes, neural nets is a nice practical and useful area. But approach them
> from a level a good bit lower than emulating mammalian brains.
>
> You could write you own NN software, but I'd advise against it. Use a
> package, or an NN API for your favourite language. Although I once wrote
> my own NN software (in C), when I need to use an NN these days, I use
> the R statistical package (free and supported by some of the best
> statisticians in the world). Incidentally, we see that a feedforward
> neural network is a 'statistical /algorithm/' (no magic).
>
> An introduction to what I use NNs for is given in:
>
> http://www.jgcampbell.com/ip/pr.pdf
>
> If you have a look in:
>
> http://www.jgcampbell.com/ip/ip9.txt
>
> you'll find some toy data sets that an NN can work on.
>
> Another topic that is sometimes called AI is pathfinding algorithms
> (used in games); very simple 2D examples in:
>
> http://www.jgcampbell.com/adsgp/adsgp.pdf
>
> and C++ software available on the page.

Well, i downloaded stuff from this links, i see a lot of material for
learning:)
Thanks for the links.

>
> In computer games "an AI" is an (internal) player that behaves
> 'algorithmically', i.e. it attempts to achieve a goal through following
> an algorithm (a well defined set of program steps). Incidentally, I've
> seen neural networks covered in computer games books; I've never seen
> any convincing evidence that NN are used, or would be any use, in a
> computer game.
>
> I would probably advise you to use C++ in preference to C just because
> of the nice data structures and algorithms and other high-level stuff
> provided by the C++ standard library (STL).
>
> Incidentally, the notes referred to above have no special merit and
> certainly no originality except that they are collections of stuff that
> I have gathered for my own use as a teacher.
>
> Best regards,
>
> Jon C.
>

I am starting to get a bit confused, just as i convinced myself i should
start learning java...:)

pointer

unread,
Nov 20, 2009, 10:44:07 PM11/20/09
to
Pascal J. Bourguignon wrote:
> pointer <ppoka...@gmail.com> writes:
>
>> Why cant AI be made in c :(
>
> Because C is an assembler, that is a low level programming language,
> and AI is a complex problem, which requires your brain to burn cycles
> on the real problem and not on the details of implementation such as
> how many bits you have in a register.
>

I think ill write a program that will select something from (java,c,c++)
randomly and just use that:)
Everybody has a different idea about whats best for the job...

Richard Heathfield

unread,
Nov 21, 2009, 3:09:21 AM11/21/09
to
In <he7md3$cq$1...@news.eternal-september.org>, pointer wrote:

<snip>



> well, i preety much agree with everything you said, and i would
> rather try certain things in c, but would that be a better way?
> Would u advise me to do some not-quite-AI things in c or in java?

I would *never* advise *anyone* to do *anything* in Java.

Except that I did, once. But that was under very exceptional
circumstances.

Anyway, if you love programming in C and don't even know Java yet,
it's no contest, is it?

Richard Heathfield

unread,
Nov 21, 2009, 3:10:51 AM11/21/09
to

The difference is that they're all wrong - even me. The only right
decision is the one you make for your own reasons, to suit your own
circumstances. Do you really want to give yourself two learning
challenges at the same time (ANNs and a new language)? Or is one
thing at a time enough for you?

Walter Banks

unread,
Nov 21, 2009, 4:37:03 AM11/21/09
to

pointer wrote:

> Do you think its not so smart to learn AI like this? Any chance i can
> learn something all by myself, without teacher?

A lot of the early work in AI was done in lisp.
The implementation language is not all that important but it helps.

It is worth taking the the time to learn to use functional languages
like lisp, logo and ml because they will change the way problems
are understood and solved. Almost everyone first views a functional
language on first use as a toy language and then there is that majic
moment when some problem that would take hours implement in a
traditional language can be described in a half a dozen lines of code.

Learning AI is worth it. It will become an obsession for a while
watching a simple program you have written produce unexpected
but rational outcomes.

AI skills will make you a better programmer. We use AI a lot to
deal with complex code generation in our compiler products.

Regards,


Walter..
--
Walter Banks
Byte Craft Limited
http://www.bytecraft.com


Pascal J. Bourguignon

unread,
Nov 21, 2009, 5:43:00 AM11/21/09
to
pointer <ppoka...@gmail.com> writes:

Still, I'll repeat my advice to read in complement to AIMA:

PAIP = Paradigms of Artificial Intelligence Programming:
Case Studies in Common Lisp
http://norvig.com/paip.html

and:

SICP = Structure and Interpretation of Computer Programs
http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html
http://swiss.csail.mit.edu/classes/6.001/abelson-sussman-lectures/
http://www.codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages
http://eli.thegreenplace.net/category/programming/lisp/sicp/
http://www.neilvandyke.org/sicp-plt/

notice that while in the later books examples are exercises are given
in Scheme, the other links give translations to other programming
languages. SICP is very worth studying even if you don't plan to be a
lisp programmer.

--
__Pascal Bourguignon__

Walter Banks

unread,
Nov 21, 2009, 8:35:36 AM11/21/09
to

pointer wrote:

Actually separate out the advice you have been given. C
(correctly) is a low level language that can implement essentially
anything. But if you are looking to understand AI algorithms
you can get bogged down in the implementation details using C
where a functional language will abstract implementation details
away and allow you to focus on the AI task.

What's best for the job is a language that allows the problem
and its solution to be expressed in terms related to the job.

Walter..

Andrew Tomazos

unread,
Nov 21, 2009, 10:30:08 AM11/21/09
to
On Nov 19, 3:56 am, pointer <ppokazi...@gmail.com> wrote:
> Do you think its not so smart to learn AI like this? Any chance i can
> learn something all by myself, without teacher? (although internet is a
> nice place for those eager to learn:).

Try watching the Stanford graduate lectures on Machine Learning...

http://academicearth.org/courses/machine-learning

If it's too advanced for you, than you need some more undergraduate
math and computer science (algorithms, data structures) first. If you
need some recommended books for that let us know.

Regards,
Andrew.

--
Andrew Tomazos <and...@tomazos.com> <http://www.tomazos.com>

stan

unread,
Nov 21, 2009, 8:47:23 PM11/21/09
to

You are describing your personal preferences, not c language
capabilities. Specifically I mean when you define these as "problems"
These are personal preferences, not problems in the general case.

Pascal J. Bourguignon

unread,
Nov 22, 2009, 5:45:27 AM11/22/09
to
stan <smo...@exis.net> writes:

> Pascal J. Bourguignon wrote:
>> gremnebulin <peter...@yahoo.com> writes:
>>
>>> On 20 Nov, 15:18, p...@informatimago.com (Pascal J. Bourguignon)
>>> wrote:
>>>> pointer <ppokazi...@gmail.com> writes:
>>>> > Why cant AI be made in c :(
>>>>
>>>> Because C is an assembler, that is a low level programming language,
>>>> and AI is a complex problem, which requires your brain to burn cycles
>>>> on the real problem and not on the details of implementation such as
>>>> how many bits you have in a register.
>>>
>>> More of a "stricly speaking you can, but you really wouldn't want to"
>>
>> No, it's not "you can", it's "you have".
>>
>>
>> One problem is that writing:
>>
>> a = b+c;
>>
>> in C (C++, and most of the follow suit languages) actually means:
>>

>> a = b+c [2^w];


>>
>> with w changing depending on the compiler and processor...
>>
>>
>> Therefore even for the most trivial tasks, you have to deal with these
>> low-level considerations, and you must wrap them in higher level
>> abstractions. This is unfortunately something that most programmers
>> are too lazy to do.
>>
>>
>> Another problem is the manual management of memory. Without an
>> automatic memory management, it is much more difficult to write code
>> in a non-procedural paradigm, like functional code (because you have
>> to deal with the temporary values returned by each embedded function
>> calls).
>
> You are describing your personal preferences, not c language
> capabilities. Specifically I mean when you define these as "problems"
> These are personal preferences, not problems in the general case.

No, we're in the context of artificial intelligence programming, where
you have other complex problems to solve than these implementation
details.

If it was just a personal preference of mine, then McCarthy would have
invented C, not Lisp.

--
__Pascal Bourguignon__

stan

unread,
Nov 22, 2009, 8:56:49 PM11/22/09
to
Pascal J. Bourguignon wrote:

> stan <smo...@exis.net> writes:
>>
>> You are describing your personal preferences, not c language
>> capabilities. Specifically I mean when you define these as "problems"
>> These are personal preferences, not problems in the general case.
>
> No, we're in the context of artificial intelligence programming, where
> you have other complex problems to solve than these implementation
> details.
>
> If it was just a personal preference of mine, then McCarthy would have
> invented C, not Lisp.

Your characterization of C problems is personal opinion. If they were
problems McCarthy's work on lisp would have made Ritchie's work
unnecessary and DOA. Lisp didn't turn out to be the ultimate
programming answer, that's simple history.

The fact C exists and in widespread use clearly indicates that many
don't see the problems you find as real problems. Many real
applications written in C are in use today so the "problems" must have
been overcome. C is not perfect but neither is any language. Just
because one languages features are different doesn't make them
problems unless you get tunneled into thinking with the wrong
model. If you think in lisp then c is a terrible place to be and vice
versa.

Ultimately, every hll depends on someone dealing with low level
details to provide that hll. Given today's common commodity processing
architectures, everything is sitting on machine language models that
most certainly deal with low level details. Someone has to write with
low level details and tools that handle low level details are
needed. C fills a need and the features that provide the means to
meet those needs are problems only if your not working in the low
level domain.

Generalized claims such as yours are clearly opinions based on your
domain, and preferences. The quantity of C and Lisp applications
clearly indicates that your opinion is not a consensus, and the mere
existence indicates that these "problems" don't stop work in c.

Pascal J. Bourguignon

unread,
Nov 23, 2009, 12:41:32 AM11/23/09
to
pointer <ppoka...@gmail.com> writes:

> At first i posted this on comp.ai, but there wasnt any answers. Im not
> even sure it was received there, although i was able to see it in my
> topics list on some news servers (others didnt show it). So i will
> assume they didnt like it there :)
> I m not sure that this is right group for that, but i will hope its
> ok. It is about programming after all...
>
>
> I am trying to learn from the book AI modern approach. And as you can
> imagine, i have lost of question, although posts here make be believe
> this is not a good place for beginners.
>
> I was wondering are there any code examples for this book written in
> c, c++, php, maybe pascal.

There's actually a companion book called "Paradigms of Artificial
Intelligence Programming: Case Studies in Common Lisp", with code
examples written in Common Lisp.


> I am trying to learn alone so it would be easier if i could see some
> known things in those examples. I dont have experience with python,
> java or lisp. If there arent such examples, what do you think i should
> do? Learn one of theese languages or try to do it with one of theese i
> already know? Sorry if i used wrong group, but i didnt see any
> better. If there is one,(more for beginners) please guide me there.

While in theory it is possible to write AI programs in any programming
language, it is much easier to write them in a high level programming
language, I mean Lisp, Prolog, Haskell, etc.

> Do you think its not so smart to learn AI like this? Any chance i can
> learn something all by myself, without teacher? (although internet is
> a nice place for those eager to learn:).

There are courses both literature and videos available on the web.
Use google video.
and have a look at http://ocw.mit.edu/


> p.s. I would also like to find out about some other literature, so if
> you can suggest any, i will appreciate it.

You may start with:
http://www.ai.mit.edu/research/publications/


--
__Pascal Bourguignon__

[ comp.ai is moderated ... your article may take a while to appear. ]

Pascal J. Bourguignon

unread,
Nov 23, 2009, 5:34:33 AM11/23/09
to
stan <smo...@exis.net> writes:

> Pascal J. Bourguignon wrote:
>> stan <smo...@exis.net> writes:
>>>
>>> You are describing your personal preferences, not c language
>>> capabilities. Specifically I mean when you define these as "problems"
>>> These are personal preferences, not problems in the general case.
>>
>> No, we're in the context of artificial intelligence programming, where
>> you have other complex problems to solve than these implementation
>> details.
>>
>> If it was just a personal preference of mine, then McCarthy would have
>> invented C, not Lisp.
>
> Your characterization of C problems is personal opinion. If they were
> problems McCarthy's work on lisp would have made Ritchie's work
> unnecessary and DOA. Lisp didn't turn out to be the ultimate
> programming answer, that's simple history.

Again, we are not speaking of universal programming, but of artificial
intelligence.

Stop being stupid in believing that C and Lisp are equally good at
artificial intelligence programming.

> Generalized claims such as yours are clearly opinions based on your
> domain, and preferences.

Again, there's no generalization here, we are speaking in the context
of this thread which has as suject:

Subject: Re: Artificial intelligence
^^^^^^^^^^^^^^^^^^^^^^^

On the other hand, I notice that a lot of C defenders like you fail to
comprenhend this notion of context. C is perfect to write a unix
kernel, since it as been designed to build unix kernels. The problem
with most C programmers is that they forget this context, and try to
apply C to other domains, were C fails miserably, compared to the
competition.

--
__Pascal Bourguignon__

pete

unread,
Nov 23, 2009, 7:11:52 AM11/23/09
to
Pascal J. Bourguignon wrote:

> On the other hand, I notice that a lot of C defenders like you fail to
> comprenhend this notion of context. C is perfect to write a unix
> kernel, since it as been designed to build unix kernels. The problem
> with most C programmers is that they forget this context, and try to
> apply C to other domains, were C fails miserably, compared to the
> competition.

It's worse than that.
It's not just a lot of C defenders, it's the standard comittee too.
The official reason for the introduction of variable size arrays
and other bloat into the language in C99,
was because a lack of these features
was perceived as impeding C being a language for mathematics.

Look for the next version of the C standard
to miss the point of what C is supposed to be, even worse.

--
pete

Walter Banks

unread,
Nov 23, 2009, 9:38:45 AM11/23/09
to

Richard Heathfield wrote:

> Do you really want to give yourself two learning
> challenges at the same time (ANNs and a new language)? Or is one
> thing at a time enough for you?

In the case of AI, learning a functional language at the same time
as the AI may very well be time well spent. It is difficult for example
to change a variable into a function in C without re-compiling.

The implementation details in C when experimenting with
AI algorithms will overshadow the learning exercise.

Walter..


Nick Keighley

unread,
Nov 26, 2009, 5:38:09 AM11/26/09
to
On 21 Nov, 09:37, Walter Banks <wal...@bytecraft.com> wrote:
> pointer wrote:

> > Do you think its not so smart to learn AI like this? Any chance i can
> > learn something all by myself, without teacher?

yes. If you apply yourself (must be a lisp joke there somewhere) you
can learn stuff from books.

> A lot of the early work in AI was done in lisp.
> The implementation language is not all that important but it helps.
>
> It is worth taking the the time to learn to use functional languages
> like lisp, logo and ml because they will change the way problems
> are understood and solved. Almost everyone first views a functional
> language on first use as a toy language and then there is that majic
> moment when some problem that would take hours implement in a
> traditional language can be described in a half a dozen lines of code.
>
> Learning AI is worth it. It will become an obsession for a while
> watching a simple program you have written produce unexpected
> but rational outcomes.
>
> AI skills will make you a better programmer. We use AI a lot to
> deal with complex code generation in our compiler products.

that's interesting. I'd always thought of AI as a bit of a bag-of-
tricks which mostly seemed to biol down to searching large search
spaces. Which aspects of AI do you find useful and where where I start
learning this stuff (I'm ploughing through SICP at the moment (well
sort of stalled at the moment)).

Learning scheme even made the way I wrote bash scripts change (I found
I was greenspunning a baby interpreter)

Walter Banks

unread,
Nov 26, 2009, 9:26:21 AM11/26/09
to

Nick Keighley wrote:

> > AI skills will make you a better programmer. We use AI a lot to
> > deal with complex code generation in our compiler products.
>
> that's interesting. I'd always thought of AI as a bit of a bag-of-

> tricks which mostly seemed to boil down to searching large search


> spaces. Which aspects of AI do you find useful and where where I start
> learning this stuff

"searching large spaces" is part of it There are two main area's where AI has helped in compiler development. For a while I was very interested (obsessed) in extracting meaning from language as opposed to just parsing out the grammerical elements. This
changed significantly the amount of processing power we needed to analyse application programs, when we first started to do this computers were slow with had very little RAM. The difference was the traditional parsing out grammercal elements winds up to
be a giant game of twenty questions where parsing for meaning those questions have been answered and the focus is on generation solutions. Our compilers have a strategy pass that looks at the whole application and makes application wide code generation
strategy choices.

The second way AI helped was in the way we could organize code generation solutions in the form of expert systems, and constraint techniques for code generation. This approach has many practical unexpected uses to support code generation around silicon
bugs and rules that deal with code diagnostics and compiler consistency checks.

So much of the early AI work was focused on games, checkers (Shannon) and tons of chess programs that gave AI the reputation as an interesting toy. The practical uses are often hard to explain before eyes start glazing over. At trade shows we have
essentially described what we do as, "A data base of rules that get applied where appropriate".

> Learning scheme even made the way I wrote bash scripts change (I found
> I was greenspunning a baby interpreter)

Functional languages change the way you think about problems.

Have a happy turkey day

Richard Heathfield

unread,
Nov 26, 2009, 12:07:20 PM11/26/09
to
In <4B0E900D...@bytecraft.com>, Walter Banks wrote:

>
>
> Nick Keighley wrote:
>
<snip>

>> that's interesting. I'd always thought of AI as a bit of a bag-of-
>> tricks which mostly seemed to boil down to searching large search
>> spaces. Which aspects of AI do you find useful and where where I
>> start learning this stuff
>
> "searching large spaces" is part of it There are two main area's
> where AI has helped in compiler development.

Has it made any inroads into automatic linewrapping of Usenet
articles? :-)

<snip>

Walter Banks

unread,
Nov 26, 2009, 12:08:47 PM11/26/09
to

Richard Heathfield wrote:

> > "searching large spaces" is part of it There are two main area's
> > where AI has helped in compiler development.
>
> Has it made any inroads into automatic linewrapping of Usenet
> articles? :-)

That is a sofware problem somewhere between the ears :)


Walter Banks

unread,
Nov 26, 2009, 12:11:26 PM11/26/09
to
Nick Keighley wrote:

> > AI skills will make you a better programmer. We use AI a lot to
> > deal with complex code generation in our compiler products.
>
> that's interesting. I'd always thought of AI as a bit of a bag-of-

> tricks which mostly seemed to boil down to searching large search


> spaces. Which aspects of AI do you find useful and where where I start
> learning this stuff

"searching large spaces" is part of it There are two main area's


where AI has helped in compiler development. For a while I
was very interested (obsessed) in extracting meaning from language
as opposed to just parsing out the grammerical elements. This
changed significantly the amount of processing power we needed
to analyse application programs, when we first started to do this
computers were slow with had very little RAM. The difference
was the traditional parsing out grammercal elements winds up to
be a giant game of twenty questions where parsing for meaning
those questions have been answered and the focus is on generation
solutions. Our compilers have a strategy pass that looks at the
whole application and makes application wide code generation
strategy choices.

The second way AI helped was in the way we could organize
code generation solutions in the form of expert systems, and
constraint techniques for code generation. This approach has
many practical unexpected uses to support code generation
around silicon bugs and rules that deal with code diagnostics
and compiler consistency checks.

So much of the early AI work was focused on games, checkers
(Shannon) and tons of chess programs that gave AI the reputation
as an interesting toy. The practical uses are often hard to explain
before eyes start glazing over. At trade shows we have essentially
described what we do as, "A data base of rules that get applied
where appropriate".

> Learning scheme even made the way I wrote bash scripts change (I found


> I was greenspunning a baby interpreter)

Functional languages change the way you think about problems.

Have a happy turkey day

Sjouke Burry

unread,
Nov 26, 2009, 12:14:25 PM11/26/09
to
IOW: non-AI

Pascal J. Bourguignon

unread,
Nov 26, 2009, 4:55:27 PM11/26/09
to
Walter Banks <wal...@bytecraft.com> writes:

> Nick Keighley wrote:
>
>> > AI skills will make you a better programmer. We use AI a lot to
>> > deal with complex code generation in our compiler products.
>>
>> that's interesting. I'd always thought of AI as a bit of a bag-of-
>> tricks which mostly seemed to boil down to searching large search
>> spaces. Which aspects of AI do you find useful and where where I start
>> learning this stuff
>
> "searching large spaces" is part of it There are two main area's
> where AI has helped in compiler development. For a while I was very
> interested (obsessed) in extracting meaning from language as opposed
> to just parsing out the grammerical elements. This changed
> significantly the amount of processing power we needed to analyse
> application programs, when we first started to do this computers
> were slow with had very little RAM.

I'm surprized. So far, the best way I know to represent the semantics
of a program, is to kind of compile it to some "simplier" instruction
code, whose semantics is more clearly defined, some bytecode or some
decent processor opcodes. In particular, it seems to me that this
form is simplier, and simplier to manipulate (semantic equivalence
tests, language translation, etc) than for example a lambda calculus
based formal semantic representation, in particular for common
languages such as C, etc.

Did you come with a better way to represent the semantics of programs?


--
__Pascal Bourguignon__

Nick Keighley

unread,
Nov 27, 2009, 4:51:26 AM11/27/09
to
On 26 Nov, 14:26, Walter Banks <wal...@bytecraft.com> wrote:
> Nick Keighley wrote:

> > > AI skills will make you a better programmer. We use AI a lot to
> > > deal with complex code generation in our compiler products.
>
> > that's interesting. I'd always thought of AI as a bit of a bag-of-
> > tricks which mostly seemed to boil down to searching large search
> > spaces. Which aspects of AI do you find useful and where where I start
> > learning this stuff
>
> "searching large spaces"  is part of it There are two main area's where AI has helped in compiler development. For a while I was very interested (obsessed) in extracting meaning from language as opposed to just parsing out the grammerical elements. This
> changed significantly the amount of processing power we needed to analyse application programs, when we first started to do this computers were slow with had very little RAM. The difference was the traditional parsing out grammercal elements winds up to
> be a giant game of twenty questions where parsing for meaning those questions have been answered and the focus is on generation solutions. Our compilers have a strategy pass that looks at the whole application and makes application wide code generation
> strategy choices.
>
> The second way AI helped was in the way we could organize code generation solutions in the form of expert systems, and constraint techniques for code generation. This approach has many practical unexpected uses to support code generation around silicon
> bugs and rules that deal with code diagnostics and compiler consistency checks.
>
> So much of the early AI work was focused on games, checkers (Shannon) and tons of chess programs that gave AI the reputation as an interesting toy. The practical uses are often hard to explain before eyes start glazing over.  At trade shows we have
> essentially described what we do as, "A data base of rules that get applied where appropriate".

ah, searching large spaces and rule based systems.

Thanks for the interesting post!


> > Learning scheme even made the way I wrote bash scripts change (I found
> > I was greenspunning a baby interpreter)
>
> Functional languages change the way you think about problems.
>
> Have a happy turkey day

we don't do turkey day in my country

Kevin Tucker

unread,
Dec 4, 2009, 12:04:05 AM12/4/09
to
Learn python. It is not the perfect language (hint: there isn't
one!), but it is easy to learn from either the standard tutorial or
dive into python http://www.diveintopython.org/ and it is a great tool
to have in your box.

The aima website http://aima.cs.berkeley.edu/ links to python code
http://code.google.com/p/aima-python/

With your python skills ready Programming Collective Intelligence is a
super practical read http://oreilly.com/catalog/9780596529321

PAIP http://norvig.com/paip.html is an excellent book, he introduces
Common Lisp in chapter one. If you want to go deeper into CL check
out PCL http://gigamonkeys.com/book/ and On Lisp http://www.paulgraham.com/onlisp.html

0 new messages