Skip to content

Commit 789a653

Browse files
authored
Move some specs from remote spec table into local repo (#116)
Added: - Murat's PlusCal version of Lamport & Gray's analysis of Paxos vs. Two-Phase Commit - Voucher Transaction System - Atomic Commitment Protocol - Byzantine Paxos Signed-off-by: Andrew Helwer <[email protected]>
1 parent 666625d commit 789a653

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+7673
-252
lines changed

.ciignore

+5
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@
55
# Example:
66
specifications/doesnotexist
77

8+
# Ignore submodules to ensure deterministic local execution
9+
specifications/BlockingQueue
10+
specifications/CCF
11+
specifications/azure-cosmos-tla
12+

.github/scripts/format_markdown_table.py

+22-12
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,51 @@
1818

1919
columns = ['name', 'authors', 'beginner', 'proof', 'tlc', 'pcal', 'apalache']
2020

21-
def get_column(row, index):
21+
def get_column(row, col_name):
2222
'''
2323
Gets the cell of the given column in the given row.
2424
'''
25-
return row.children[columns.index(index)].children[0]
25+
return row.children[columns.index(col_name)].children[0]
2626

27-
def remove_column(table, col_index):
27+
def remove_column(table, col_name):
2828
'''
2929
Removes the column of the given index from the table.
3030
'''
31-
index = columns.index(col_index)
31+
index = columns.index(col_name)
3232
table.header.children.pop(index)
3333
table.column_align.pop(index)
3434
for row in table.children:
3535
row.children.pop(index)
3636

37-
def blank_column(table, col_index):
37+
def blank_column(table, col_name):
3838
'''
3939
Removes all data in the given column.
4040
'''
41-
index = columns.index(col_index)
41+
index = columns.index(col_name)
4242
for row in table.children:
4343
row.children[index].children = []
4444

45-
def swap_columns(table, first_col_index, second_col_index):
45+
def duplicate_column(table, col_name):
46+
'''
47+
Duplicates the given column.
48+
'''
49+
index = columns.index(col_name)
50+
table.header.children.insert(index, table.header.children[index])
51+
table.column_align.insert(index, table.column_align[index])
52+
for row in table.children:
53+
row.children.insert(index, row.children[index])
54+
55+
def swap_columns(table, first_col_name, second_col_name):
4656
'''
4757
Swaps two columns in a table.
4858
'''
49-
first = columns.index(first_col_index)
50-
second = columns.index(second_col_index)
59+
first = columns.index(first_col_name)
60+
second = columns.index(second_col_name)
5161
table.header.children[second], table.header.children[first] = table.header.children[first], table.header.children[second]
5262
table.column_align[second], table.column_align[first] = table.column_align[first], table.column_align[second]
5363
for row in table.children:
5464
row.children[second], row.children[first] = row.children[first], row.children[second]
5565

56-
5766
def format_table(table):
5867
'''
5968
All table transformations should go here.
@@ -65,8 +74,9 @@ def format_document(document):
6574
All document transformations should go here.
6675
'''
6776
# Gets table of local specs
68-
table = next((child for child in document.children if isinstance(child, Table)))
69-
format_table(table)
77+
local_table, remote_table = [child for child in document.children if isinstance(child, Table)]
78+
#format_table(local_table)
79+
#format_table(remote_table)
7080

7181
# Read, format, write
7282
# Need to both parse & render within same MarkdownRenderer context to preserve other formatting

.github/scripts/generate_manifest.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def generate_new_manifest(examples_root, ignored_dirs, parser, queries):
7878
'path': to_posix(spec_path),
7979
'title': spec_name,
8080
'description': '',
81-
'source': '',
81+
'sources': [],
8282
'authors': [],
8383
'tags': [],
8484
'modules': [
@@ -116,10 +116,9 @@ def find_corresponding_spec(old_spec, new_manifest):
116116
return specs[0] if any(specs) else None
117117

118118
def integrate_spec_info(old_spec, new_spec):
119-
fields = ['title', 'description', 'source', 'tags']
119+
fields = ['title', 'description', 'authors', 'sources', 'tags']
120120
for field in fields:
121121
new_spec[field] = old_spec[field]
122-
new_spec['authors'] = old_spec['authors']
123122

124123
def find_corresponding_module(old_module, new_spec):
125124
modules = [

.github/workflows/CI.yml

+2
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,13 @@ jobs:
180180
specifications/PaxosHowToWinATuringAward/Consensus.tla
181181
specifications/lamport_mutex/LamportMutex_proofs.tla
182182
specifications/ewd998/EWD998_proof.tla
183+
specifications/byzpaxos/VoteProof.tla
183184
# Long-running; see https://github.com/tlaplus/tlapm/issues/85
184185
specifications/LoopInvariance/Quicksort.tla
185186
specifications/LoopInvariance/SumSequence.tla
186187
specifications/bcastByz/bcastByz.tla
187188
specifications/MisraReachability/ReachabilityProofs.tla
189+
specifications/byzpaxos/BPConProof.tla # Takes about 30 minutes
188190
)
189191
python $SCRIPT_DIR/check_proofs.py \
190192
--tlapm_path deps/tlapm-install \

0 commit comments

Comments
 (0)