Skip to content

List Processing in Prolog

October 14, 2009
By john in COG366 Files

Within the conceptual sphere of numbers between 0 and 9, we’ve explored Prolog by writing a few relatively useless predicates.

These predicates were required for the assignment:

rnprint(N) – writes N random numbers
rnlist(N,List) – creates a List with N random numbers
count(N,List,F) – returns F, the number of appearances of N in List
singleton_count(List,F) – returns F, the number of single-appearing numbers in List
doubleton_count(List,F) – returns F, the number of twice-appearing numbers in List

And then these predicates were weird useless things that I made up:

rnexclusion(List,N) – returns N, a random number from 0 to 9 inclusive that is not a member of List
rnsequence(List) – returns List, a list of 10 numbers from 0 to 9 inclusive in random order
iota(N,List) – returns List, a list counting from 1 to N, or an empty list if N=0
sum(N,List) – returns List, a list of elements with a sum equal to N
removeAll(N,List,Out) – returns Out, the List with all elements N removed
factors(N,List) – returns List, a list of all the factors of N

codedemo – Enjoy.

By john in COG366 Blogs

Well, to be forward, I skipped most of Chapter 2 and did not read anything about Jumbo. That said, reading about the cytoplasm’s use in Numbo is intriguing. Certainly, the goal of Numbo was simple, allowing for a simple cytoplasm to form, but I can envision something much more powerful occuring in a larger scale implementation of this software.

Let’s start by examining the Pnet as described in Chapter 3. An interesting quality is that we have different forms of connections between nodes, the examples of Multiplication, broken into Results and Operands, and then the Similar quality. There are certainly many more qualities that exist, such as Addition (and inherently Subtraction, though based on Figure III-5 on page 147, we may be able to safely assume that there may not be Subtraction nodes at all, but just Addition with different number order).

I then began to envision more levels of the Pnet, allowing for different classes that are best used in different problems. The Pnet that Defays and Hofstadter had created solve Numbo problems, and Hofstadter’s work from previous years weighting gloms of letters of the alphabet would represent another Pnet. While sticking with puzzles, we could continue to build more Puzzle subclassifications like Sudoku and Kakuro. Of course, why stop at puzzles? I think we’ll keep expanding until we’ve completely mapped the knowledge of our example human being, but not right now. :D

Returning to the original question of what’s in your cytoplasm? Well, here I’ll start my argument against Numbo’s willingness to throw away blocks that it doesn’t believe to be immediately useful. Humans often can hold onto many ideas simultaneously and manipulate them with ease. In conversation, we can readily speak to another individual and then return to our first conversation.

Tags: , , ,

Shibboleths and Pnets

October 6, 2009
By john in COG366 Blogs

Introduced to Numbo, I immediately connected the theme  to the several Crypto assignments presented thusfar in COG 366. I think it only appropriate to assume we will be attempting similar artful implementations in solving Cryptos in the near future, however I am a little unsatisfied.

Daniel Defays, a professor in mathematics and psychology, contacted Douglas Hofstadter in 1985 with a research idea quite similar to Hofstadter’s Jumbo project. Sparking interest, the two of them worked together for a year starting in the good summer of 1986, resulting in the relative completion of the Numbo project. The goal of Numbo was to take a collection of bricks, numbers between 1 and 25, and a single target, a number between 1 and 150, and find a way to reach the goal by adding, subtracting of multiplying any of the bricks, at most, once.

Rather than brute forcing an answer as we had done with our Crypto problems, Defays and Hofstadter set out to solve Numbo problems similar to humans. Enters the concept of the permanent network (Pnet), where a basic or common knowledge of numbers and relations are stored. The Pnet stores declarative knowledge about the most commonly known numbers, such as 5 * 20 = 100, simple squares like 5 * 5 = 25 and watching for multiples of 10’s. 

I find that the downfall of the permanent network is the more or less static design. We are assuming that every person has the same common knowledge. After an individual has versed themselves in solving number problems, they will become accustomed to recognizing patterns or rules that make solving the puzzles easy. I fit into the group of people can look at numbers like 841 and immediately recognize it as 29 squared and many number pattern recognition problems, but I used to struggle with easy Sudoku puzzles. After solving a few dozen puzzles, I’ve started to recognize the patterns in these puzzles, but I don’t believe that my ability to recognize number patterns has diminished by any means. I do believe that the Pnet must be dynamic, slowly changing as the software experiences more complex puzzles, but it does not make sense to see the Pnet ever destroy knowledge.

Reading through Defay’s introducting paragraph a second time, the phrase “Cognition equals Recognition” stands out. This makes for a clever shibboleth that claims that in order to be able to process a problem intelligently, we must first be able to recognize patterns in the problem based on some previous knowledge. The shortcoming of Numbo appears to be that there is a software and computational limitation on the size of their permanent network, which leaves a seemingly significant difference between Numbo and the human brain.

Tags: , , , ,

By john in COG366 Files

An extension of the Crypto Puzzle Generator that is capable of solving problems up to order 5. This could easily be extended to much larger size puzzles, though the method is rather brute.

Part 1. demo - Experimenting with the provided combosets.pro code snippet.

Part 2. codedemo – Crypto problem solver capable of returning solutions to Crypto problems of orders 2, 3 and 4.

Part 3. codedemo – Extended Part 2 to solve up to order 5.

Part 4. codedemo – Extended Part 3 to generate Crypto problems and provide a solution.

File dependencies: gv.pro, combosets.pro by Craig Graci

Crypto Puzzle Generator

October 1, 2009
By john in COG366 Files

crypto.pro - an elementary Prolog script that generates a random Crypto problem. Crypto is a number puzzle where the objective is to obtain the Goal number by performing the basic mathematical operations on the provided array of numbers in any order. There is no guarantee of an answer to the generated problems, nor is there a limit of only one right answer.

File dependencies: gv.pro by Craig Graci

By john in COG366 Blogs

Much to the torment of myself, I could safely bet that many AI researchers have fallen into the trap of building expert systems, as opposed to the ideal abstract intelligence that we humans possess.

In Douglas Hofstadter’s Fluid Concepts and Creative Analogies, he details his experience writing a program capable of calculating patterns in sequences of numbers. At the time, Hofstadter was a professor teaching his first artificial-intelligence course where he proposed a programming competition for the students and himself. The programs would be given a sequence of numbers and were expected to utilize several strategies to recognize the patterns. At the competition, 30 randomly selected sequences from the semester were utilized, where Hofstadter’s program successfully identified 27 of the 30 patterns, coming in second place. Despite his success, he explains that upon reflecting on his work, he was upset with his choice of strategy.

I’ll be forward in saying that a “pure” AI exceeds my goals by a long shot. In the field of video game design, I feel that there is a desire for an Artificial Artificial Intelligence (which I will dub “AAI” and use profusely) that borders between humanlike and an expert system built on the rules of the game. In the context of video games, the acronym “AI” itself has become a mass media buzzword for Non-Player Character (NPC) behavior. Literally, to this day, the closest videogames get to AI are pre-scripted sequences that cause NPCs to react to predetermined events. I feel that currently existing video games do not qualify for the “AAI” tag, and especially not the widely used ”AI”.

 

Through this blog, I plan to completely detail my vision of a pure AAI. Stay tuned.

Tags: , ,