Wednesday, July 30, 2008
Week 9 of GSOC - FreeCAD/Croquet
-Added new camera controls e.g. tilt,forward,rotate etc
-Added tool to rotate objects around X,Y and Z
-Set up website to publish FreeCAD/Croquet and provide instructions
2) What do plan to do this week?
-Implement a grid plan on the drawing board to act as a ruler and guide when drawing.
-Add the much needed and delayed Joints to connect two markers
3) What can possibly stand in the way of your work?
-Still, 3D transforms are complicated but I'm getting the hang of it
OpenNARS - End of July Status
I've spent the last 2 weeks giving more love to the wiki and polishing what was ported since the start of the project. It was done in conjunction with design and comprehension decisions.
Until now, the main entities are ported as the primitives inference functions that acts on 2 special NARS arithmetic entities (TruthValue and BudgetValue).
What's missing are the inference rules as the glue with the existing entities in particular Memory who is the central class that implements the reasoning process. It has also on its state all the storage entities (NARS Bag) and organize their contents interaction. NARS bags are not only usual collection. They have in this design the responsabilies of pickOut and putIn (driven by a probabilistic selection using BudgetValue).
So here is a summary ot what was done recently:
Wiki
reorganization around the following sections :
- Code Browser
- ajax based - scriptaculous version extended
- read-only
- Squeak and Java Doc
- gives package and class comment
- shortcut to the last java version, and to the squeak one
- Java structure and design discussion
- ajax based - scriptaculous version extended
- Introduction to the system
- Architecture description
- Overview pictures
- External Links
Blog
A blog to ask questions, relates actuality of the port...
Timeline
Section in relation to the timeline and objectives of the GSoC Prject
Functional test applications
I haven't made a lot of unit tests yet mainly because my understanding of the system was not really clear (until now?). Instead I did two functional test applications (seaside). They allow testing most of the inference primitives methods on TruthValue and BudgetValue. I plan to continue this kind of functional test with the inference rules and if possible providing a seaside application that will do an inference cycle step by step (kind of WATask).
What's next ?
I also had a reflection on how to implement the rule dispatcher and the rule body. Given our objective (mainly syllogistic rules as we deal only with atomic terms), there are not too many classes and methods but they are quite long. The discussion we had with Klaus was whether to dispatch or not :).
The conclusion is to stick to the actual implementation for several reasons:
- Pei wants the code in one place as the NARS is not stabilized yet (AGI research project)
- Refactoring is quite uncertain now.
- Writing rules with Smalltalk ifTrue:'s isSometing's and:[]'s, the code will be quite shorter and so a bit more readable. For instane, see there (the java version is commented below).
- we keep our ideas for later. Dispatching would surely making look a bit nicer but it could be worthless if there is a major move (like using prolog - having rule in a declarative language).
So next steps are, finishing and fixing language statement class and subclasses. Then I'll have to port 3 inference classes. I think 3 weeks is reasonable to have the system starting to work as a whole (still far form doing all kind of inference and logic expression). At this time, we'll have to test, optimize the reasoning process and in the same time I'll do seaside interfaces. I also would like to do a screencast with the Java version to show how NARS behave and can be used. I plan to do this tutorial.
That's it for now.
Happy squeaking ;-)
Wednesday, July 23, 2008
Week 8 of GSOC - FreeCAD/Croquet
-Fixed drawing movement with mouse. Drag and move properly enabled now. Drag and rotate is also fixed.
-Experimenting with camera movements. Tilt, forward, back, rotate are some of the motions enabled on keyboard.
-Added a pop up info board that shows the position of the mouse on the drawing board to enable better and more accurate drawing. Pop up also added to drawing when dragged and moved to show the position of the drawing.
2) What do plan to do this week?
-Finalize camera movement and try to integrate some of it with the mouse.
-Implement a grid plan on the drawing board to act as a ruler and guide when drawing.
3) What can possibly stand in the way of your work?
-No feedback and no one trying out the things I have done puts me in the dark about how user friendly the controls are.
Tuesday, July 22, 2008
squeakGtk Omnibrowser
Here is the first release of the Omnibrowser with Gtk :

