MINERVA2.0

This major new version brings constraint handling, improved extensibility, and support for binary file input/output.

Notes:

  1. *.mbc MINERVA binary code is not compatible to previous releases of MINERVA. Please recompile *.min source files to update your *.mbc binary code files.
  2. *.min MINERVA source programs are upward compatible with the exception of GUI event handling and create_interface. Please see below for details.
  3. Please update your *.msp and *.mca MINERVA Startup Property and Compressed Archives if you are using custom files that access MINERVA libraries.
  4. This version executes on Java 1.1 and on Java 1.2. (Caution: Netscape 4.0.4 and earlier do not suffice.)

New Functionality:

  1. Constraint Handling in MINERVA

    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)
    
    co_add(+Var, +Constraint)
    Add a constraint to a variable or constraint variable. "Constraint" can be any term but not a variable.

    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_get(+Var, -Constraint)
    co_get(+Var, -Constraint) returns the current constraint associated with a constraint variable. If "Var" is not a constraint variable, then the predicate fails.

    The programmer is has to supply two user defined predicates:
    	co_merge(+Var, +ConstraintList)
    	co_check(+Term, +Constraint)
    
    co_merge(+Var, +ConstraintList)
    When constraint variables are unified, then their associated constraints also have to be unified. This is the job of co_merge/2. The list of individual constraints must be combined into a new constraint, which can then be again associated with the constraint variable with co_add/2. If the individual constraints cause a contradiction, then the predicate shall fail.

    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.

    co_check(+Term, +Constraint)
    The user defined predicate co_check/2 is invoked when a constraint variable is instantiated, i.e. bound to a term which is not a variable. co_check/2 must only succeed if this binding is allowed under the given Constraint "Constraint".

    These predicates are documented in Manual/Reference/Predicates/Constraints

  2. Binary File Input/Output

    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_*/2
    
    The 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

  3. Full Java1.2 Event Handling

    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.

  4. Events in guibuilder

    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:

    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)

    Goal stands for the goal to be invoked when the associated action occurs.

    List can contain any of the following:

    		clicked=Goal
    		pressed=Goal
    		released=Goal
    		entered=Goal
    		exited=Goal
    

  5. main(+Applet,+Args) For programs with GUI the top level user defined predicate is now main/2 to also take the applet as first argument.
  6. Direct Access to Java Arrays

    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)
    
    array_set(+Array, +Index, +Value)
    set a value: Array[Index] = Value

    array_get(+Array, +Index, -Value)
    return a value: Value = Array[Index]

    create_array(+Class, +Size, -Array)
    make a new array of class Class and dimension Size resulting object is unified with the last argument

    expand_array(+Array, -List)
    converts a Java Array into a Minerva List

    An example for the use of these predicates is in the folder ExamplePrograms/MinervaFeatures/JavaArrays

  7. java_predicates/2

    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.

  8. JDBC, Swing, Speech and more 3rd party APIs

    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.

  9. Icons and Registry Templates a folder with icons for the MINERVA source and object file types, together with suggested registry entries to compile and execute programs with double-click in Windows environments. See the folder icons. Note that MINERVA does not require registry entries or icons to function properly.

  10. References

    a folder with references to client applications with MINERVA Overview/References

  11. more compiler warnings

    more warnings by the MINERVA compiler minervac, e.g. for identically named predicates in separate packages

  12. Loading MINERVA Programs from Internet Servers

    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.

  13. better documentation

    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!


Darueber read on...