00001 #include <fstream>
00002 #include <iostream>
00003 #include "tables.H"
00004 #include "algebras.H"
00005 #include "my_gmp.H"
00006 #include "ftwo.H"
00007 #include <string>
00008 #include "derive.H"
00009 #include "cmdline.H"
00010 using namespace std;
00011
00012
00013 int main(int argc, char** argv)
00014 {
00016
00018
00019 CommandLine::init(argc, argv);
00020 string name= CommandLine::parameters[0] + ".final";
00021
00022 ifstream my_source(name.c_str());
00023 if(my_source.fail()) {
00024 cout << "cannot read file" << endl;
00025 return 2;
00026 }
00027
00028 UnstableAlgebra A;
00029 my_source >> A;
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 A.display();
00048 A.find_grobner_basis();
00049
00050 MilnorAnalyzer der;
00051 der.start( &A );
00052
00053 GradedAlgebra<F_2> milnor;
00054 AffineHomomorphism<F_2> reduction, section, milnor_inclusion;
00055
00056
00057 milnor= der.ans;
00058 milnor.fix_alphabets();
00059
00060 reduction.source= &der.ans;
00061 reduction.target= &milnor;
00062 milnor.split_and_sort_relations();
00063 reduction.get_data_from( milnor.find_redundancies() );
00064
00065 section= reduction.simple_section();
00066 milnor_inclusion= der.ans_inclusion * section;
00067
00068 cout << "Milnor constants: " << endl
00069 << milnor << endl
00070 << "where: " << endl
00071 << milnor_inclusion
00072 << endl;
00073
00074 string out_name= CommandLine::parameters[0] + ".milnor";
00075 ofstream my_out(out_name.c_str());
00076
00077 milnor.relations.generators.clear();
00078 my_out << milnor;
00079 my_out << milnor_inclusion;
00080
00081 return 0;
00082 }
00083
00084