Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

Eval - routines to evaluate constraint formulas


Detailed Description

Author:
Ingo Schroeder
Date:
7/3/97
This module provides functions to evaluate constraints (structures of type Constraint) on LVs (structures of type LevelValue). The result of evaluating a constraint is always a Boolean, but since constraint formulas are defined compositionally, there are also functions for evaluating terms of other types.

All evaluation functions use output parameters of type Value to compute and return their results. ErrorValue is returned if any error occurred during evaluation, such as an access to a feature of the root node. This typically does not cause a run-time error, but simply makes the containing formula evaluate to FALSE. Note that unpredictable results can be produced if an error occurs in a nested term. Therefore an evaluation error always produces a CDG_WARNING message.


Data Structures

struct  BadnessStruct

Static Strings

These strings are used so often that we want to pre-compute their addresses. This is the only location where it's really important to have full speed. They are initialized in evalInitialize()

String static_string_chunk_end
String static_string_chunk_start
String static_string_chunk_type
String static_string_from
String static_string_id
String static_string_info
String static_string_to
String static_string_word

Typedefs

typedef BadnessStructBadness

Enumerations

enum  EvalMethodType { EMTInterpreted, EMTCompiled }

Functions

Badness bAdd (Badness b, Number score)
Badness bAddBadness (Badness a, Badness b)
Badness bClone (Badness b)
Boolean bCompare (Badness a, Badness b)
void bCopy (Badness dest, Badness src)
void bDelete (Badness b)
Boolean bEqual (Badness a, Badness b)
Badness bestBadness (void)
Badness bNew (int no, int hard, Number soft)
void bPrint (unsigned long mode, Badness b)
Badness bSubtract (Badness b, Number score)
Badness bSubtractBadness (Badness a, Badness b)
Number evalBinary (LevelValue lva, LevelValue lvb, ConstraintNet net, Vector context, Boolean use_cs_only, Badness b, List *conflicts)
Boolean evalBinaryConstraint (Constraint c, ConstraintNet net, Vector context, LevelValue lva, LevelValue lvb)
Boolean evalConstraint (Constraint c, ConstraintNet net, Vector context,...)
void evalFinalize (void)
Boolean evalFormula (Formula f, LexemGraph lg, Vector context)
Number evalInContext (Vector LVs, Vector context, Badness b, List *conflicts)
void evalInitialize (void)
Value evalTerm (Term t, Value val, LexemGraph lg, Vector context)
Number evalUnary (LevelValue lv, ConstraintNet net, Vector context, Boolean use_cs_only, Badness b, List *conflicts)
Boolean evalUnaryConstraint (Constraint c, ConstraintNet net, Vector context, LevelValue lv)
Boolean evalValidateEvalMethod (String name, String value, int *var)
void lock_tree (int width)
Value peekValue (Value val, List path)
Boolean significantlyGreater (Number a, Number b)
void unlock_tree (void)
Badness worstBadness (void)

Variables

Constraint evalCurrentConstraint
Constraint evalCurrentConstraint = NULL
Formula evalCurrentFormula
Formula evalCurrentFormula = NULL
EvalMethodType evalEvaluationMethod
EvalMethodType evalEvaluationMethod = EMTInterpreted
EvalMethodType evalPeekValueMethod
EvalMethodType evalPeekValueMethod = EMTCompiled
Boolean evalSloppySubsumesWarnings
Boolean evalSloppySubsumesWarnings = FALSE
int * has_cache
int * has_cache = NULL
int lock_counter
int lock_counter = 0
int lock_width
int lock_width = 0
String static_string_chunk_end
String static_string_chunk_start
String static_string_chunk_type
String static_string_from
String static_string_id
String static_string_info
String static_string_to
String static_string_word


Typedef Documentation

typedef BadnessStruct* Badness
 

A pointer to a BadnessStruct Definition at line 60 of file eval.h.

Referenced by bAdd(), bAddBadness(), bClone(), bCompare(), bCopy(), bDelete(), bEqual(), bestBadness(), bNew(), bPrint(), bSubtract(), bSubtractBadness(), evalBinary(), evalInContext(), evalUnary(), and worstBadness().


Enumeration Type Documentation

enum EvalMethodType
 

Evaluation method

This is the Type of the evaluation method which could be:

  • interpreted
  • compiled
Definition at line 38 of file eval.h.

Referenced by comApprove().


Function Documentation

Badness bAdd Badness  b,
Number  score
 

Add score to a Badness.

This function adds a classical score to a generalized score, i.e. it either increments b->hard or multiplies b->soft by score. Definition at line 258 of file eval.c.

References Badness, BadnessStruct::hard, BadnessStruct::no, and BadnessStruct::soft.

Referenced by evalBinary(), and evalUnary().

Badness bAddBadness Badness  a,
Badness  b
 

Add Badness b to a. Definition at line 290 of file eval.c.

References Badness, BadnessStruct::hard, BadnessStruct::no, and BadnessStruct::soft.

Badness bClone Badness  b  ) 
 

Create deep copy of a Badness.

The result is a new Badness owned by the caller. Definition at line 246 of file eval.c.

References Badness, bNew(), BadnessStruct::hard, BadnessStruct::no, and BadnessStruct::soft.

Boolean bCompare Badness  a,
Badness  b
 

Compare two Badnesses.

Returns TRUE if a is properly better than b, FALSE if they are equal. Definition at line 348 of file eval.c.

References Badness, FALSE, BadnessStruct::hard, significantlyGreater(), BadnessStruct::soft, and TRUE.

Referenced by cmdWriteAnno().

void bCopy Badness  dest,
Badness  src
 

Copy a Badness.

src must have been allocated by the caller. Definition at line 236 of file eval.c.

References Badness.

void bDelete Badness  b  ) 
 

De-allocate a Badness. Definition at line 317 of file eval.c.

References Badness.

Boolean bEqual Badness  a,
Badness  b
 

Test if two badnesses are equal. Definition at line 338 of file eval.c.

References Badness, BadnessStruct::hard, and BadnessStruct::soft.

Badness bestBadness void   ) 
 

Return new Badness better than any other.

The result is owned by the caller. Definition at line 370 of file eval.c.

References Badness, and bNew().

Badness bNew int  no,
int  hard,
Number  soft
 

Allocate a Badness. Definition at line 219 of file eval.c.

References Badness, BadnessStruct::hard, BadnessStruct::no, and BadnessStruct::soft.

Referenced by bClone(), bestBadness(), and worstBadness().

void bPrint unsigned long  mode,
Badness  b
 

Print a badness in canonical form. Definition at line 325 of file eval.c.

References Badness, cdgPrintf(), BadnessStruct::hard, BadnessStruct::no, and BadnessStruct::soft.

Badness bSubtract Badness  b,
Number  score
 

Subtract score from a Badness. Definition at line 274 of file eval.c.

References Badness, BadnessStruct::hard, BadnessStruct::no, and BadnessStruct::soft.

Badness bSubtractBadness Badness  a,
Badness  b
 

Subtract Badness b from a. Definition at line 302 of file eval.c.

References Badness, BadnessStruct::hard, BadnessStruct::no, and BadnessStruct::soft.

Number evalBinary LevelValue  lva,
LevelValue  lvb,
ConstraintNet  net,
Vector  context,
Boolean  use_cs_only,
Badness  b,
List *  conflicts
 

Evaluate all constraints on two LVs.

This function performs a conceptually simple task: it computes the combined score of two LVs in a constraint net and returns the computed score. This is done by applying evalConstraint() to all known constraints and tallying the scores of all violated constraints.

For efficiency reasons, the actual implementation of this function is much more complicated:

  • The entire function can be run in fast mode or in thorough mode. In fast mode, the function will stop applying constraints if a constraint with score 0 is violated, and return 0 immediately. In thorough mode, it will keep applying all possible constraints and bAdd() the results to the Badness b. Also, ConstraintViolation structures will be allocated and inserted into the List conflicts. Thorough mode is requested by passing a non-null value for b. For fast mode, both b and conflicts should be NULL.
  • In fast mode, if the LVs lva and lvb have already been evaluated by this function and scUseCache was set during both invocations of evalBinary(), the result is read from net->cache and not computed again.
  • To make this case more probable, the LVs lva and lvb are always sorted by the number of their respective levels. (That is, only half of the entire cache is ever used.)
  • Even if no precomputed result exists, not all constraints may be evaluated:

Unary constraints are ignored completely.

Inactive constraints and constraints from inactive sections are skipped likewise.

Of the remaining constraints, only those that may actually fail are evaluated. Hence not all constraints are evaluated, but only those whose signature matches the actual configuration existing between lva and lvb. The List of these constraints is found in the matrix cdgConstraintMatrix[].

