org.qedeq.kernel.bo.logic.model
Class DynamicModel

java.lang.Object
  extended by org.qedeq.kernel.bo.logic.model.DynamicModel
All Implemented Interfaces:
Model
Direct Known Subclasses:
FourDynamicModel, SixDynamicModel, ThreeDynamicModel, UnaryDynamicModel

public abstract class DynamicModel
extends java.lang.Object
implements Model

A model for our mathematical world. It has entities, functions and predicates. There are also predicate and function constants.

Author:
Michael Meyling

Field Summary
static Predicate EQUAL
          Are the entities are all the same?
static Predicate EVEN
          Return true if value is even.
static Predicate FALSE
          Always return false.
static Predicate LESS
          Are the entities ordered by < ?
static Predicate NOT_EQUAL
          Are the entities are not all the same?
static Predicate NOT_LESS
          Are the entities not ordered by < ?
static Predicate TRUE
          Always return true.
 
Constructor Summary
DynamicModel(java.lang.String name)
          Constructor.
 
Method Summary
protected  void addEntity(Entity entity)
           
 void addFunction(int size, Function function)
          Add a function for interpreting function variables.
 void addFunctionConstant(ModelFunctionConstant constant, Function function)
          Add a function constant.
 void addPredicate(int size, Predicate predicate)
          Add a predicate for interpreting predicate variables.
 void addPredicateConstant(ModelPredicateConstant constant, Predicate predicate)
          Add a predicate constant.
abstract  Entity comprehension(Entity[] array)
          Create entity out of entity list.
abstract  java.lang.String getDescription()
          Returns the description for the concrete model.
 int getEntitiesSize()
          Get number of all entities in this model.
 Entity getEntity(int number)
          Get entity number.
 Function getFunction(int size, int number)
          Get function.
 Function getFunctionConstant(ModelFunctionConstant con)
          Get function constant.
 int getFunctionSize(int size)
          Get number of functions for this model.
 java.lang.String getName()
          Get model name.
 Predicate getPredicate(int size, int number)
          Get predicate of this model.
 Predicate getPredicateConstant(ModelPredicateConstant con)
          Get predicate constant of this model.
 int getPredicateSize(int size)
          Get number of predicates with size number of arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FALSE

public static final Predicate FALSE
Always return false.


TRUE

public static final Predicate TRUE
Always return true.


EVEN

public static final Predicate EVEN
Return true if value is even.


LESS

public static final Predicate LESS
Are the entities ordered by < ?


NOT_LESS

public static final Predicate NOT_LESS
Are the entities not ordered by < ?


EQUAL

public static final Predicate EQUAL
Are the entities are all the same?


NOT_EQUAL

public static final Predicate NOT_EQUAL
Are the entities are not all the same?

Constructor Detail

DynamicModel

public DynamicModel(java.lang.String name)
Constructor.

Parameters:
name - Model name.
Method Detail

getName

public java.lang.String getName()
Get model name.

Returns:
Model name.

getDescription

public abstract java.lang.String getDescription()
Returns the description for the concrete model.

Specified by:
getDescription in interface Model
Returns:
Description of concrete model.

addPredicateConstant

public void addPredicateConstant(ModelPredicateConstant constant,
                                 Predicate predicate)
Add a predicate constant.

Parameters:
constant - Add for this constant.
predicate - This interpretation.

addFunctionConstant

public void addFunctionConstant(ModelFunctionConstant constant,
                                Function function)
Add a function constant.

Parameters:
constant - Add for this constant.
function - This interpretation.

addEntity

protected void addEntity(Entity entity)

getEntitiesSize

public int getEntitiesSize()
Description copied from interface: Model
Get number of all entities in this model.

Specified by:
getEntitiesSize in interface Model
Returns:
Number of entities.

getEntity

public Entity getEntity(int number)
Description copied from interface: Model
Get entity number. Also transforms the value of an entity into the entity itself.

Specified by:
getEntity in interface Model
Parameters:
number - Get entity with this number and value.
Returns:
Entity.

getPredicateSize

public int getPredicateSize(int size)
Description copied from interface: Model
Get number of predicates with size number of arguments.

Specified by:
getPredicateSize in interface Model
Parameters:
size - Number of arguments.
Returns:
Number of predicates in this model.

getPredicate

public Predicate getPredicate(int size,
                              int number)
Description copied from interface: Model
Get predicate of this model.

Specified by:
getPredicate in interface Model
Parameters:
size - Number of arguments for predicate.
number - Number of predicate.
Returns:
Predicate for this model.

addPredicate

public void addPredicate(int size,
                         Predicate predicate)
Add a predicate for interpreting predicate variables.

Parameters:
size - Add for this function argument number.
predicate - This interpretation.

getPredicateConstant

public Predicate getPredicateConstant(ModelPredicateConstant con)
Description copied from interface: Model
Get predicate constant of this model.

Specified by:
getPredicateConstant in interface Model
Parameters:
con - Predicate constant we are looking for.
Returns:
Predicate for this model.

getFunctionSize

public int getFunctionSize(int size)
Description copied from interface: Model
Get number of functions for this model.

Specified by:
getFunctionSize in interface Model
Parameters:
size - Number of arguments for function.
Returns:
Number of functions in this model.

getFunction

public Function getFunction(int size,
                            int number)
Description copied from interface: Model
Get function.

Specified by:
getFunction in interface Model
Parameters:
size - Number of arguments for function.
number - Number of function.
Returns:
Function in this model.

addFunction

public void addFunction(int size,
                        Function function)
Add a function for interpreting function variables.

Parameters:
size - Add for this function argument number.
function - This interpretation.

getFunctionConstant

public Function getFunctionConstant(ModelFunctionConstant con)
Description copied from interface: Model
Get function constant.

Specified by:
getFunctionConstant in interface Model
Parameters:
con - Function constant we are looking for.
Returns:
Function in this model.

comprehension

public abstract Entity comprehension(Entity[] array)
Description copied from interface: Model
Create entity out of entity list. This is a transformation of a list of elements into a class containing these elements.

Specified by:
comprehension in interface Model
Parameters:
array - List of elements.
Returns:
Class that contains (exactly?) these elements.


Copyright © 2014. All Rights Reserved.