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

eval.h

00001 /* Copyright (C) 1997-2004 The CDG Team <cdg@nats.informatik.uni-hamburg.de> 00002 * 00003 * This file is free software; as a special exception the author gives 00004 * unlimited permission to copy and/or distribute it, with or without 00005 * modifications, as long as this notice is preserved. 00006 * 00007 * This program is distributed in the hope that it will be useful, but 00008 * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the 00009 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00010 * 00011 * $Id: eval.h,v 1.44 2004/09/01 13:51:13 micha Exp $ 00012 */ 00013 00014 /* ------------------------------------------------------------------------- 00015 * @addtogroup Eval 00016 * @{ 00017 */ 00018 00019 #ifndef EVAL_H 00020 #define EVAL_H 00021 00022 /* ---------------------------------------------------------------------- */ 00023 #include <blah.h> 00024 #include "input.h" 00025 #include "constraintnet.h" 00026 00027 /* ---------------------------------------------------------------------- */ 00028 00029 #ifndef SWIG 00030 00031 /* ------------------------------------------------------------------------- 00032 * Evaluation method 00033 * 00034 * This is the Type of the evaluation method which could be: 00035 * - interpreted 00036 * - compiled 00037 */ 00038 typedef enum { 00039 EMTInterpreted, 00040 EMTCompiled, 00041 } EvalMethodType; 00042 #endif 00043 00044 /* ------------------------------------------------------------------------- 00045 * Generalized score for comparing any two structures. 00046 * 00047 * This structure counts both the total number of constraint violations 00048 * (called `conflicts' henceforth) and the number of hard conflicts (those 00049 * with score 0.0). The field soft is the product of the penalties of all 00050 * soft (non-zero) conflicts. Note that this structure allows different 00051 * criteria for comparing two analyses; the function bCompare() is provided 00052 * as one method, but others could be devised. 00053 */ 00054 typedef struct { 00055 int no; /**< number of conflicts */ 00056 int hard; /**< number of hard conflicts */ 00057 Number soft; /**< combined effect of soft conflicts */ 00058 } BadnessStruct; 00059 /** A pointer to a BadnessStruct*/ 00060 typedef BadnessStruct *Badness; 00061 00062 /* -- VARIABLES --------------------------------------------------------- */ 00063 00064 #ifndef SWIG 00065 extern Constraint evalCurrentConstraint; 00066 extern Formula evalCurrentFormula; 00067 00068 extern EvalMethodType evalEvaluationMethod; 00069 extern EvalMethodType evalPeekValueMethod; 00070 00071 extern String static_string_id; 00072 extern String static_string_word; 00073 extern String static_string_from; 00074 extern String static_string_to; 00075 extern String static_string_info; 00076 extern String static_string_chunk_start; 00077 extern String static_string_chunk_end; 00078 extern String static_string_chunk_type; 00079 00080 #endif 00081 00082 extern int lock_counter; 00083 extern int lock_width; 00084 extern int *has_cache; 00085 00086 extern Boolean evalSloppySubsumesWarnings; 00087 00088 /* -- FUNCTIONS --------------------------------------------------------- */ 00089 00090 #ifndef SWIG 00091 extern void evalInitialize(void); 00092 extern void evalFinalize(void); 00093 extern Boolean evalValidateEvalMethod(String name, String value, int *var); 00094 00095 extern Value evalTerm(Term, Value, LexemGraph, Vector); 00096 00097 extern Boolean evalConstraint( Constraint c, ConstraintNet net, Vector context, ... ); 00098 extern Boolean evalUnaryConstraint(Constraint c, ConstraintNet net, Vector context, 00099 LevelValue lv); 00100 extern Boolean evalBinaryConstraint(Constraint c, ConstraintNet net, Vector context, 00101 LevelValue lva, LevelValue lvb); 00102 extern Number evalUnary(LevelValue lv, ConstraintNet net, Vector context, 00103 Boolean use_cs_only, 00104 Badness b, List *conflicts); 00105 extern Number evalBinary(LevelValue lva, LevelValue lvb, 00106 ConstraintNet net, Vector context, 00107 Boolean use_cs_only, 00108 Badness b, List *conflicts); 00109 extern Number evalInContext(Vector LVs, Vector context, Badness b, List* conflicts); 00110 extern Value peekValue( Value val, List path); 00111 extern Badness bNew(int no, int hard, Number soft); 00112 extern Badness bClone(Badness b); 00113 extern void bCopy(Badness dest, Badness src); 00114 extern Badness bAdd(Badness b, Number score); 00115 extern Badness bSubtract(Badness b, Number score); 00116 extern Badness bAddBadness(Badness a, Badness b); 00117 extern Badness bSubtractBadness(Badness a, Badness b); 00118 extern void bDelete(Badness b); 00119 extern void bPrint(unsigned long mode, Badness b); 00120 extern Boolean bEqual(Badness a, Badness b); 00121 extern Boolean bCompare(Badness a, Badness b); 00122 extern Badness bestBadness(void); 00123 extern Badness worstBadness(void); 00124 extern Boolean significantlyGreater(Number a, Number b); 00125 extern void lock_tree(int width); 00126 extern void unlock_tree(void); 00127 #endif 00128 00129 /* ---------------------------------------------------------------------- */ 00130 #endif 00131 /*@} */ 00132 /* don't insert anything after this #endif */

CDG 0.95 (20 Oct 2004)