Skip to content

Commit 4ecf8cb

Browse files
committed
proof collection: make '-g -b' the default and rename '-g -v' to '-g -b'
- new option '-g -f' for old default, which seems mostly pointless
1 parent 68d05f8 commit 4ecf8cb

File tree

4 files changed

+23
-27
lines changed

4 files changed

+23
-27
lines changed

README.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,15 +426,15 @@ <h4 id="usage">Usage</h4>
426426
-d: default system ; ignore all other arguments except '-e'
427427

428428
Composable:
429-
-g &lt;limit or -1&gt; [-u] [-q &lt;limit or -1&gt;] [-l &lt;limit or -1&gt;] [-k &lt;limit or -1&gt;] [-b] [-v] [-s]
429+
-g &lt;limit or -1&gt; [-u] [-q &lt;limit or -1&gt;] [-l &lt;limit or -1&gt;] [-k &lt;limit or -1&gt;] [-b] [-f] [-s]
430430
Generate proof files ; at ./data/[&lt;hash&gt;/]/dProofs-withConclusions/ when '-s' unspecified ; otherwise at ./data/[&lt;hash&gt;/]/dProofs-withoutConclusions/
431431
-u: unfiltered (significantly faster, but generates redundant proofs)
432432
-q: limit number of proof candidate strings queued per worker thread (may lower memory requirements for systems with low acceptance rates) ; default: 50
433433
-l: limit symbolic length of generated conclusions to at most the given number ; works only in extracted environments ; recommended to use in combination with '-q' to save memory
434434
-k: similar to '-l' ; limit symbolic length of consequents in generated conclusions, i.e. antecedents in conditionals are not limited (but non-conditionals are limited in full length)
435-
-b: brief parsing ; refer to conclusion strings for D-proof processing and use them for rule evaluation (collects faster, but requires more memory) ; used only when '-v' unspecified
436-
-v: very brief parsing ; append conclusion structures to D-proof processing and use them for rule evaluation (collects fastest, but requires significantly more memory)
437-
-s: proof files without conclusions, requires additional parsing ; used only when '-b' and '-v' unspecified
435+
-b: brief parsing ; append conclusion structures to D-proof processing and use them for rule evaluation (collects faster, but requires significantly more memory)
436+
-f: full parsing ; parse entire D-proofs rather than using conclusion strings for rule evaluation ; used only when '-b' unspecified
437+
-s: proof files without conclusions, requires additional parsing ; entails '-f' ; used only when '-b' unspecified
438438
-r &lt;D-proof database&gt; &lt;output file&gt; [-l &lt;path&gt;] [-i &lt;prefix&gt;] [-s] [-d]
439439
Replacements file creation based on proof files
440440
-l: customize data location path ; default: "data"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ Some more – and very special – proof systems are illustrated [further down b
5151
-d: default system ; ignore all other arguments except '-e'
5252

5353
Composable:
54-
-g <limit or -1> [-u] [-q <limit or -1>] [-l <limit or -1>] [-k <limit or -1>] [-b] [-v] [-s]
54+
-g <limit or -1> [-u] [-q <limit or -1>] [-l <limit or -1>] [-k <limit or -1>] [-b] [-f] [-s]
5555
Generate proof files ; at ./data/[<hash>/]/dProofs-withConclusions/ when '-s' unspecified ; otherwise at ./data/[<hash>/]/dProofs-withoutConclusions/
5656
-u: unfiltered (significantly faster, but generates redundant proofs)
5757
-q: limit number of proof candidate strings queued per worker thread (may lower memory requirements for systems with low acceptance rates) ; default: 50
5858
-l: limit symbolic length of generated conclusions to at most the given number ; works only in extracted environments ; recommended to use in combination with '-q' to save memory
5959
-k: similar to '-l' ; limit symbolic length of consequents in generated conclusions, i.e. antecedents in conditionals are not limited (but non-conditionals are limited in full length)
60-
-b: brief parsing ; refer to conclusion strings for D-proof processing and use them for rule evaluation (collects faster, but requires more memory) ; used only when '-v' unspecified
61-
-v: very brief parsing ; append conclusion structures to D-proof processing and use them for rule evaluation (collects fastest, but requires significantly more memory)
62-
-s: proof files without conclusions, requires additional parsing ; used only when '-b' and '-v' unspecified
60+
-b: brief parsing ; append conclusion structures to D-proof processing and use them for rule evaluation (collects faster, but requires significantly more memory)
61+
-f: full parsing ; parse entire D-proofs rather than using conclusion strings for rule evaluation ; used only when '-b' unspecified
62+
-s: proof files without conclusions, requires additional parsing ; entails '-f' ; used only when '-b' unspecified
6363
-r <D-proof database> <output file> [-l <path>] [-i <prefix>] [-s] [-d]
6464
Replacements file creation based on proof files
6565
-l: customize data location path ; default: "data"

logic/DlProofEnumerator.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,8 +1849,10 @@ map<uint32_t, uint64_t>& DlProofEnumerator::removalCounts() {
18491849

18501850
void DlProofEnumerator::generateDProofRepresentativeFiles(uint32_t limit, bool redundantSchemaRemoval, bool withConclusions, size_t* candidateQueueCapacities, size_t maxSymbolicConclusionLength, size_t maxSymbolicConsequentLength, bool useConclusionStrings, bool useConclusionTrees) { // NOTE: More debug code & performance results available before https://github.com/deontic-logic/proof-tool/commit/45627054d14b6a1e08eb56eaafcf7cf202f2ab96 ; representation of formulas as tree structures before https://github.com/xamidi/pmGenerator/commit/63c7f17b82d56ec639f2b843b688d3e9a0a2a077
18511851
chrono::time_point<chrono::steady_clock> startTime;
1852-
if (useConclusionStrings || useConclusionTrees)
1853-
withConclusions = true; // need conclusions in these modes
1852+
if (useConclusionTrees)
1853+
withConclusions = true; // need conclusions when brief parsing was requested
1854+
else if (!withConclusions)
1855+
useConclusionStrings = false; // otherwise, enable full parsing when not using conclusions was requested
18541856
size_t defaultQC = 50;
18551857
if (candidateQueueCapacities) {
18561858
if (*candidateQueueCapacities == SIZE_MAX)

main.cpp

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ static const map<Task, string>& cmdInfo() {
6464
" -e: specify extracted system with the given identifier\n"
6565
" -d: default system ; ignore all other arguments except '-e'\n";
6666
_[Task::Generate] =
67-
" -g <limit or -1> [-u] [-q <limit or -1>] [-l <limit or -1>] [-k <limit or -1>] [-b] [-v] [-s]\n"
67+
" -g <limit or -1> [-u] [-q <limit or -1>] [-l <limit or -1>] [-k <limit or -1>] [-b] [-f] [-s]\n"
6868
" Generate proof files ; at ./data/[<hash>/]/dProofs-withConclusions/ when '-s' unspecified ; otherwise at ./data/[<hash>/]/dProofs-withoutConclusions/\n"
6969
" -u: unfiltered (significantly faster, but generates redundant proofs)\n"
7070
" -q: limit number of proof candidate strings queued per worker thread (may lower memory requirements for systems with low acceptance rates) ; default: 50\n"
7171
" -l: limit symbolic length of generated conclusions to at most the given number ; works only in extracted environments ; recommended to use in combination with '-q' to save memory\n"
7272
" -k: similar to '-l' ; limit symbolic length of consequents in generated conclusions, i.e. antecedents in conditionals are not limited (but non-conditionals are limited in full length)\n"
73-
" -b: brief parsing ; refer to conclusion strings for D-proof processing and use them for rule evaluation (collects faster, but requires more memory) ; used only when '-v' unspecified\n"
74-
" -v: very brief parsing ; append conclusion structures to D-proof processing and use them for rule evaluation (collects fastest, but requires significantly more memory)\n"
75-
" -s: proof files without conclusions, requires additional parsing ; used only when '-b' and '-v' unspecified\n";
73+
" -b: brief parsing ; append conclusion structures to D-proof processing and use them for rule evaluation (collects faster, but requires significantly more memory)\n"
74+
" -f: full parsing ; parse entire D-proofs rather than using conclusion strings for rule evaluation ; used only when '-b' unspecified\n"
75+
" -s: proof files without conclusions, requires additional parsing ; entails '-f' ; used only when '-b' unspecified\n";
7676
_[Task::CreateReplacements] =
7777
" -r <D-proof database> <output file> [-l <path>] [-i <prefix>] [-s] [-d]\n"
7878
" Replacements file creation based on proof files\n"
@@ -893,11 +893,11 @@ int main(int argc, char* argv[]) { // argc = 1 + N, argv = { <command>, <arg1>,
893893
mpiIgnoreCount++;
894894
extractedEnv = false;
895895
break;
896-
case 'g': // -g <limit or -1> [-u] [-q <limit>] [-l <limit or -1>] [-k <limit or -1>] [-b] [-v] [-s]
896+
case 'g': // -g <limit or -1> [-u] [-q <limit>] [-l <limit or -1>] [-k <limit or -1>] [-b] [-f] [-s]
897897
if (i + 1 >= argc)
898898
return printUsage("Missing parameter for \"-" + string { c } + "\".", recent(string { c }));
899899
try {
900-
tasks.emplace_back(Task::Generate, map<string, string> { }, map<string, int64_t> { { "limit", stoi(argv[++i]) }, { "candidateQueueCapacities", 0 }, { "maxSymbolicConclusionLength", -1 }, { "maxSymbolicConsequentLength", -1 } }, map<string, bool> { { "redundantSchemaRemoval", true }, { "withConclusions", true }, { "useConclusionStrings", false }, { "useConclusionTrees", false }, { "whether -q was called", false } });
900+
tasks.emplace_back(Task::Generate, map<string, string> { }, map<string, int64_t> { { "limit", stoi(argv[++i]) }, { "candidateQueueCapacities", 0 }, { "maxSymbolicConclusionLength", -1 }, { "maxSymbolicConsequentLength", -1 } }, map<string, bool> { { "redundantSchemaRemoval", true }, { "withConclusions", true }, { "useConclusionStrings", true }, { "useConclusionTrees", false }, { "whether -q was called", false } });
901901
} catch (...) {
902902
return printUsage("Invalid parameter \"" + string(argv[i]) + "\" for \"-" + string { c } + "\".", recent(string { c }));
903903
}
@@ -995,7 +995,7 @@ int main(int argc, char* argv[]) { // argc = 1 + N, argv = { <command>, <arg1>,
995995
default:
996996
return printUsage("Invalid argument \"-" + string { c } + "\".", recent());
997997
case Task::Generate: // -g -b (brief parsing)
998-
tasks.back().bln["useConclusionStrings"] = true;
998+
tasks.back().bln["useConclusionTrees"] = true;
999999
break;
10001000
case Task::ParseAndPrintProofs: // --parse -b (only print conclusions of the given proofs)
10011001
tasks.back().bln["conclusionsOnly"] = true;
@@ -1046,6 +1046,9 @@ int main(int argc, char* argv[]) { // argc = 1 + N, argv = { <command>, <arg1>,
10461046
switch (lastTask()) {
10471047
default:
10481048
return printUsage("Invalid argument \"-" + string { c } + "\".", recent());
1049+
case Task::Generate: // -g -f (full parsing)
1050+
tasks.back().bln["useConclusionStrings"] = false;
1051+
break;
10491052
case Task::ParseAndPrintProofs: // --parse -f (proofs are given by input file path)
10501053
case Task::TransformProofSummary: // --transform -f (proof summary is given by input file path)
10511054
case Task::UnfoldProofSummary: // --unfold -f (proof summary is given by input file path)
@@ -1387,15 +1390,6 @@ int main(int argc, char* argv[]) { // argc = 1 + N, argv = { <command>, <arg1>,
13871390
break;
13881391
}
13891392
break;
1390-
case 'v':
1391-
switch (lastTask()) {
1392-
default:
1393-
return printUsage("Invalid argument \"-" + string { c } + "\".", recent());
1394-
case Task::Generate: // -g -v (very brief parsing)
1395-
tasks.back().bln["useConclusionTrees"] = true;
1396-
break;
1397-
}
1398-
break;
13991393
case 'w':
14001394
switch (lastTask()) {
14011395
default:
@@ -1582,7 +1576,7 @@ int main(int argc, char* argv[]) { // argc = 1 + N, argv = { <command>, <arg1>,
15821576
}
15831577
break;
15841578
}
1585-
case Task::Generate: { // -g <limit or -1> [-u] [-q <limit>] [-l <limit or -1>] [-k <limit or -1>] [-b] [-v] [-s]
1579+
case Task::Generate: { // -g <limit or -1> [-u] [-q <limit>] [-l <limit or -1>] [-k <limit or -1>] [-b] [-f] [-s]
15861580
unsigned optParams = t.bln["useConclusionTrees"] ? 5 : t.bln["useConclusionStrings"] ? 4 : t.num["maxSymbolicConsequentLength"] != -1 ? 3 : t.num["maxSymbolicConclusionLength"] != -1 ? 2 : t.bln["whether -q was called"] ? 1 : 0;
15871581
cout << "[Main] Calling generateDProofRepresentativeFiles(" << (unsigned) t.num["limit"] << ", " << bstr(t.bln["redundantSchemaRemoval"]) << ", " << bstr(t.bln["withConclusions"]) << (t.bln["whether -q was called"] ? string(", ") + to_string(size_t(t.num["candidateQueueCapacities"])) : optParams > 1 ? ", null" : "") << (t.num["maxSymbolicConclusionLength"] != -1 ? string(", ") + to_string(size_t(t.num["maxSymbolicConclusionLength"])) : optParams > 2 ? ", -1" : "") << (t.num["maxSymbolicConsequentLength"] != -1 ? string(", ") + to_string(size_t(t.num["maxSymbolicConsequentLength"])) : optParams > 3 ? ", -1" : "") << (t.bln["useConclusionStrings"] || optParams > 4 ? string(", ") + bstr(t.bln["useConclusionStrings"]) : "") << (t.bln["useConclusionTrees"] || optParams > 5 ? string(", ") + bstr(t.bln["useConclusionTrees"]) : "") << ")." << endl;
15881582
size_t candidateQueueCapacities = static_cast<size_t>(t.num["candidateQueueCapacities"]);

0 commit comments

Comments
 (0)