https://github.com/EasyCrypt/easycrypt
Tip revision: 46d694843586b1800ec951ff08dbc8e182889f76 authored by Pierre-Yves Strub on 28 August 2023, 14:00:06 UTC
Operators body can now be formulas
Operators body can now be formulas
Tip revision: 46d6948
dune-lib
#! /usr/bin/env python3
# --------------------------------------------------------------------
import sys, os
# --------------------------------------------------------------------
def _main():
if len(sys.argv)-1 != 1:
print(f'Usage: {sys.argv[0]} [theory directory]')
exit(1)
thdir = sys.argv[1]
theories = []
for root, _, files in os.walk(thdir):
for fname in files:
if os.path.splitext(fname)[1] in ('.ec', '.eca'):
theories.append(os.path.relpath(os.path.join(root, fname), thdir))
theories = sorted(theories)
namemax = max(0, *(len(x) for x in theories))
print('(install')
print(' (section (site (easycrypt theories)))')
print(' (files')
for theory in theories:
print(f' ({theory:{namemax}} as {theory})')
print(' )')
print(')')
# --------------------------------------------------------------------
if __name__ == '__main__':
_main()