archive-nl.com » NL » R » ROBBERTKREBBERS.NL

Total: 145

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Module natmap
    let l2 Hl2 m2 in NatMap natmap merge raw f l1 l2 natmap merge wf Hl1 Hl2 Fixpoint natmap to list raw A i nat l natmap raw A list nat A match l with None l natmap to list raw S i l Some x l i x natmap to list raw S i l end Lemma natmap elem of to list raw aux A j l natmap raw A i x i x natmap to list raw j l i i i j mjoin l i Some x Proof split revert j induction l as y l IH intros j simpl by rewrite elem of nil rewrite elem of cons intros simplify equality by exists 0 destruct IH S j as i auto exists S i simpl auto with lia intros destruct IH S j as i auto exists S i simpl auto with lia intros i Hi subst revert i j Hi induction l as y l IH intros i j simpl done destruct i as i simplify equality left right rewrite Nat add succ r by apply IH i S j destruct i as i simplify equality rewrite Nat add succ r by apply IH i S j Qed Lemma natmap elem of to list raw A l natmap raw A i x i x natmap to list raw 0 l mjoin l i Some x Proof rewrite natmap elem of to list raw aux setoid rewrite Nat add 0 r naive solver Qed Lemma natmap to list raw nodup A i l natmap raw A NoDup natmap to list raw i l Proof revert i induction l as IH simpl try constructor auto rewrite natmap elem of to list raw aux intros lia Qed Instance natmap to list A FinMapToList nat A natmap A λ m let l m in natmap to list raw 0 l Definition natmap map raw A B f A B natmap raw A natmap raw B fmap fmap f Lemma natmap map wf A B f A B l natmap wf l natmap wf natmap map raw f l Proof unfold natmap map raw natmap wf rewrite fmap last destruct last l by apply fmap is Some done Qed Lemma natmap lookup map raw A B f A B i l mjoin natmap map raw f l i f mjoin l i Proof unfold natmap map raw rewrite list lookup fmap by destruct l i Qed Instance natmap map FMap natmap λ A B f m let l Hl m in NatMap natmap map raw f l natmap map wf Hl Instance FinMap nat natmap Proof split unfold lookup natmap lookup intros A l1 Hl1 l2 Hl2 E apply natmap eq revert l2 Hl1 Hl2 E simpl induction l1 as x l1 IH intros y l2 Hl1 Hl2 E simpl in done by specialize E 0 destruct natmap wf lookup None l2 as i auto with congruence by specialize E 0 f equal apply E 0 apply IH eauto using

    Original URL path: http://robbertkrebbers.nl/research/ch2o/natmap.html (2015-08-10)
    Open archived version from archive


  • Module pmap
    Lemma Plookup singleton ne A i j x A i j Psingleton raw i x j None Proof revert j induction i intros simpl auto congruence Qed Definition PNode canon A l Pmap raw A o option A r Pmap raw A match l o r with PLeaf None PLeaf PLeaf PNode l o r end Lemma PNode canon wf A l Pmap raw A o option A r Pmap raw A Pmap wf l Pmap wf r Pmap wf PNode canon l o r Proof intros H1 H2 destruct H1 o H2 simpl intuition Qed Local Hint Resolve PNode canon wf Lemma PNode canon lookup xH A l Pmap raw A o r Pmap raw A PNode canon l o r 1 o Proof by destruct l o r Qed Lemma PNode canon lookup xO A l Pmap raw A o r Pmap raw A i PNode canon l o r i 0 l i Proof by destruct l o r Qed Lemma PNode canon lookup xI A l Pmap raw A o r Pmap raw A i PNode canon l o r i 1 r i Proof by destruct l o r Qed Ltac PNode canon rewrite repeat first rewrite PNode canon lookup xH rewrite PNode canon lookup xO rewrite PNode canon lookup xI Instance Ppartial alter raw A PartialAlter positive A Pmap raw A fix go f i t struct t Pmap raw A match t with PLeaf match f None with None PLeaf Some x Psingleton raw i x end PNode l o r match i with 1 PNode canon l f o r i 0 PNode canon partial alter go f i l o r i 1 PNode canon l o partial alter go f i r end end Lemma Ppartial alter wf A f i t Pmap raw A Pmap wf t Pmap wf partial alter f i t Proof intros twf revert i induction twf unfold partial alter simpl case f None intuition intros simpl intuition intros simpl intuition Qed Instance Ppartial alter A PartialAlter positive A Pmap A λ f i m PMap partial alter f i pmap car m Ppartial alter wf f i pmap prf m Lemma Plookup alter A f i t Pmap raw A partial alter f i t i f t i Proof revert i induction t intros i change match f None with Some x Psingleton raw i x None PLeaf end i f None destruct f None intros apply Plookup singleton by destruct i intros simpl by PNode canon rewrite Qed Lemma Plookup alter ne A f i j t Pmap raw A i j partial alter f i t j t j Proof revert i j induction t as l IHl r IHr intros change match f None with Some x Psingleton raw i x None PLeaf end j None destruct f None done intros by apply Plookup singleton ne intros simpl PNode canon rewrite auto congruence Qed Instance Pfmap raw FMap Pmap raw λ A B f fix go t match t with PLeaf PLeaf PNode l x r PNode go l f x go r end Lemma Pfmap ne f A B t Pmap raw A Pmap ne t Pmap ne fmap f t Proof induction 1 csimpl auto Qed Local Hint Resolve Pfmap ne Lemma Pfmap wf f A B t Pmap raw A Pmap wf t Pmap wf fmap f t Proof induction 1 csimpl intuition Qed Global Instance Pfmap FMap Pmap λ A B f m PMap f pmap car m Pfmap wf f pmap prf m Lemma Plookup fmap A B f A B t Pmap raw A i f t i f t i Proof revert i induction t done by intros simpl Qed Fixpoint Pto list raw A j positive t Pmap raw A acc list positive A list positive A match t with PLeaf acc PNode l o r default o λ x Preverse j x Pto list raw j 0 l Pto list raw j 1 r acc end list Lemma Pelem of to list A t Pmap raw A j i acc x i x Pto list raw j t acc i i i Preverse j t i Some x i x acc Proof split revert j acc induction t as l IHl y r IHr intros j acc simpl by right rewrite elem of cons intros simplify equality left exists 1 by rewrite left id L 1 positive destruct IHl j 0 Pto list raw j 1 r acc as i auto left exists i 0 by rewrite Preverse xO associative L destruct IHr j 1 acc as i auto left exists i 1 by rewrite Preverse xI associative L intros destruct IHl j 0 Pto list raw j 1 r acc as i auto left exists i 0 by rewrite Preverse xO associative L destruct IHr j 1 acc as i auto left exists i 1 by rewrite Preverse xI associative L revert t j i acc assert t j i acc i x acc i x Pto list raw j t acc as help intros t induction t as l IHl y r IHr intros j i acc simpl rewrite elem of cons auto intros t j acc i Hi by auto revert j i acc Hi induction t as l IHl y r IHr intros j i acc simpl done rewrite elem of cons destruct i as i i simplify equality right apply help specialize IHr j 1 i rewrite Preverse xI associative L in IHr by apply IHr right specialize IHl j 0 i rewrite Preverse xO associative L in IHl by apply IHl left by rewrite left id L 1 positive destruct i as i i simplify equality apply help specialize IHr j 1 i rewrite Preverse xI associative L in IHr by apply IHr specialize IHl j 0 i rewrite Preverse xO associative L in IHl by apply IHl Qed Lemma Pto list nodup A j

    Original URL path: http://robbertkrebbers.nl/research/ch2o/pmap.html (2015-08-10)
    Open archived version from archive

  • Module nmap
    t NMap f o t Npos p NMap o t NMap o partial alter f p t end Instance Nto list A FinMapToList N A Nmap A λ t match t with NMap o t default o λ x 0 x prod map Npos id map to list t end Instance Nomap OMap Nmap λ A B f t match t with NMap o t NMap o f omap f t end Instance Nmerge Merge Nmap λ A B C f t1 t2 match t1 t2 with NMap o1 t1 NMap o2 t2 NMap f o1 o2 merge f t1 t2 end Instance Nfmap FMap Nmap λ A B f t match t with NMap o t NMap f o f t end Instance FinMap N Nmap Proof split intros H f equal apply H 0 apply map eq intros i apply H Npos i by intros intros f t i simpl done apply lookup partial alter intros f t i j simpl try intuition congruence intros apply lookup partial alter ne congruence intros simpl done apply lookup fmap intros x t unfold map to list simpl constructor rewrite elem of list fmap by intros by apply NoDup fmap NoDup map to list apply NoDup fmap NoDup map to list intros t i x unfold map to list split destruct t as y t simpl rewrite elem of cons elem of list fmap intros simplify equality done by apply elem of map to list rewrite elem of list fmap intros simplify equality by apply elem of map to list destruct t as y t simpl rewrite elem of cons elem of list fmap destruct i as i simpl intuition congruence intros right exists i x by rewrite elem of map to list rewrite elem of list fmap destruct i as

    Original URL path: http://robbertkrebbers.nl/research/ch2o/nmap.html (2015-08-10)
    Open archived version from archive

  • Module zmap
    o t t ZMap o partial alter f p t t Zneg p ZMap o t t ZMap o t partial alter f p t end Instance Zto list A FinMapToList Z A Zmap A λ t match t with ZMap o t t default o λ x 0 x prod map Zpos id map to list t prod map Zneg id map to list t end Instance Zomap OMap Zmap λ A B f t match t with ZMap o t t ZMap o f omap f t omap f t end Instance Zmerge Merge Zmap λ A B C f t1 t2 match t1 t2 with ZMap o1 t1 t1 ZMap o2 t2 t2 ZMap f o1 o2 merge f t1 t2 merge f t1 t2 end Instance Nfmap FMap Zmap λ A B f t match t with ZMap o t t ZMap f o f t f t end Instance FinMap Z Zmap Proof split intros H f equal apply H 0 apply map eq intros i apply H Zpos i apply map eq intros i apply H Zneg i by intros intros f simpl done apply lookup partial alter intros f simpl intuition congruence intros apply lookup partial alter ne congruence intros simpl done apply lookup fmap intros o t t unfold map to list simpl assert NoDup prod map Z pos id map to list t prod map Z neg id map to list t apply NoDup app split ands apply NoDup fmap 2 NoDup map to list intro rewrite elem of list fmap naive solver apply NoDup fmap 2 NoDup map to list destruct o simpl auto constructor auto rewrite elem of app elem of list fmap naive solver intros t i x unfold map to list split destruct t as y t

    Original URL path: http://robbertkrebbers.nl/research/ch2o/zmap.html (2015-08-10)
    Open archived version from archive

  • Module stringmap
    Lemma stringmap partial alter wf A f option A option A m s stringmap wf m stringmap wf partial alter f string to pos s m Proof intros Hm p x destruct decide string to pos s p as by rewrite string of to pos rewrite lookup partial alter ne by done by apply Hm Qed Instance stringmap partial alter A PartialAlter string A stringmap A λ f s m let m Hm m in StringMap partial alter f string to pos s m bool decide pack stringmap partial alter wf f m s bool decide unpack Hm Lemma stringmap fmap wf A B f A B m stringmap wf m stringmap wf f m Proof intros p x rewrite lookup fmap fmap Some intros eauto Qed Instance stringmap fmap FMap stringmap λ A B f m let m Hm m in StringMap f m bool decide pack stringmap fmap wf f m bool decide unpack Hm Lemma stringmap omap wf A B f A option B m stringmap wf m stringmap wf omap f m Proof intros p x rewrite lookup omap bind Some intros eauto Qed Instance stringmap omap OMap stringmap λ A B f m let m Hm m in StringMap omap f m bool decide pack stringmap omap wf f m bool decide unpack Hm Lemma stringmap merge wf A B C f option A option B option C m1 m2 let f o1 o2 match o1 o2 with None None None f o1 o2 end in stringmap wf m1 stringmap wf m2 stringmap wf merge f m1 m2 Proof intros f Hm1 Hm2 p z rewrite lookup merge by done intros destruct m1 eqn m2 eqn naive solver Qed Instance stringmap merge Merge stringmap λ A B C f m1 m2 let m1 Hm1 m1 in let m2 Hm2 m2 in let f o1 o2 match o1 o2 with None None None f o1 o2 end in StringMap merge f m1 m2 bool decide pack stringmap merge wf f bool decide unpack Hm1 bool decide unpack Hm2 Instance stringmap to list A FinMapToList string A stringmap A λ m let m m in prod map string of pos id map to list m Instantiation of the finite map interface Instance FinMap string stringmap Proof split unfold lookup intros A m1 Hm1 m2 Hm2 H apply stringmap eq map eq intros i simpl in apply bool decide unpack in Hm1 apply bool decide unpack in Hm2 apply option eq intros x split intros Hi generalize Hi rewrite Hm1 i x by done eauto using option eq 1 generalize Hi rewrite Hm2 i x by done eauto using option eq 1 done intros A f m Hm s apply lookup partial alter f m intros A f m Hm s s Hs apply lookup partial alter ne f m by contradict Hs apply injective string to pos intros A B f m Hm s apply lookup fmap f m intros A m Hm unfold map to list

    Original URL path: http://robbertkrebbers.nl/research/ch2o/stringmap.html (2015-08-10)
    Open archived version from archive

  • Module hashset
    in guard l Some l m1 m2 Next Obligation intros n l rewrite lookup difference with Some intros simplify option equality auto split apply Forall list difference apply NoDup list difference first by eapply Hm1 eauto by eapply Hm2 eauto Qed Instance hashset elems Elements A hashset hash λ m map to list hashset car m snd Global Instance FinCollection A hashset hash Proof split split split intros simplify map equality unfold elem of hashset elem of singleton hashset singleton simpl intros x y setoid rewrite lookup singleton Some split by intros decompose elem of list intros eexists y by rewrite elem of list singleton unfold elem of hashset elem of union hashset union intros m1 Hm1 m2 Hm2 x simpl setoid rewrite lookup union with Some split intros l k Hx simplify equality eauto rewrite elem of list union in Hx destruct Hx eauto intros l k destruct m2 hash x as k eauto exists list union l k rewrite elem of list union naive solver destruct m1 hash x as l eauto 6 exists list union l k rewrite elem of list union naive solver unfold elem of hashset elem of intersection hashset intersection intros m1 m2 x simpl setoid rewrite lookup intersection with Some split intros l k Hx simplify option equality rewrite elem of list intersection in Hx naive solver intros l k assert x list intersection l k by by rewrite elem of list intersection exists list intersection l k split exists l k split ands auto by rewrite option guard True by eauto using elem of not nil unfold elem of hashset elem of intersection hashset intersection intros m1 m2 x simpl setoid rewrite lookup difference with Some split intros l l k Hx simplify option equality rewrite elem of list difference in Hx naive solver intros l Hm2 destruct m2 hash x as k eqn eauto destruct decide x k destruct Hm2 eauto assert x list difference l k by by rewrite elem of list difference exists list difference l k split right exists l k split ands auto by rewrite option guard True by eauto using elem of not nil unfold elem of at 2 hashset elem of elements hashset elems intros m Hm x simpl setoid rewrite elem of list bind split intros n l Hx Hn simpl in rewrite elem of map to list in Hn cut hash x n intros eauto eapply Forall forall λ x hash x n l eauto eapply Hm eauto intros l exists hash x l simpl by rewrite elem of map to list unfold elements hashset elems intros m Hm simpl rewrite map Forall to list in Hm generalize NoDup fst map to list m induction Hm as n l m csimpl inversion clear 1 as Hn constructor apply NoDup app split ands eauto setoid rewrite elem of list bind intros x n l simpl in assert hash x n hash x n as subst split eapply Forall forall λ x hash x n

    Original URL path: http://robbertkrebbers.nl/research/ch2o/hashset.html (2015-08-10)
    Open archived version from archive

  • Module integer_coding
    r case bool decide simpl rewrite IH by lia lia Qed Lemma Z of zero bits n Z of bits replicate n false 0 Proof induction n simpl lia Qed Lemma deendianize permutation k β s deendianize k β s ₚ β s Proof rewrite endianize deendianize k β s at 2 by rewrite endianize permutation Qed Global Instance Proper ₚ ₚ endianize k Proof intros k β s1 β s2 by rewrite endianize permutation Qed Global Instance Injective ₚ ₚ endianize k Proof intros k β s1 β s2 by rewrite endianize permutation Qed Global Instance Proper ₚ ₚ deendianize k Proof intros k β s1 β s2 by rewrite deendianize permutation Qed Global Instance Injective ₚ ₚ deendianize k Proof intros k β s1 β s2 by rewrite deendianize permutation Qed Lemma endianize length k β s length endianize k β s length β s Proof by rewrite endianize permutation Qed Lemma deendianize length k β s length deendianize k β s length β s Proof by rewrite deendianize permutation Qed Lemma rank size pos k 0 rank size k nat Proof rewrite Nat le succ l rank size char Nat2Z inj le apply rank size preserving char least Qed Lemma rank size ne 0 k rank size k 0 nat Proof apply Nat neq 0 lt 0 rank size pos Qed Lemma int width char si int width IntType si char rank char bits Proof unfold int width simpl by rewrite rank size char Nat mul 1 l Qed Lemma char bits pos 0 char bits nat Proof pose proof char bits ge 8 lia Qed Lemma char bits ne 0 char bits 0 nat Proof pose proof char bits ge 8 lia Qed Lemma int width ge 8 τ i 8 int width τ i nat Proof unfold int width transitivity 1 char bits nat by rewrite char bits ge 8 Nat mul 1 l apply Nat mul le mono r generalize rank size pos rank τ i lia Qed Lemma int width ge 8 alt τ i 8 int width τ i Proof apply Nat2Z inj le 8 int width ge 8 Qed Lemma int width pos τ i 0 int width τ i nat Proof pose proof int width ge 8 τ i lia Qed Lemma int width pos alt τ i 0 int width τ i Proof apply Nat2Z inj lt 0 int width pos Qed Lemma int width pred nonneg τ i 0 int width τ i 1 Proof pose proof int width pos alt τ i lia Qed Hint Resolve int width pos alt int width pred nonneg Lemma int width Unsigned Signed k int width IntType Unsigned k int width IntType Signed k Proof done Qed Lemma int precision Unsigned Signed k int precision IntType Unsigned k S int precision IntType Signed k Proof unfold int precision simpl rewrite int width Unsigned Signed pose proof int width pos IntType Signed k lia Qed Lemma int typed lower x τ i int typed x τ i int lower τ i x Proof by intros Qed Lemma int typed upper x τ i int typed x τ i x int upper τ i Proof by intros Qed Lemma int lower unsigned k int lower IntType Unsigned k 0 Proof done Qed Lemma int typed unsigned nonneg x k int typed x IntType Unsigned k 0 x Proof by intros Qed Lemma int lower nonpos τ i int lower τ i 0 Proof unfold int lower destruct sign τ i done apply Z opp nonpos nonneg auto with zpos Qed Lemma int upper pos τ i 0 int upper τ i Proof unfold int upper destruct sign τ i auto with zpos Qed Hint Resolve int lower nonpos int upper pos Lemma int mod lower upper x τ i int lower τ i x mod int upper τ i int upper τ i Proof split transitivity 0 auto apply Z mod pos bound auto apply Z mod pos bound auto Qed Hint Resolve int mod lower upper Lemma int upper lower τ i int upper τ i 2 int width τ i int lower τ i Proof unfold int upper int lower int precision destruct sign τ i simpl lia apply Z mul cancel l 2 done pose proof int width pos τ i rewrite Z mul add distr l Z mul opp r Nat2Z inj sub Z sub 1 r Z pow pred r auto with zpos Qed Lemma int lower upper signed τ i sign τ i Signed int lower τ i int upper τ i Proof by intros destruct τ i simplify equality Qed Lemma int upper signed unsigned k int upper IntType Signed k int upper IntType Unsigned k Proof assert 0 int width IntType Signed k by auto using int width pos apply Z pow lt mono r unfold int precision int width in simpl in lia Qed Lemma int typed spec alt x τ i int typed x τ i match sign τ i with Signed 2 int width τ i 2 x 2 int width τ i Unsigned 0 x 2 int width τ i end Proof unfold int typed int lower int upper int precision destruct sign τ i simpl done pose proof int width pos τ i rewrite Z mul lt mono pos l 2 x Z mul le mono pos l 2 by done by rewrite Nat2Z inj sub Z mul opp r Z sub 1 r Z pow pred r by auto Qed Lemma int typed nonneg signed x τ i 0 2 x 2 int width τ i int typed x τ i Proof rewrite int typed spec alt destruct sign lia Qed Lemma int typed small x τ i 0 x 128 int typed x τ i Proof intros apply int typed nonneg signed split lia apply Z lt le trans with 2 8 lia by apply Z pow le mono r auto using int width ge 8 alt Qed

    Original URL path: http://robbertkrebbers.nl/research/ch2o/integer_coding.html (2015-08-10)
    Open archived version from archive

  • Module integer_operations
    x y τ i1 τ i2 int typed x τ i1 int typed y τ i2 int arithop ok op x τ i1 y τ i2 int typed int arithop op x τ i1 y τ i2 int promote τ i1 int promote τ i2 int arithop spec op x y τ i1 τ i2 int typed x τ i1 int typed y τ i2 let τ i int promote τ i1 int promote τ i2 in int pre arithop ok op int pre cast τ i x int pre cast τ i y τ i int arithop op x τ i1 y τ i2 int pre arithop op int pre cast τ i x int pre cast τ i y τ i int shiftop ok more op x y τ i1 τ i2 int typed x τ i1 int typed y τ i2 let τ i int promote τ i1 in int pre shiftop ok op int pre cast τ i x y τ i int shiftop ok op x τ i1 y τ i2 int shiftop typed op x y τ i1 τ i2 int typed x τ i1 int typed y τ i2 int shiftop ok op x τ i1 y τ i2 int typed int shiftop op x τ i1 y τ i2 int promote τ i1 int shiftop spec op x y τ i1 τ i2 int typed x τ i1 int typed y τ i2 let τ i int promote τ i1 in int pre shiftop ok op x y τ i int shiftop op x τ i1 y τ i2 int pre shiftop op x y τ i int cast ok more σ i x int pre cast ok σ i x int cast ok σ i x int cast typed σ i x int cast ok σ i x int typed int cast σ i x σ i int cast spec σ i x int pre cast ok σ i x int cast σ i x int pre cast σ i x Section int operations Context IntEnv K Definition int unop type of op unop τ i int type K int type K match op with NotOp sintT int promote τ i end Definition int unop ok op unop x Z τ i int type K Prop match op with NegOp int arithop ok MinusOp 0 τ i x τ i True end Definition int unop op unop x Z τ i int type K Z match op with NegOp int arithop MinusOp 0 τ i x τ i ComplOp let τ i int promote τ i in int of bits τ i negb int to bits τ i x NotOp if decide x 0 then 1 else 0 end Definition int binop type of op binop τ i1 τ i2 int type K int type K match op with CompOp sintT ArithOp BitOp int promote τ i1 int promote τ i2 ShiftOp int promote τ i1 end Definition int binop ok op binop x1 Z τ i1 int type K x2 Z τ i2 int type K Prop match op with CompOp BitOp True ArithOp op int arithop ok op x1 τ i1 x2 τ i2 ShiftOp op int shiftop ok op x1 τ i1 x2 τ i2 end Definition int binop op binop x1 Z τ i1 int type K x2 Z τ i2 int type K Z match op with CompOp op let τ i int promote τ i1 int promote τ i2 in if decide Z comp op int cast τ i x1 int cast τ i x2 then 1 else 0 ArithOp op int arithop op x1 τ i1 x2 τ i2 ShiftOp op int shiftop op x1 τ i1 x2 τ i2 BitOp op let τ i int promote τ i1 int promote τ i2 in int of bits τ i zip with bool bitop op int to bits τ i x1 int to bits τ i x2 end End int operations Section pre properties Context IntCodingSpec K Implicit Types τ i int type K Implicit Types k K Implicit Types x y Z Implicit Types n nat Hint Resolve int width pos alt int width pred nonneg Hint Resolve int lower nonpos int upper pos int mod lower upper Hint Resolve rank size preserving Lemma rank size union k1 k2 rank size k1 k2 Z Z max rank size k1 rank size k2 Proof unfold union rank union at 1 case decide by rewrite Z max r by auto by rewrite Z max l by by apply rank size preserving total not Qed Lemma rank size reflecting k1 k2 rank size k1 rank size k2 k1 k2 Proof intros destruct trichotomy k1 k2 as Hk auto with lia apply rank size preserving in Hk lia Qed Lemma int upper le invert alt k1 k2 int upper IntType Unsigned k1 int upper IntType Signed k2 k1 k2 Proof intros apply rank size reflecting auto using int upper le invert Qed Lemma rank preserving τ i1 τ i2 τ i1 τ i2 rank τ i1 rank τ i2 Proof destruct 1 simpl auto using int upper le invert alt Qed Local Arguments int promote Local Arguments union Local Arguments int union Lemma int promote int si int promote IntType si int rank IntType si int rank Proof simpl rewrite decide True by done destruct si by rewrite decide True by done by rewrite decide False by auto using Zlt not le int upper signed unsigned Qed Lemma int promote promote τ i int promote int promote τ i int promote τ i Proof assert int upper sintT int upper uintT unfold int upper rewrite int precision Unsigned Signed rewrite Nat2Z inj succ Z pow succ r by auto with zpos assert 0 2 int precision sintT by auto with zpos lia destruct τ i as si k simplify option equality auto with lia Qed Lemma int promote typed x τ i int typed x τ i int

    Original URL path: http://robbertkrebbers.nl/research/ch2o/integer_operations.html (2015-08-10)
    Open archived version from archive