In fast mode, if a hard constraint is violated, the result 0.0 is returned immediately.

If the parameter context is NULL, context-sensitive constraints will not be evaluated.

If the parameter use_cs_only is set, ONLY context-sensitive constraints will be evaluated. See evalInContext() for why this is occasionally necessary.

  • Theoretically, a binary constraint may be violated twice by two LVs. Think of a constraint that forbids the label X to appear more than once in an analysis. If two LVs with label X are evaluated jointly, both (a,b) and (b,a) violate this condition. But since the two violations do not really indicate different errors, this kind of double fault is usually not desired.

A double fault can only occur if the LVs match the signature of a constraint in both variants of instantiation. Since every binary constraint signature must explicitly state the two levels it refers to, this is only possible if both LVs belong to the same level and either their configuration is symmetrical, or it is is asymmetrical, but the signature of the constraint subsumes both configurations.

To eliminate all double faults, evalBinary() checks for all of these possibilities explicitly.

  • If a value was computed rather than looked up, and scUseCache is set, it is registered in net->cache.

The parameter net can be NULL, so that LVs can be evaluated even in the absence of a constraint net. In this case no caching is possible. Definition at line 1395 of file eval.c.

References bAdd(), Badness, ConstraintNetStruct::cache, CDG_DEBUG, cdgPrintf(), ConstraintNet, cvNew(), evalBinaryConstraint(), FALSE, lock_tree(), NULL, scGetScore(), scSetScore(), scUseCache, TRUE, and unlock_tree().

Referenced by cnBuildEdges(), comCompareAllLvPairs(), comCompareWithContext(), and evalInContext().

Boolean evalBinaryConstraint Constraint  c,
ConstraintNet  net,
Vector  context,
LevelValue  lva,
LevelValue  lvb
 

Evaluate one binary constraint on two LVs.

This function evaluates a binary constraint. It has the same effect as evalConstraint() used with five arguments, but saves the overhead of accessing the variable argument list. Also, it will call a compiled constraint function rather than evalConstraint() if possible. Definition at line 1188 of file eval.c.

References CDG_HOOK, CDG_WARNING, cdgExecHook(), cdgPrintf(), ConstraintNet, ConstraintNetStruct::evalBinary, evalCurrentConstraint, evalEvaluationMethod, evalFormula(), evalTerm(), hkVerbosity, HOOK_EVAL, NULL, and TRUE.

Referenced by cvAnalyse(), and evalBinary().

Boolean evalConstraint Constraint  c,
ConstraintNet  net,
Vector  context,
  ...
 

Evaluate a constraint w.r.t. the specified LVs.

Here's the detailed algorithm:

  • check the number of arguments and returns TRUE (with a warning) if it does not match the arity of c
  • instantiate the variables in c->vars with the LVs passed as arguments
  • do *not* check whether c is applicable to these LVs. Applying constraints to arbitrary LVs can produce spurious constraint violations without warning! Hence evalConstraint() should only be called on constraints whose applicability was previously checked by match{Unary,Binary}Signature().
  • set evalCurrentConstraint and evaluates c->formula using evalFormula()
  • reset evalCurrentConstraint
  • if the result was FALSE and c has a variable penalty (if c->penaltyTerm is non-NULL), set c->penalty to evalTerm(c->penaltyTerm)
  • execute the hook HOOK_EVAL
  • de-instantiate c->vars
  • increase either evalUnary or evalBinary
  • return the result of evalFormula()

The net is actually only used to record statistics (the fields evalUnary and evalBinary) and can be NULL.

The context may be NULL. If it is not NULL it should be a Vector of LVs, each of which must be located at its index as calculated by lvIndex(). This is then passed on to predicates and functions that need to examine the context of an LV to operate.

If the constraint c uses such a function or predicate (that is, if it has its is_context_sensitive flag set) and there is no context, then evalConstraint() returns TRUE. This is obviously not always correct, so if you do not provide context to your evaluations and still use context-sensitive constraints, you can miss some conflicts.

This function can evaluate constraints of arbitrary arity. The number of LVs passed must equal the arity. Unary and binary constraints can also be evaluated by evalUnaryConstraint() and evalBinaryConstraint(). Those functions are slightly faster than using the general vararg mechanism. Definition at line 1040 of file eval.c.

References CDG_HOOK, CDG_WARNING, cdgExecHook(), cdgPrintf(), ConstraintNet, ConstraintNetStruct::evalBinary, evalCurrentConstraint, evalFormula(), evalTerm(), ConstraintNetStruct::evalUnary, FALSE, hkVerbosity, HOOK_EVAL, NULL, and TRUE.

void evalFinalize void   ) 
 

finalize the eval module Definition at line 1666 of file eval.c.

References cdgFreeString(), static_string_chunk_end, static_string_chunk_start, static_string_chunk_type, static_string_from, static_string_id, static_string_info, static_string_to, and static_string_word.

Referenced by cdgFinalize().

Boolean evalFormula Formula  f,
LexemGraph  lg,
Vector  context
 

Evaluate a formula.

This function interprets the Boolean formulas defined in the cdg input language. It is basically a comprehensive listing of actions for each possible value of f->type.

Each of the different types of formula is evaluated in the expected way. In particular, conjunctions, implications and disjunction are guaranteed to short-circuit in the same way as the corresponding C operators.

Binary relations (FTEqual etc.) are evaluated by calling evalTerm() on both halves of the formula. If the two resulting types are not compatible, FALSE is returned with a warning. In general, every type is only compatible with itself. The ErrorValue is not compatible with any type, not even with itself.

The various relations are defined as follows:

  • Two strings are equal if they are identical (since no strings are duplicated in cdg, this is equivalent to checking whether they have the same reading).
  • Two numbers are equal if == holds between them.
  • Two lexeme nodes are equal if they were created from the same grapheme node or they are both NULL. Note that this may judge two simultaneous lexeme nodes as equal even though they are acoustically incompatible. This case should not arise since no constraint should ever be evaluated on two incompatible LVs; however, evalFormula() does not check this.
  • Two underspecified values or an underspecified and a specified value are never equal.
  • FTGreater holds between two numbers that satisfy C's > operator.
  • FTLess holds between two numbers that satisfy C's < operator.

If f->type is FTConnexion, subsumesConnexion() is called to check whether the specification f->data.connexion.c subsumes the actual configuration of the LVs found in the fields f->data.connexion.var1->levelvalue and f->data.connexion.var2->levelvalue.

If f=>type is FTDirection, subsumesDirection() is called to check whether the specification f->data.direction.d subsumes the Direction of the LevelValue structure found in the field f->data.direction.var->levelvalue. Definition at line 434 of file eval.c.

References CDG_WARNING, cdgPrintf(), evalCurrentFormula, evalTerm(), FALSE, LexemNode, NULL, and TRUE.

Referenced by evalBinaryConstraint(), evalConstraint(), and evalUnaryConstraint().

Number evalInContext Vector  LVs,
Vector  context,
Badness  b,
List *  conflicts
 

Eval context-sensitive constraints only.

This function evaluates all LVs in the Vector LVs against each other, using only context-sensitive constraints, and assuming that the context is context.

This is useful for methods that cannot normally provide context, e.g. because they operate incrementally. Such methods should use normal evalUnary and evalBinary calls with no context while they are building a structure, and then this function once the structure is complete.

Note that LVs and context can be different; one frobbing method actually needs to eval a subset of a structure, but in the global context. Definition at line 1614 of file eval.c.

References Badness, evalBinary(), evalUnary(), NULL, and TRUE.

void evalInitialize void   ) 
 

Initialize the eval module Definition at line 1642 of file eval.c.

References evalEvaluationMethod, evalPeekValueMethod, evalSloppySubsumesWarnings, evalValidateEvalMethod(), FALSE, NULL, static_string_chunk_end, static_string_chunk_start, static_string_chunk_type, static_string_from, static_string_id, static_string_info, static_string_to, static_string_word, and TRUE.

Referenced by cdgInitialize().

Value evalTerm Term  t,
Value  val,
LexemGraph  lg,
Vector  context
 

evaluate a CDG Term.

