This major new version brings constraint handling, improved extensibility, and support for binary file input/output.
MINERVA 2.0 provides advanced functionality for constraint handling together with the possibility to add your own user defined constraint handling.
Constraint handling is very powerful e.g. for difficult management problems: resource allocation, scheduling, planning.
MINERVA defines 2 predicates for constraint handling:
co_add(+Var, +Constraint) co_get(+Var, -Constraint)
If "Var" is a variable, then it becomes a constraint variable.
If "Var" is a constraint variable, then the constraint becomes marked as additional constraint and the user defined predicate co_merge(+Var,[NewConstraint,OldConstraint]) is invoked.
If "Var" is not a variable, then the user defined predicate co_check(+Var, NewConstraint) is invoked.
co_merge(+Var, +ConstraintList) co_check(+Term, +Constraint)
Before co_merge/2 is invoked, the associated constraint variable is turned into a normal variable. Only after the following invokation of co_add/2 and of course upon backtracking it becomes a constraint variable again.
These predicates are documented in Manual/Reference/Predicates/Constraints
MINERVA 2.0 provides a set of predicates to manipulate binary data, e.g. for data mining, communication protocols or compiler writing.
read_boolean/2, read_byte/2, read_char/2 read_double/2, read_float/2, read_int/2, read_long/2, read_short/2, read_utf/2, read_unsigned_byte/2, read_unsigned_short/2,The complementary set of predicates for writing to binary files is also provided:
write_*/2The first argument is always a binary stream, the second contains the term to read/write. For the semantics see the Java classes DataInputStream and DataOutputStream.
These predicates are documented in Manual/Reference/Predicates/BinaryIO
Java 1.1/1.2 -style event handling is now consistent throughout, at the same time Java 1.0 -style event handling is not supported any more. This change only affects GUI elements that accept user actions.
New are
canvas_create / 2,
canvas_create / 5,
menuItem_addActionListener / 2,
textField_addActionListener / 2,
which replace the obsolete
canvas_create / 1,
canvas_create / 4,
list_selectedItems / 2,
textField_getInputStream / 2,
respectively. Programs using one of these predicates need to be
adjusted to work properly with MINERVA 2.0.
All interactive example programs demonstrate the usage of these predicates.
The package guibuilder allows to add event listeners at creation time. cf gui/tst1.min, gui/tst4.min.
With guibuilder you can define the following listeners:
Goal stands for the goal to be invoked when the associated action occurs.
button(Name,Label) ** action(Goal) text_field(Field) ** action(Goal) text_field(Field,Columns) ** action(Goal) checkbox(Checkbox,Label) ** action(Goal) checkbox(Checkbox,Label,Group,State) ** action(Goal) item(Name,Label) ** action(Goal) check_item(Name,Label) ** action(Goal) Component ** mouse(List)
List can contain any of the following:
clicked=Goal pressed=Goal released=Goal entered=Goal exited=Goal
MINERVA 2.0 allows to create and access arrays of data of a given Java class.
array_set(+Array, +Index, +Value) array_get(+Array, +Index, -Value) create_array(+Class, +Size, -Array) expand_array(+Array, -List)
An example for the use of these predicates is in the folder ExamplePrograms/MinervaFeatures/JavaArrays
Renamed and extended from the no longer existing predicate create_interface/2, the predicate and directive java_predicates/2 allows to extend MINERVA with any method of any Java class and controls the name mapping.
If used as directive, the existence of the referenced class and method is checked at compile time. If used as predicate, the references class will only be accessed at run time.
java_predicates/2 gives also access to Java variables.
minervaxunderstands the same syntax.
With MINERVA 2.0 comes the tool metagen to add whole 3rd party Java libraries. minervax knows about this. Invocation is: "minerva -l metagen ClassName"
Example:
minerva -l metagen java.awt.Dimension -o dim.mxt
or
minerva -l metagen java.awt.Dimension > dim.mxt
minervax dim
mjavac dim.java
minerva -b dim
...
dimension_create(Dim),
dimension_width(Dim, Old),
dimension_width(Dim, 100),
dimension_width(Dim, New),
...
As examples to add classes and methods for immediate use in MINERVA serve the widely available packages Swing for graphical user interfaces, JDBC for relational data bases, and JSAPI for speech recognition and synthesis. See ExamplePrograms/Extensions
Program templates are included to show how to work with Java 1.2 Swing, MS-Access 97, and IBM ViaVoice.
a folder with references to client applications with MINERVA Overview/References
more warnings by the MINERVA compiler minervac, e.g. for identically named predicates in separate packages
You can load programs from other servers with load/1 or using the MINERVA package system for loading on demand.
Either specify the URL in load/1 in *.min:
load(someservice),
load('ftp://ftphost/someservice.mbc'),
load('http://wwwhost/someservice.mbc'),
or specify the URL in a MINERVA Startup Property *.msp:
package.someservice=localdir/someservice.mbc package.someservice=ftp://ari/pub/minerva20/someservice.mbc package.someservice=http://ari/minerva20/someservice.mbc
or combine both methods.
Along with corrections to the documentation itself we added easier navigation and improved indexing while still maintaining fast loading times for the HTML pages.
You have feedback on this release or requests for the next? Please let us know!