At this time this is only read-only and there is not menu support.
I've solved the problem of the active waiting with a thread in C in which gtk waits
for an event and when there is an event send a signal to a semaphore and wake up
the Smalltalk process, it works but I should remove the Morphs because X events
handling is not thread safe.
I'll create an image without the morphs if it possible...
Thursday, July 17, 2008
OpenNARS - Development Progress - 2nd phase
It hasn't been possible to focus on simple inference as there's not a clear distinction in the rules implementation. So I did choose to port the maximum I could understood. Most of the stable classes that are not evolving much are ported. Some are tested, some are not as I need other parts to make them work.
We had also a discussion with Klaus to agree on the objectives and ways to tackle some problems. I also had to read again documentation on the NARS approach as it's still difficult to me to explain to others. Also, java code is not always explaining by itself :).
I've extended an overview document with picture to explain relation between statement (logic expression), sentence, reasoningItems (tasks that encapsulates sentences, judgment, question goal...) and reasoning artefacts (memory...bags...). See here.
Where I'm right now is thinking about the implementation choice of Inference rules.
Indeed, Pei choose to implement inference rules, as some utility functions and the memory as static methods only in several distinct classes. I understand his choice as it's easier for him to find and modify them (java world), but this is another difficulty for me to understand the system. It's therefore kind of mixed because several methods should belong to others objects and so, hard to port as I ask myself whose object responsibility it is... I've started that for all Utility functions (that are really stable). All three classes don't exist anymore and are either extension method.
Also dispatching them in Smalltalk is less problematic as I can use Pragma or even flags to access them quickly... Besides the static'ness of these methods, I find they are too long... which makes them hard to have a global view. Over the 4 inferences classes (+ a kind of rule dispatcher - RulesTable), there around 10 reasonning method per class which is not much but they are quite long... So fisrt, I'll port skeletton, bypass the parts in relation to complex inference (temporal, structural...) and I'll try to see common parts so as to create convenience methods etc...
That's why I'm spending this week getting a better understanding of the system to propose an alternative design. I think for instance that the memory class is the reasoning controller. It has links to several bags (Nars bags), that are the real storage of the working memory (names can be very confusing sometimes). I find I need some more abstraction and one of them is a reasoning controller which will hold the reasoning process (an inference engine?). I'm also discussing that point with Pei on the Nars mailing list.
The other missing parts is the full implementation of NARS language (NARSESE) that allows to express logics expression (input belief, outputs). I'll focus on implementing first simple statements like "swan is black" "yoyo is a swan" etc... The inference engine would be already usable for more complex expression. Still the future seaside interface will only focus on simple statements, presenting inference and result(s).
To deal with language terms, I may use a visitor pattern, or at least a better dispatch but I'll focus on that later.
So, next objectives are:
-port CompoundTerms, Statements and relations subclasses (inheritance, equivalence, implication, instance...) to be able to express tasks - statement which is a logic statement with a truth value plus some meta information that allow to deal with priority, decay, life of the belief in the working memory ...
-then make NAMemory work, maybe split it into 2 classes. I need to implement inference rules (some not all)
See you all... Feel free to leave comments, give pointers on pattern or application that use rule and inference (SOUL ? NeOPUS ?)...
Cédrick
Wednesday, July 16, 2008
Week 7 of GSOC - FreeCAD/Croquet
-Experiment with different camera movements
-Implemented keyboard keys with avatar motion e.g. tilt, move around etc
-Experiment with solid transformation, trying to put in better control of solids with mouse movement
2) What do plan to do this week?
-Continue to work on avatar movement with keyboard and applying different movements to have a better CAD view of assembly
-Restructure drawing of solids for better integration with mouse movement
3) What can possibly stand in the way of your work?
3D transform theories are really complicating!!
Tuesday, July 15, 2008
Safarà status: New commands and a new SATextMorph
As an example I provided commands to move the current point of editing between words (e.g. next-word, previous-word, etc.).
The second issue I attacked was the one related with how present the characters. Now we use a custom morph to present the content of a buffer.
The next step will be to define a GUI-independent model for styles and interactions with ranges of text. This will enable us to provide some features like text-selection, syntax-highlighting or "Do it".
As in the last post and from now on, I will try to provide a snapshot:
Monday, July 14, 2008
Cairo support under SqueakGtk
for more informations go to the cairo website : http://cairographics.org/
The support of Cairo under squeakGtk is not complete but most of the functions are supported, it lacks the support of the transformations functions, ...
May be it will be possible to use cairo for the morphs ?
SqueakGtk status
I've extended the Gtk support with new widgets :
- GtkAboutDialog (added some fields)
- GtkFontSelectionDialog
- GtkAccelLabel
- GtkLinkButton
- GtkScaleButton
- GtkVolumeButton
- WebKit
- ...
g_object_unref when there is a parent widget. The support of Gtk
is more stable but there are others problems in the events handling
this is an active waiting so it uses a lot of cpu times, an other problem
is when the user save the image a "Gtk" object in Squeak only contains
a pointer in a C structure and I need to save and restore this structure.
I'm working on the Omnibrowser support and in the improvement of the
new tools :p
Some basic tools :

Squeakzilla a new browser :p
Wednesday, July 9, 2008
Safarà Status
Currently it supports basic ascii text editing, that can seem not so much.
Actually I am really happy for the work done as I think (and I hope) I met several goals:
- extensibility in terms of features: you can add features (commands gestures syntaxes) to Safarà at runtime, without interfering or having to interact with other layers;
- portability over implementations: the model does not know anything about the UI as they are completely decoupled and communication between them occurs by using announcements. Thus, you can write also a non-morphic UI for example. Just make your UI objects subscribe to the right announce and write a bridge to translate the GUI-dependent events to the Safarà events;
- Classes and methods are well categorized, documented and tested.
For the Morphic UI: Do not use TextMorph as base class but a custom morph
For the model: Integrate into Safarà some code wrote by Lukas for syntax-aware commands
You can find the latest snapshot here. There is also a developer mailing list, you can subscribe to. As Safarà partecipate to the ESUG 2008 awards you can find additional documentation about the project goals and design here.
For the most curious, this is a snapshot
Week 6 of GSOC - FreeCAD/Croquet
-Created handles to interactively draw objects.
-Handles allows extending and rotating the drawing.
-Putting in markers and selecting them so that Joints can be created and linked to them.
-2D drawing detection to move drawings and to select it
2) What do plan to do this week?
-Will continue work to create Joints that will reference 2 markers for simulation purpose
-Look into how the camera view can be adjusted for better viewing angles. Any suggestions on this is much appreciated
3) What can possibly stand in the way of your work?
3D transformation is quite complex and i'll need some time to understand it better in order to create better functions.
Here's a video showing some of the work I did:
Tuesday, July 8, 2008
Status
So far, the bot framework is on the good way... I tried as much as possible to have an easy public interface so that it should be easy for anyone to develop with the framework. The base is maturing and shouldn't change much in the future.
I've developed some basic functionalities: an administration interface, a help system, a greeting (a bot has to be polite) and a simple infobot that can memorise definitions.
At the moment, the IRC protocol is handled by the existing IRC client in Squeak. Unfortunately it relies on Morphic ( in short; the gui ). I've abstracted it so that the bot isnow completely indenpendant of it. It is planned to develop a clean IRC library which wont rely on any gui.
So what next ?
- Continue the real world tests (yesterday was the first attempt on freenode :),
- Polish the admin and help,
- Add logging functionalities
- Develop a web interface (with Aida or Seaside)
- Develop a clean IRC library
- Write docs
Stay tuned!
(if you see squeakbot on freenode, introduce yourself to him :)
Saturday, July 5, 2008
Squeak - Impressions
The more i code, the more i fall in love with Squeak and Smalltalk in general. I've properly started my gsoc project after my last exam (20 June) and i'm already addicted to the different Smalltalk tools. Iknew quite well the classic System Browser but was a little bit intimidated by the other ones.

Little by little, i've started to code in the debugger (i can imagine non smalltalkers shocked while reading this but it _really_ is an eyes opening experience) and guess what...I like it! I've learned to appreciate the refactoring, senders, hierarchy, variables and versions broswers. Most of the modern IDEs have those functionalities but Smalltalk had those for years and they are so well integrated in the environment. All those tools encourage you to explore the image. It feels like reading wikipedia: you start to look at an article about something and link after link you end up reading about the Pyongyang metro...
The only drawback is that you are quickly overwhelmed with windows popping up everywhere... especially on a 12 inches screen :)
Another common problem for beginners is the syndrom of 'Where the hell do i have to start?'. Interesting opinions can be found in the comments of a Ramon Leon's post. Now, there's a fantastic open book that everyone willing to learn Squeak/Smalltalk should read: 'Squeak By Example'.
More news about the project itself very soon!
Monday, June 30, 2008
Week 5 of GSOC - FreeCAD/Croquet
- I have done detection of planes and points on the plane. I can now select a Cube, click a point on it and add another solid on that point.
- Corrected all problems of rendering and picking objects. Had problems rendering and picking objects earlier because of the different coordinate systems used by FreeCAD and Croquet. It took me a while to figure everything out but its all fixed now.
-Completed a window UI to place a solid precisely on a specified point.
2) What do plan to do this week?
-Create more UI windows to manipulate solids
-Enable markers to be referenced by Joints for animation/simulation purposes
3) What can possibly stand in the way of your work?
Nothing much except that my internet connection is no set up yet due to very very slow services by my ISP. Doing online research and replying mails in a cyber cafe nearby at the moment.
Tuesday, June 24, 2008
Week 4 of GSOC - FreeCAD/Croquet
-Coded in picking methods for cubes and cylinders, not 100% working but I'm able to move things relative to their plane
-Combined all solids under one main class & trying to make rendering more efficient
2) What do plan to do this week?
-Continue to implement the face/plane detection for polygons and ellipses.
-Fix some rendering bugs
-Other minor fixes for better rendering efficiency
3) What can possibly stand in the way of your work?
-No internet connection at my new place yet (still waiting for my ISP)
Week 3 of GSOC - FreeCAD/Croquet
Played with FreeCAD and learning the tutorials so that I can replicate most of the interactive stuff on replicate. Still trying to implement the face/plane detection.
2) What do plan to do this week?
Face/plane detection for the 3D solids
3) What can possibly stand in the way of your work?
I just moved to a new place, trying to settle down ASAP.
Week 2 of GSOC - FreeCAD/Croquet
-Cleaning up some code and solved an initialization problem of the Croquet world.
-Also released a working version of FreeCAD/Croquet using Monticello.
2) What do plan to do this week?
-Implement face detection of 3D solids starting with the cube first.
3) What can possibly stand in the way of your work?
-Might not have enough time because I'm moving to another place this week.
-Croquet keeps crashing on me in debug mode due to asynchronous processes thus slowing down progress.
Thursday, June 5, 2008
FreeCAD/Croquet first release
I have released the first version of FreeCAD/Croquet (Project that I'm working on).
You can get it here which is the version loaded into Cobalt. After downloading it, launch Cobalt and drag KayefFreeCAD out from the parts bin and it should load.
If you already have a Croquet image then just use the Monticello package. Please follow the instructions in this link on how to install the package.
Once you get that running, follow this link for tutorials on how to use it. Currently, you can create 3D solids and also load sample assemblies. Watch some of these videos too if you have the time.
Week 1 of GSOC
I have already implemented the tree view menu before this but it is not interactive yet. I have just added in a feature that enables the user to select an item on the tree by clicking on it. I have also added a window that controls the simulation of the assembly with options to start,pause and stop and in the same time display the frame rate and a few other info that will be added in time. I have also uploaded my work on Croquet Source but its not quite ready to be installed yet as I still need to configure it to be easily installed by normal users. Should be done in 1 or 2 days.
2) What do plan to do this week?
I will implement the picking and selecting of objects with the mouse pointer and moving them in the Croquet world. I currently have done a bit of work on this but its very buggy with inconsistent results. I will need to fix this and also come up with a good way to move things in a 3D environment.
3) What can possibly stand in the way of your work?
Specifying the TBoundSphere for an object in Croquet seems to be a bit of a problem because it works sometimes but other times it does not. Also, it causes the rendering of the objects to go wrong (occasionally disappearing in different viewing angles). I should study more on this stuff to understand it fully or else the whole click and drag feature will be flawed. Anyone care to shed some light on this?
Thursday, May 29, 2008
OpenNARS port to Squeak using Seaside
NARS is before all a reasoning system but a non-axiomatic one compared to usual semi-axiomatic ones we find in AI [1]. It attempts to uniformly explain and reproduce many cognitive facilities, including reasoning, learning, planning, etc, so as to provide a unified theory, model, and system for AI as a whole. The ultimate goal of NARS research is to build a thinking machine. What makes this system different from conventional reasoning systems is its ability to learn from its experience and to work with insufficient knowledge and resources. NARS theory exists. A book has been published recently (Rigid flexibility).
Since 2008, NARS is developed as open source software . A prototype exists in java for the core of the system but there is still a lot to do until the aim of having a thinking machine is reached. A port is underway in Python and we propose to start a squeak port because we think a dynamic and flexible environment and language as Smalltalk/Squeak could be very appropriate here.
Right now, I'm finishing writing my PhD dissertation so I will only spend moderate time on the project in June (delivery date is by the end of June). Once done, I'll be nearly full-time on the project. When coding, I'll be as much as possible on IRC (#squeak) on freenode under the nickname Cdrick. Feel free to contact me if you have any question in relation to this project. I will start the port with the stable core of the prototype (see here for more information)
Cédrick Béler (cdrick65 for my google account...)
[1] NARS (Non-Axiomatic Reasoning System) is a concrete example of non-axiomatic system. Here is a short definition of axiomatic, semi-axiomatic and non-axiomatic (quoted from Pei Wang publications)
- pure-axiomatic system: In all aspects, the system has sufficient knowledge and resources with respect to the problems to be solved.
- Pure-axiomatic systems are studied in mathematics, and is not directly related to AI
- semi-axiomatic system: In some, but not all, aspects, the system has sufficient knowledge and resources with respect to the problems to be solved.
- Most of the previous AI work in the inference framework belong to the category of semi-axiomatic system, which attempt to make partial extension or revision of mathematical logic, while keep the other parts.
- non-axiomatic system: In all aspects, the system has insufficient knowledge and resources with respect to the problems to be solved.
- For AI, what is really needed are non-axiomatic systems, which do not assume the sufficiency of knowledge and resources in any aspect of the system.