Parameters:
t the term to be evaluated
val temporary storage where the result is stored in
lg the current lexemgraph
context the current parse tree (or NULL)
Returns:
a pointer to val or the ErrorValue
This function evaluates a term on a value of the cdg formula language, computing both its type and its value. Both are returned as the result of evalTerm(). The function performs an exhaustive case distinction over the possible values of t->type:

  • TTTopPeek: The field t->data.peek.varinfo->levelvalue->modifiee is checked. If the modifiee is underspecified, ErrorValue is returned, otherwise peekValue() is applied to the path t->data.peek.path in the value of the modifiee.

    Exceptions occur if t->data.peek.path is id, word, from or to. These special attributes are notated like features of a lexeme node, but are actually attributes of the lexeme node, and not the lexeme itself. These attributes are computed as follows:
    • the attribute id is computed by setting val->lexemnode to the modifiee itself. If the modifiee is underspecified, ErrorValue is returned, VTLexemNode otherwise.
    • the attribute word is computed by setting val->data.string to the field word of the lexical entry of the modifier. (Strictly speaking, this *is* an attribute of the lexeme rather than the lexeme node; but as it does not appear in the feature matrix, it cannot be computed by peekValue().) If the modifiee is underspecified, ErrorValue is returned, val otherwise.
    • the attribute from is computed by setting val->data.number to the field from of the modifiee. If the modifiee is underspecified, lg->max+1 is assigned instead. In any case, val is returned.
    • the attribute to is computed by setting val->data.number to the field to of the modifiee. If the modifiee is underspecified, the number lg->max+2 is assigned instead. In any case, val is returned.

  • TTBottomPeek: The same algorithm is applied to the modifier of the LevelValue -- simplified by the fact that modifiers cannot be underspecified.
  • TTLabel: val->data.string is set to the field label of the LV and val is returned.
  • TTLevel: val->data.string is set to the identifier of the Level of LV, and val is returned.
  • TTAdd, TTSubtract, TTMultiply, TTDivide: The two fields t->data.operation.op1 and t->data.operation.op1 are evaluated by evalTerm(). ErrorValue is returned unless both results are numbers. Dividing by 0 also returns ErrorValue. Otherwise the results are conjoined by the corresponding C operator (+, -, * oder /), val->data.number is set to the result of this computation, and VTNumber is returned. applied to t->data.function.args (and lg) and both the resulting type and the computed are passed to the caller of evalTerm().
  • TTString: val->data.string is set to t->data.string, and val is returned.
  • TTNumber: val->data.number is set to t->data.number, and val is returned.
Definition at line 710 of file eval.c.

References GraphemNodeStruct::arc, LexemNodeStruct::arc, CDG_WARNING, cdgPrintf(), GraphemNodeStruct::chunk, Chunk, chunkerStringOfChunkType(), evalPeekValueMethod, FALSE, ChunkStruct::from, LexemNodeStruct::grapheme, LexemNodeStruct::lexem, LexemNode, LexemGraphStruct::max, peekValue(), static_string_chunk_end, static_string_chunk_start, static_string_chunk_type, static_string_from, static_string_id, static_string_info, static_string_to, static_string_word, and ChunkStruct::to.

Referenced by evalBinaryConstraint(), evalConstraint(), evalFormula(), and evalUnaryConstraint().

Number evalUnary LevelValue  lv,
ConstraintNet  net,
Vector  context,
Boolean  use_cs_only,
Badness  b,
List *  conflicts
 

Eval unary constraints on LV.

This function applies all unary constraints to lv. It uses the Vector cdgConstraintVector in much the same way as evalBinary() uses cdgConstraintMatrix. The same exceptions for deactivated constraints apply as in that function. In addition, evalUnary() stores all violated local constraints in the List lv->constraints. Definition at line 1259 of file eval.c.

References bAdd(), Badness, CDG_DEBUG, cdgPrintf(), ConstraintNet, cvNew(), evalUnaryConstraint(), and NULL.

Referenced by cnBuildLv(), and evalInContext().

Boolean evalUnaryConstraint Constraint  c,
ConstraintNet  net,
Vector  context,
LevelValue  lv
 

Evaluate a unary constraint on LV.

This function evaluates a unary constraint. It has the same effect as evalConstraint() used with four arguments, but saves the overhead of accessing the variable argument list. Also, it will call a compiled constraint function rather than evalConstraint() if possible. Definition at line 1122 of file eval.c.

References CDG_HOOK, CDG_WARNING, cdgExecHook(), cdgPrintf(), ConstraintNet, evalCurrentConstraint, evalEvaluationMethod, evalFormula(), evalTerm(), ConstraintNetStruct::evalUnary, hkVerbosity, HOOK_EVAL, NULL, and TRUE.

Referenced by evalUnary().

Boolean evalValidateEvalMethod String  name,
String  value,
int *  var
 

This is the validation function for the CDG variable evalmethod. Definition at line 1681 of file eval.c.

