MINERVA provides advanced functionality for constraint...
Move to
=> <=
Darueber Spitze
Zoom to
co_add/2
co_get/2
co_merge/2
co_check/2
See also
Arithmetic comparison
Arithmetic evaluation
Atomic term processing
Text Processing and Regular Expressions
Blackboards
BinaryIO
Character input/output
Constraints
Compilation
Clause creation and destruction
Clause retrieval and information
global variables
Grammar rules
Lists
Logic and control
All Solutions
Communication between distributed Minerva processes.
Stream selection and control
Servlet
Term comparison
Term creation and decomposition
Term input/output
Term unification
Term vector
Term Stream
XML (eXtended Markup Language) terms
Asynchronous timer handling
Type testing
IF Computer > MINERVA > Manual > Reference > Predicates > Constraints

Constraints

MINERVA 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)
The programmer is has to supply two user defined predicates:
        co_merge(+Var, +ConstraintList)
        co_check(+Term, +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 constraintvariable, 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.

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".

Examples

For examples please refer to the section ExamplePrograms.

Standard

These predicates are not part of the ISO-Prolog Standard.

read on...
co_add/2
Add a constraint to a variable or constraint variable....
co_get/2
Returns the current constraint of a constraint variable....
co_merge/2
Unify constraints...
co_check/2
Check if instantiation is allowed...
MINERVA
ifcomputer logo
f
Expert Services on the Web
Sprache
English
Japanese
Server
USA
Japan
Site Access
Local Index
Local Contents
Site Contents
Site Index
Printer Friendly
For imode
For PDA
Search
document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/Constraints/home_de.html
published 2008/6/30 update 2002/3/19 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 info@ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS