|
Release 0.6.4 - April 2006
NodeBrain Tutorial April, 2006 The Boeing Company, P.O. Box 3707, Seattle, WA 98124, USA
Release 0.6.4
Author: Ed Trettevik <eat@nodebrain.org>
Copyright © 2006 The Boeing Company
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section titled GNU Free Documentation License preceding the index at the end of this document.
NodeBrain™ is a trademark of The Boeing Company. All other trademarks and registered trademarks referenced in this document are the trademarks of their respective owners.
Software License
Copyright © 1998-2006 The Boeing Company Ed Trettevik <eat@nodebrain.org>
NodeBrain is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Preface
This tutorial is intended for readers seeking an introduction to NodeBrain through a series of simple examples. Other documents are available for readers looking for a more complete reference to the language, modules or API.
The intent of the examples in this tutorial is to illustrate individual concepts, not to provide complete working applications or show all related options. We avoid formal syntax descriptions, thinking that you are here because you want to figure it out from the examples.
The files referenced in this tutorial will be included in a tutorial directory in future NodeBrain release files. We were not finished fiddling with them at the time 0.6.4 release files were created. Consequently you will have to cut an paste from this document to experiment with examples for now.
See www.nodebrain.org for more information and the latest update to this document.
Documents:
NodeBrain Tutorial NodeBrain User Guide NodeBrain Language Reference NodeBrain Module Reference NodeBrain API Reference
Document Conventions
Sample code and input/output examples are shown in shaded boxes. We use a bit darker shading for input/output associated with programs other than NodeBrain. In the following example the first and last line are associated with the host shell and the lines in between are input or output unique to NodeBrain.
$ nb @> define myFirstRule on(a=1 and b=2) mood=”happy”; @> assert mood=”sad”; @> show mood mood = “sad” @> assert a=1,b=2,c=3; 2005/10/12 18:40:48 NB000I Rule myFirstRule fired (mood="happy") @> show mood mood = “happy” @> quit $
When we want to bring your addition to specific test, it is shown in bold like the DEFINE command in the example above.
Although the installed path for NodeBrain is “/usr/local/bin/nb” on a Unix or Linux system, we reference it as “./nb” in this tutorial. This is because the tutorial scripts are designed to run from the tutorial directory of a binary or source release file without requiring you to install NodeBrain on your system. Perhaps you don’t have the authority to install it or want to experiment before you decide. In any case, if you use a tutorial scripts as an example for your own scripts, remember to change the she-bang line.
Tutorial she-bang:
#!./nb
Normal she-bang:
#!/usr/local/bin/nb
Copyright © 2003-2006 The Boeing Company |