References CDG_WARNING, cdgPrintf(), FALSE, and TRUE.

Referenced by evalInitialize().

void lock_tree int  width  ) 
 

Declare evaluation lock.

When many constraints are evaluated on the same dependency tree, it can be worthwhile to cache the result of common subformulas. Therefore we offer the caller the possibility to declare that the dependency tree will not change during the next evaluations. The module eval is then free to reuse the results of previous evaluations until the tree is unlocked again.

WIDTH specifies the number of time points in the lexeme graph that will be used in the evaluations. Definition at line 157 of file eval.c.

References has_cache, lock_counter, and lock_width.

Referenced by evalBinary().

Value peekValue Value  val,
List  path
 

returns value for a path in a feature matrix Definition at line 611 of file eval.c.

References CDG_WARNING, cdgPrintf(), and NULL.

Referenced by evalTerm().

Boolean significantlyGreater Number  a,
Number  b
 

Compare Numbers with some margin for rounding error.

Upon removing conflicts and introducing new ones, the score of a structure must frequently be multiplied and divided with constants. Repeated use of this practice may introduce rounding errors. Therefore we use a special function for comparison with some margin for error. The problem of distinguishing rounding errors from very subtle penalties remains unsolved. Definition at line 206 of file eval.c.

Referenced by bCompare().

void unlock_tree void   ) 
 

Release evaluation lock.

If lock_tree() was called multiple times, evaluation remains locked onto the current tree until each call been cancelled individually. Definition at line 178 of file eval.c.

References CDG_ERROR, cdgPrintf(), has_cache, lock_counter, lock_width, and NULL.

Referenced by evalBinary().

Badness worstBadness void   ) 
 

Return new Badness worse than any other.

Strictly speaking, this is not the worst Badness that any structure could ever have, but I guess it will do.

The result is owned by the caller. Definition at line 383 of file eval.c.

References Badness, and bNew().


Variable Documentation

Constraint evalCurrentConstraint
 

This variable is set to the current Constraint during an evaluation, NULL otherwise. Definition at line 80 of file eval.c.

Referenced by evalBinaryConstraint(), evalConstraint(), and evalUnaryConstraint().

Constraint evalCurrentConstraint = NULL
 

This variable is set to the current Constraint during an evaluation, NULL otherwise. Definition at line 80 of file eval.c.

Referenced by evalBinaryConstraint(), evalConstraint(), and evalUnaryConstraint().

Formula evalCurrentFormula
 

Set to the current Formula during an evaluation, NULL otherwise.

Actually this is not strictly true. During evaluation, it is set to the formula whose evaluation was most recently *begun*, which is not at all the same; if we evaluate the formula

       X@cat = N & X^cat != V
then the first formula (&) will be evaluated first, then the second formula (=) and then the third one (!=), but after that, evalCurrentFormula is not reset to the first formula. To trace the progress of evaluation exactly, we would need either LISP-style dynamic binding, or an extra Formula argument across the entire chain of evaluation. But since evalCurrentFormula is only used within predHas() to distinguish different has() invocations from each other, and those do not nest, the current behaviour is sufficient. Definition at line 100 of file eval.c.

Referenced by evalFormula().

Formula evalCurrentFormula = NULL
 

Set to the current Formula during an evaluation, NULL otherwise.

Actually this is not strictly true. During evaluation, it is set to the formula whose evaluation was most recently *begun*, which is not at all the same; if we evaluate the formula

       X@cat = N & X^cat != V
then the first formula (&) will be evaluated first, then the second formula (=) and then the third one (!=), but after that, evalCurrentFormula is not reset to the first formula. To trace the progress of evaluation exactly, we would need either LISP-style dynamic binding, or an extra Formula argument across the entire chain of evaluation. But since evalCurrentFormula is only used within predHas() to distinguish different has() invocations from each other, and those do not nest, the current behaviour is sufficient. Definition at line 100 of file eval.c.

Referenced by evalFormula().

EvalMethodType evalEvaluationMethod
 

Implements evalmethod. Definition at line 116 of file eval.c.

Referenced by cmdCompile(), cmdLoad(), cmdStatus(), comApprove(), comCompareAllLvPairs(), comCompareWithContext(), evalBinaryConstraint(), evalInitialize(), and evalUnaryConstraint().

EvalMethodType evalEvaluationMethod = EMTInterpreted
 

