Commit db0572e2 authored by Marc Schoolderman's avatar Marc Schoolderman
Browse files

major cleanup of directory structure

parent ca07259c
......@@ -35,7 +35,7 @@ end
module KaratAvr
use import avrmodel2.AVRint
use import avrmodel.AVRint
use import int.Int
use import int.EuclideanDivision
use import bv.Pow2int
......@@ -1234,7 +1234,7 @@ assert { at(uint 3 reg 8)'L11 + pow2 24*uint 6 reg 8 + pow2 72*uint 3 reg 20 +
std rZ 10 r21;
std rZ 11 r22
use avrmodel2.Shadow as S
use avrmodel.Shadow as S
lemma mul_bound_preserve:
forall x y l. 0 <= x <= l -> 0 <= y <= l -> x*y <= l*l
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
No preview for this file type
This diff is collapsed.
#!/bin/sed -f
# this script translates avr assembler files to whyml; it requires GNU sed
# remove assembler directives
# remove carriage returns
# translate assembly comments into whyml comments
s/ *; *\(.*\)$/; (* \1 *)/
# add statement separators (except after comments)
# convert mnemonics into lowercase
# remove leading whitespace
s/^ *;//g
# translate X,Y,Z registers in st/ld opcodes
# translate load-and-increment mnemonics
s/ld \(\w\+\), \(r[XY-Z]\)+/ld_inc \1, \2/
# replace syntax that functions to separate arguments with juxtaposition
s/[,+-] \?/ /g
# replace labels with function entry points (only works on branchfree code)
/^\(.*\):;$/s//let \1 () =/
#! /usr/bin/env bash
# generate the rewrite rules to expand 'uint' into a power series; these will be proven in why3, so
# this script is not part of the trusted code base
echo "lemma uint_0:"
echo " forall reg, lo. B.sum (reg,lo) 0 0 = 0"
for i in `seq 1 32`; do
echo "lemma uint_$i:"
echo -n " forall reg, lo. B.sum (reg,lo) 0 $i = reg[lo]"
for j in `seq 2 $i`; do
echo -n " + pow2 $((8*(j-1)))*reg[lo+$((j-1))]"
echo "meta rewrite prop uint_$i"
#!/usr/bin/env python
# generate the simple lemmas equating pow-evocations to constants
for i in range(9,32):
print "lemma pow2_%(x)d: pow2 %(x)d = 0x%(y)x" % { 'x': 8*i, 'y': 2**(8*i) }
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment