Information Technology Reference
In-Depth Information
The whole COPS program is made up of class definition and rule. COPS
language keeps the style of relational declarative language, meanwhile offers
class and method of object-oriented language. By this way, COPS not only
strengthens the regulatory and flexibility of programming but also improves
readability and usage. COPS language can make user focus on the problem
description and not care about solution in detail. Because COPS language is very
similar to object-oriented language (C++), its description is clear and easy to use
and it can fully utilize the encapsulation and inheritance mechanism to expand
and reuse. COPS system has already been carried on the simulation of circuit
successfully.
3
Constraint Reasoning in COPS
In COPS system, constraint reasoning mainly depends on production
composition and constraint propagation, which has the heuristic characteristics of
ranked conditional term-rewriting system, utilizing state information of problem
solution, default rule, assumption reasoning, and propagation in different areas
etc.. The key algorithm of COPS system is as following.
Algorithm 3.9 Main-COPS which is a core algorithm in COPS.
1. procedure main _ COPS
2. {
3. Invoke yacc program, generate internal structure;
4. Initialize;
5. Set up COPS constant trueNode;
6. Allocate memory for global variable;
7. Interpreter the program with internal structure;
8. Construct constraint network for unsolved constraint and variable;
9. While trigger the constraint of constraint network
10. Interpreter triggered constraint
11. }
.
Yacc (Yet Another Compiler Compiler) is a another compiler of compiler. It
transforms context-free grammar into a table set of simple auto-machine, which
carries on a LR grammar analysis program. The output file y.tab.c must be
compiled by C compiler and produces the program yyparse, which must be
installed together with lexical analyzer yylex, main program and error handler
yyerror.
Search WWH ::




Custom Search