Implements evalmethod. Definition at line 116 of file eval.c.

Referenced by cmdCompile(), cmdLoad(), cmdStatus(), comApprove(), comCompareAllLvPairs(), comCompareWithContext(), evalBinaryConstraint(), evalInitialize(), and evalUnaryConstraint().

EvalMethodType evalPeekValueMethod
 

Implements peekvaluemethod. Definition at line 119 of file eval.c.

Referenced by cmdStatus(), evalInitialize(), and evalTerm().

EvalMethodType evalPeekValueMethod = EMTCompiled
 

Implements peekvaluemethod. Definition at line 119 of file eval.c.

Referenced by cmdStatus(), evalInitialize(), and evalTerm().

Boolean evalSloppySubsumesWarnings
 

Implements subsumesWarnings.

If a constraint evaluation tries to access lexical information of the root node, the corresponding subexpression unconditionally evaluates to FALSE, and a warning is printed. This flag can be used to turn off the warnings; however the interpretation of the erroneous expression as FALSE remains. It is therefore recommended that you write all constraints so that they will not access features of the root node in the first place. Definition at line 113 of file eval.c.

Referenced by cmdStatus(), and evalInitialize().

Boolean evalSloppySubsumesWarnings = FALSE
 

Implements subsumesWarnings.

If a constraint evaluation tries to access lexical information of the root node, the corresponding subexpression unconditionally evaluates to FALSE, and a warning is printed. This flag can be used to turn off the warnings; however the interpretation of the erroneous expression as FALSE remains. It is therefore recommended that you write all constraints so that they will not access features of the root node in the first place. Definition at line 113 of file eval.c.

Referenced by cmdStatus(), and evalInitialize().

int* has_cache
 

At the moment, only the results of identical has() applications are cached because those are expected to be particularly expensive. In principle, this method could be extended to arbitrary identical subformulas.

The result of the application of has() number X at time point T is stored in cell X * lock_width + T. 2 means TRUE, 1 means FALSE, and 0 `unknown'. Definition at line 142 of file eval.c.

Referenced by lock_tree(), and unlock_tree().

int* has_cache = NULL
 

At the moment, only the results of identical has() applications are cached because those are expected to be particularly expensive. In principle, this method could be extended to arbitrary identical subformulas.

The result of the application of has() number X at time point T is stored in cell X * lock_width + T. 2 means TRUE, 1 means FALSE, and 0 `unknown'. Definition at line 142 of file eval.c.

Referenced by lock_tree(), and unlock_tree().

int lock_counter
 

Notes whether evaluation is locked.

Since locks can be nested, this counter can rise above 1; any value higher than 0 means that cached results are still valid. Definition at line 126 of file eval.c.

Referenced by lock_tree(), and unlock_tree().

int lock_counter = 0
 

Notes whether evaluation is locked.

Since locks can be nested, this counter can rise above 1; any value higher than 0 means that cached results are still valid. Definition at line 126 of file eval.c.

Referenced by lock_tree(), and unlock_tree().

int lock_width
 

The number of time points in the lexeme graph that will be used in the evaluations Definition at line 131 of file eval.c.

Referenced by lock_tree(), and unlock_tree().

int lock_width = 0
 

The number of time points in the lexeme graph that will be used in the evaluations Definition at line 131 of file eval.c.

Referenced by lock_tree(), and unlock_tree().

String static_string_chunk_end
 

static string "chunk_end" Definition at line 74 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_chunk_end
 

static string "chunk_end" Definition at line 74 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_chunk_start
 

static string "chunk_start" Definition at line 73 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_chunk_start
 

static string "chunk_start" Definition at line 73 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_chunk_type
 

static string "chunk_type" Definition at line 75 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_chunk_type
 

static string "chunk_type" Definition at line 75 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_from
 

static string "from" Definition at line 70 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_from
 

static string "from" Definition at line 70 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_id
 

static string "id" Definition at line 68 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_id
 

static string "id" Definition at line 68 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_info
 

static string "info" Definition at line 72 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_info
 

static string "info" Definition at line 72 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_to
 

static string "to" Definition at line 71 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_to
 

static string "to" Definition at line 71 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_word
 

static string "word" Definition at line 69 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().

String static_string_word
 

static string "word" Definition at line 69 of file eval.c.

Referenced by evalFinalize(), evalInitialize(), and evalTerm().


CDG 0.95 (20 Oct 2004)