https://github.com/EasyCrypt/easycrypt
Raw File
Tip revision: 0afb9713c2be31c8c32b5221bd263996be92dc78 authored by François Dupressoir on 06 July 2021, 09:30:36 UTC
Clean some SMT calls in PRP-PRF
Tip revision: 0afb971
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()

back to top