github.com/vipernet-xyz/tm@v0.34.24/spec/ivy-proofs/count_lines.sh (about)

     1  #!/bin/bash
     2  
     3  r='^\s*$\|^\s*\#\|^\s*\}\s*$\|^\s*{\s*$' # removes comments and blank lines and lines that contain only { or }
     4  N1=`cat tendermint.ivy domain_model.ivy network_shim.ivy | grep -v $r'\|.*invariant.*' | wc -l`
     5  N2=`cat abstract_tendermint.ivy | grep "observed_" | wc -l` # the observed_* variables specify the observations of the nodes
     6  SPEC_LINES=`expr $N1 + $N2`
     7  echo "spec lines: $SPEC_LINES"
     8  N3=`cat abstract_tendermint.ivy | grep -v $r'\|.*observed_.*' | wc -l`
     9  N4=`cat accountable_safety_1.ivy | grep -v $r | wc -l`
    10  PROOF_LINES=`expr $N3 + $N4`
    11  echo "proof lines: $PROOF_LINES"
    12  RATIO=`bc <<< "scale=2;$PROOF_LINES / $SPEC_LINES"`
    13  echo "proof-to-code ratio for the accountable-safety property: $RATIO"