1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
|
/* QMC: simplification tool (by using the Quine - McClusky process)
Copyright (C) 2000 Thomas Pollak
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Auf Deutsch:
QMC: Vereinfachungsprogramm fuer logische Terme nach Quine - McClusky
Copyright (C) 2000 Thomas Pollak
Dieses Programm ist freie Software. Sie koennen es unter
den Bedingungen der GNU General Public License, wie von der
Free Software Foundation herausgegeben, weitergeben und/oder
modifizieren, entweder unter Version 2 der Lizenz oder
jeder spteren Version.
Die Verffentlichung dieses Programms erfolgt in der
Hoffnung, dass es Ihnen von Nutzen sein wird, aber OHNE JEDE
GEWAEHRLEISTUNG - sogar ohne die implizite Gewhrleistung
der MARKTREIFE oder der EIGNUNG FUER EINEN BESTIMMTEN ZWECK.
Details finden Sie in der GNU General Public License.
Sie sollten eine Kopie der GNU General Public License zusammen
mit diesem Programm erhalten haben. Falls nicht, schreiben Sie
an die Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
MA 02139, USA.
*/
/*
file: msg.cc
begin: 04/2000
redesign: 10/2003
email: thomas@pollaknet.at
web: http://qmc.pollaknet.at
*/
//Headers
#include <cqmc>
#include <iostream>
using namespace std;
//output verion information
void version_msg(void)
{
cout << "QMC: simplification tool (by using the Quine - McClusky process)" <<endl;
cout << "Copyright (C) 2000 Thomas Pollak" << endl << endl;
cout << "This program is free software; you can redistribute it and/or" << endl;
cout << "modify it under the terms of the GNU General Public License as" << endl;
cout << "published by the Free Software Foundation; either version 2 of" << endl;
cout << "the License, or any later version." << endl << endl;
cout << "This program is distributed in the hope that it will be useful," << endl;
cout << "but WITHOUT ANY WARRANTY; without even the implied warranty of" << endl;
cout << "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU" << endl;
cout << "General Public License for more details." << endl << endl;
cout << "You should have received a copy of the GNU General Public License" << endl;
cout << "along with this program; if not, write to the Free Software" << endl;
cout << "Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." << endl << endl;
cout << "Web: " << QMC_URL << endl;
cout << "Version: " << QMC_VERSION << endl;
cout << "Last update: " << QMC_DATE << endl;
}
//output syntax information
void syntax_msg(void)
{
cout << "input syntax:" << endl;;
cout << " + logical OR a + b" << endl;
cout << " * logical AND a * b" << endl;
cout << " / logical NOT /a" << endl;
cout << " 1 TRUE" << endl;
cout << " 0 FALSE" << endl;
cout << " [] BRACKETS [a + b] * [c + d]" << endl;
cout << "all other symbols are recognized as variable (blanks excluded)" << endl << endl;
cout << "sample:" << endl;
cout << " qmc -s \"[a*b]+/a*[/c+d]+0*/e\"" << endl << endl;
cout << ">in some cases the Quine-McClusky procedure enlarges the result<" << endl;
}
//output help information
void help_msg(void)
{
cout << "Usage: qmc [OPTION]" << endl;
cout << "Simplification tool by using the Quine - McClusky process." << endl << endl;
cout << " -a, --avoidast avoid astericks at the output" << endl;
cout << " -d, --describesyntax descibe the syntax for the EQU" << endl;
cout << " -g, --gettable get boolean table" << endl;
cout << " -G --gethtmltable get boolean table as HTML output" << endl;
cout << " -h, --help display this help and exit" << endl;
cout << " -p, --prompt prompt for equation" << endl;
cout << " -s, --source EQU set one side of the equation" << endl;
cout << " -t, --table set boolean table" << endl;
cout << " -T, --time display used time" << endl;
cout << " -v, --verbose print progress" << endl;
cout << " --version output version information and exit" << endl << endl;
cout << "A few samples:" << endl;
cout << " qmc -s \"/[a+b]*[/b*c]\"" << endl;
cout << " qmc -g -s \"x + //y * [ z + /z * y ] * 1\"" << endl;
cout << " qmc -T -s \"a*/b+c+d+e*/c+f*e\"" << endl;
cout << " qmc -p" << endl << endl;
cout << " (symbols are recognized as single char's)" << endl << endl;
cout << "Project Home: http://qmc.pollaknet.at" << endl;
cout << "Please report bugs to <thomas@pollaknet.at>." << endl << flush;
}
//output usage info
void usage_msg(void)
{
cout << "qmc: too few arguments" << endl;
cout << "Try `qmc --help' for more information." << endl << flush;
}
//universal verbose msgs
void verbose_msg(char *msg, unsigned short int options)
{
if( options & PROTOCOL && ! ( options & HTML_OUTPUT ) )
cout << msg << flush;
}
|