mirror of
https://github.com/Brandon-Rozek/matmod.git
synced 2025-06-20 14:43:55 +00:00
Compare commits
No commits in common. "8f83cd6abdba0645ef40739b32570a3b9d16a41d" and "46e570103fa0debb760e87f56f78566fb0e68c43" have entirely different histories.
8f83cd6abd
...
46e570103f
3 changed files with 5 additions and 1114 deletions
1101
examples/R5-S5
1101
examples/R5-S5
File diff suppressed because it is too large
Load diff
|
@ -19,8 +19,3 @@ Extends R to have necessitation with the following additional axioms:
|
||||||
3) (!p & !q) -> !(p & q)
|
3) (!p & !q) -> !(p & q)
|
||||||
|
|
||||||
Output contains all satisfiable models up to size 3.
|
Output contains all satisfiable models up to size 3.
|
||||||
|
|
||||||
## R5-S5
|
|
||||||
|
|
||||||
Extends R with axioms that classically are adequate for S5 giving rise to an R-ish version of S5 with necessitation.
|
|
||||||
|
|
||||||
|
|
|
@ -58,13 +58,14 @@ def parse_matrices(infile: SourceFile) -> List[Tuple[Model, Dict]]:
|
||||||
def process_sizes(infile: SourceFile, header: UglyHeader, current_model_parts: ModelBuilder, solutions: List[Tuple[Model, Dict]]):
|
def process_sizes(infile: SourceFile, header: UglyHeader, current_model_parts: ModelBuilder, solutions: List[Tuple[Model, Dict]]):
|
||||||
"""Stage 1"""
|
"""Stage 1"""
|
||||||
|
|
||||||
first_run = True
|
# NOTE: In R3-PN the first size line is -1?
|
||||||
|
if header.necessitation:
|
||||||
|
next(infile)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
print("Processing next size")
|
print("Processing next size")
|
||||||
try:
|
try:
|
||||||
size = parse_size(infile, first_run)
|
size = parse_size(infile)
|
||||||
first_run = False
|
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
# For some reason, when necessitation is enabled this doesn't
|
# For some reason, when necessitation is enabled this doesn't
|
||||||
# have a -1 on the last line
|
# have a -1 on the last line
|
||||||
|
@ -218,15 +219,11 @@ def carrier_set_from_size(size: int):
|
||||||
mvalue_from_index(i) for i in range(size + 1)
|
mvalue_from_index(i) for i in range(size + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
def parse_size(infile: SourceFile, first_run: bool) -> Optional[int]:
|
def parse_size(infile: SourceFile) -> Optional[int]:
|
||||||
"""
|
"""
|
||||||
Parse the line representing the matrix size.
|
Parse the line representing the matrix size.
|
||||||
"""
|
"""
|
||||||
size = int(next(infile))
|
size = int(next(infile))
|
||||||
# HACK: The first size line may be -1 due to a bug. Skip it
|
|
||||||
if size == -1 and first_run:
|
|
||||||
size = int(next(infile))
|
|
||||||
|
|
||||||
if size == -1:
|
if size == -1:
|
||||||
return None
|
return None
|
||||||
assert size > 0, f"Unexpected size at line {infile.current_line}"
|
assert size > 0, f"Unexpected size at line {infile.current_line}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue