|
| 1 | +;; -*- mode: scheme -*- |
| 2 | +;; A Proof to verify the functionality of a simple website that uses java script |
| 3 | +;; By Skyler Griffith |
| 4 | + |
| 5 | +(import "common.thm") |
| 6 | + |
| 7 | +(page press-0 (load "induction.rkt" doc-1) |
| 8 | + :w (between 800 1920) |
| 9 | + :h (between 600 1280) |
| 10 | + :fs (between 16 32)) |
| 11 | + |
| 12 | +(page press-1 (load "induction.rkt" doc-2) |
| 13 | + :w (between 800 1920) |
| 14 | + :h (between 600 1280) |
| 15 | + :fs (between 16 32)) |
| 16 | + |
| 17 | +(page press-2 (load "induction.rkt" doc-3) |
| 18 | + :w (between 800 1920) |
| 19 | + :h (between 600 1280) |
| 20 | + :fs (between 16 32)) |
| 21 | + |
| 22 | +(page press-3 (load "induction.rkt" doc-4) |
| 23 | + :w (between 800 1920) |
| 24 | + :h (between 600 1280) |
| 25 | + :fs (between 16 32)) |
| 26 | + |
| 27 | +(page press-4 (load "induction.rkt" doc-5) |
| 28 | + :w (between 800 1920) |
| 29 | + :h (between 600 1280) |
| 30 | + :fs (between 16 32)) |
| 31 | + |
| 32 | +(page press-5 (load "induction.rkt" doc-6) |
| 33 | + :w (between 800 1920) |
| 34 | + :h (between 600 1280) |
| 35 | + :fs (between 16 32)) |
| 36 | + |
| 37 | +(page press-50 (load "induction.rkt" doc-7) |
| 38 | + :w (between 800 1920) |
| 39 | + :h (between 600 1280) |
| 40 | + :fs (between 16 32)) |
| 41 | + |
| 42 | +(theorem (top-above-bottom b) |
| 43 | + (>= (- (bottom b) (top b) 0))) |
| 44 | + |
| 45 | +(proof (top-above-bottom top-above-bottom press-0 press-1 press-2 press-3 press-4 press-5) |
| 46 | + (component list (id list)) |
| 47 | + (component button (tag button)) |
| 48 | + (components todos (child (id list) *)) |
| 49 | + |
| 50 | + (erase todos :text) |
| 51 | + (assert todos (and (> (height ?) 0) (float-flow-skip ?) (non-negative-margins ?))) |
| 52 | + (pre list (= (floats-tracked ?) 0)) |
| 53 | + (induct list ; the inductive fact |
| 54 | + (and (>= (- (bottom inductive-footer) (top inductive-header)) 0) (= (floats-tracked inductive-footer) (floats-tracked inductive-header)))) |
| 55 | + (assert list (forall () (>= (- (bottom (last list)) (top (first list)) 0))))) |
| 56 | + |
| 57 | +(proof (stress-test top-above-bottom press-50) |
| 58 | + (component list (id list)) |
| 59 | + (component button (tag button)) |
| 60 | + (components todos (child (id list) *)) |
| 61 | + |
| 62 | + (erase todos :text) |
| 63 | + (assert todos (and (> (height ?) 0) (float-flow-skip ?) (non-negative-margins ?))) |
| 64 | + (pre list (= (floats-tracked ?) 0)) |
| 65 | + (induct list ; the inductive fact |
| 66 | + (and (>= (- (bottom inductive-footer) (top inductive-header)) 0) (= (floats-tracked inductive-footer) (floats-tracked inductive-header)))) |
| 67 | + (assert list (forall () (>= (- (bottom (last list)) (top (first list)) 0))))) |
| 68 | + |
| 69 | +(proof (interactive-onscreen interactive-onscreen press-0 press-1 press-2 press-3) |
| 70 | + (component list (id list)) |
| 71 | + (component button (tag button)) |
| 72 | + (components todos (child (id list) *)) |
| 73 | + (erase todos :text) |
| 74 | + (assert list |
| 75 | + (=> (or (= (prev list) null) |
| 76 | + (non-negative-margins (prev list))) |
| 77 | + (non-negative-margins list))) |
| 78 | + (assert * (forall (b) (=> (onscreen ?) |
| 79 | + (=> (or (is-component b) (is-interactive b)) (onscreen b))))) |
| 80 | + (assert (- * list) (forall (t) (=> (has-type t text) (> (width t) 0) (non-negative-margins ?)))) |
| 81 | + (assert root (onscreen root))) |
0 commit comments