Home

David Kent Snyder

Welcome to your wiki!

This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].

The wiki uses Markdown syntax.

Project Admins:


  • The following examples are from Guido vanRosin's Python tutorial which evolves. This came with Python v3.23

    A note at the beginning, I am using Windows7 and the version of notepad that the specific computer I am using came with. Of course, while Windows is in general easy to use (not as easy as Mac) and stable (not as stable as a Linux box maintained by someone who, unlike me, knows what the hell they are doing, Windows SUCKS ROCKS. This version of notepad is using word-wrap and I have been trying to deal with formatting issues (God I wish I had the time to get Xfig and the texX editor I have used with Linux over the years, but I don't have the time to do that and this, so I'm doing this. Doing this will, in the end, solve this problem, but I remember using a 'what

    you see is what you mean' word processor, and I miss it.) I am now going to say to hell with formatting and turn word wrap off. I am sorry if this gives you a more confusing experience, but I need to get these ideas down with as little frustration as possible. The ideas need to be explained as clearly as possible with as much detail as possible. If I am successful, you will understand with very little effort. Explaining ideas is what this system is really all about as you will see in the end if you hang with me. I apologize for any formatting issues that come up, but (as I say) you will understand.

    I will try to use every example (even the boring ones) and translate them to at least one English phrase of the form NOUN1 verb (NOUN2) {adverb of place, time, method, NOUN3, and probably more}. I am doing this because I believe the more closely you pay attention to something, the better you understand it. This is probably the result of my experience and training.

    Guido's example:

    the_world_is_flat = 1

    if the_world_is_flat:

    ... print("Be careful not to fall off!")

    ...

    Be careful not to fall off!

    Line by line:

    the_world_is_flat = 1

    Practically speaking (and if you've ever spoken practically, you know how much that hurts) this assigns a value to an address in RAM or in the swap space. This value is an integer which probably takes up as much space as the processor on the machine can put into a register. This means either 8, 16, 32 or 64 bits. A bit is a 1 or 0. On a breadbord, it is represented by the flow of current or the absence of current. Each bit can be on or off, this gives two values for each bit and following the form that the mostly Arab mostly Muslims of the Califate of the 8th to 12th Century gave to numbers, means that you have a system that is based on 2 values and that an 8 bit byte (the amount that can go into a register) can hold 28 different values, or 256 different values. A 64 bit byte give you (wait a minute) 264 = 18,446,744,073,709,551,616 different values. Notice that this is more than enough to have one value as a unique identifier for every person livng in the world today (6,840,507,003 people according to The World bank) with 18,446,744,066,869,044,613 extra pieces of information to spare in the single register of one of the cpus on this dual core processor. The computer I'm working on has more than 400 Gigabytes of disk space. Efficincies are possible here.

    I need to remember what I'm talking about

    the_world_is_flat = 1

    This statement assigns an area in memory (RAM or swap space on the disk) the value 1 and represents the value by the identifier 'the_world_is_flat'.

    the_world_is_flat = 1

    if the_world_is_flat:

    A possibly out of place note: the system should work both ways, it needs to take in English and output Python code which means I need to understand the form being used and reference the appropriate Python keywords, standard modules and syntax and that the system must deal with backports to previous versions of Python as well as future modules (Guido is very smart and has thought of the best way availible that I know of to allow Python programmers to do this. The system should also be able to read Python code and/or any package or group of modules that have been tested for safeness (loosely, the ability to not crash the system, ie, appropriate error handling) and explain it to the user in simple, easy to understand, but complete and possibly verbose, context sensitive, gramatically and syntactically correct English of whatever dialect you want. The first priority is currently spoken English, but Shakespeare's, Chaucer's and King James' English should also be acceptible. In fact, someday, the system should be able to identify unique syntax and vocabulary, determine what it means (whatever that means) and generate English following that particular subset of English so it can be as understandable and usable for ANY English speaker and run on ANY device Guido's Python can handle.

    The syntax of a programming language (or any language) includes a conditional. Write a value down. This means assign a name (which also needs to be saved in space and takes up (in general) considerably more than one byte) to an area in memory in which is put a value which is represented to the user as a number and may be thought of as the (Python or C/C++) value 'True'. In English, the conditional means that the proposition has a truth value which might be true, false or undetermined (practically speaking). Notice, that Guido actually makes a proposition as I define it of the name. This is one of the many brilliant features of Python. In this case, a proposition that says the subject has a certain property or properties. There is a gramatical word that I don't remember for this kind of sentence in English. It's a subject/predicate sentence. In this case NOUN1 be ADJECTIVE.

    the_world_is_flat = 1

    if the_world_is_flat:

    ... print("Be careful not to fall off!")

    ...

    There is more about what I am about to say later and I will probably edit this so you never see these words in this place exactly, but this may be translated to English as the following:

    It is true that the world is flat. If the world is flat, be careful not to fall off.

    This, then is the output that MY program should produce in this specific case. As you can tell from what I am raving about, it seems clear to me that specific cases, meaning contexts, are extremely important in AI systems which is, of course, what I am aiming to make. Generalities must be drawn from specific cases, and that is what I am doing now. I propose to make enough money from doing this to make my wife and kids and I comfortable possible and take care of some other things. As long as I'm thinking about this, if you think what I am saying is of value, pay me or hire me, I'll be happy to spend the rest of my life doing this and taking care of my family. Right now, I make $9/hr in a factory. Does this seem right to you? I am definitely trying to persuade someone that money can be made here. Take advantage of my open source brain, it's what it's here for, but if you have some money, please give me some so I can do more of this.

    the_world_is_flat = 1

    if the_world_is_flat:

    ... print("Be careful not to fall off!")

    ...

    My translation of the program into English:

    It is true that the world is flat. If the world is flat, be careful not to fall off.

    My translation should, in the context of a good system should produce the same output as Guido's example in the context of the wonderful Python interpereter. Notice that the results of this program are not stunning.

    This is (for lack of a better phrase) a logical conditional. It is of Aristotlian form, classic logic from the Greeks of the 3rd century BC. It is a sylligism. I can write a program that makes sylligisms. Here's the pseudocode:

    take two propositions from the user, A and B

    If A, B.

    A, therefore B

    Which in the specific case of this example with the input

    A = "The world is flat"

    B = "Don't fall off"

    should at least do what the Python does, which is show the end-user B.

    It should also probably be able to show the entire sylligism to the end-user as well as evaluate the truth of the statement A which, in this case, is "The world is flat" which has been proven to be false. What about flat-earthers? They are confused and don't agree with the sociatally recognized standard which is to assume as a basic fact that the world is round or the more specific facts from physics and geology (I mean, can something with ocean basins and mid-Atlantic rifts be called truely, perfectly round?). The program might simply kick out to another routine which at this time might simply ask what value to put in the truth statement and with as much disk space as is availible in the world today, can at least keep a list of what a particular user's standards are, and possibley compare them to other users standards and choose a given particular standard by who the system is talking to, and what most people say.

    To put Guido's code in this form and without the Python requirements:

    If the world is flat, be careful not to fall off.

    The world is flat, therfore, be careful not to fall off.

    This reminds me of the kind of quick response I might have in a conversation with someone I didn't care about or in a context where I'm not paying attention too much. In the context of a system, it might be running some other part of the system like the part that evaluates parsing trees and recalculates weights (a part I don't want to think about deeply now). The program must, however, must pay attention to each specific user so that if something more complex and interesting is said (this is, after all, just an example on the first page of Guido's explination of the guts of Python), the system can respond understandably.

    8:12 PM 6/14/2012

    I want to drive this down to at least the level of pseudocode and hopefully a Python program. It needs to include the idea that there is are real things in the physical world that are being affected, even if that means only a byte of memeory in the computer (RAM or swap space). Guido (I hope he doesn't mind people he's never met making free use of his given name) actually uses this form.

    A is true

    if A, B

    B

    But that's not exactly true either, because there is a print statment. Guido makes a worderful product with the help of a lot of other people who's names I don't know. At any time I can find out about the print statement in Python in as much detail as I want, but I need to limit myself here and now (for the sake of engineering and mathmatical principles) to the level of detail where Python is a nearly complete black box. I'll give Guido's example again, just so I can think about it some more.

    the_world_is_flat = 1

    if the_world_is_flat:

    ... print("Be careful not to fall off!")

    ...

    A is true => the_world_is_flat

    if the_world_is_flat: => if A,

    print("Be careful not to fall off!") => send B to the Python function print

    which shows B to the user.

    Python defines what is possible to go to the print function, but I can include it in a wrapper function that I will call 'show' and will have the syntax 'Noun1 show Noun2 Noun3', with the imperitave form being 'show Noun2 Noun3' and an acceptable non-standard form being 'Noun1 show Noun2 to Noun3', with other non-standard forms being dealt with by the (as yet unwritten) system input parser. The non-standard form should be only used if the end-user uses it first, so there needs to be a function of the form and probably named (following what I remember of Python syntax and keywords) user_has_used_non_standard_form which defaults to false, but is made true for a user who has used the God damed non-standard form. (Being clear makes you reuse rediculous forms in actual English). This means that SOMETHING needs to keep track of the paricular user when the non-standard form is encountered.

    Back to Guido's example.

    the_world_is_flat = 1

    if the_world_is_flat:

    ... print("Be careful not to fall off!")

    ...

    and my interpretation of Guido's example:

    A is true => the_world_is_flat

    if the_world_is_flat: => if A,

    print("Be careful not to fall off!") => send B to the Python function print

    which shows B to the user.

    FREEZE HERE

    Fri 15 Jun 2012 23:18:16 Eastern Daylight Time