proof - Solving (BEq a a0 = BTrue \/ BEq a a0 = BFalse) in Coq -


(beq a0 = btrue \/ beq a0 = bfalse) either true or false since a==a0 or a!=a0. however, i'm not sure how can coq see this. here complete proof window:

4 subgoal : aexp a0 : aexp st : state ______________________________________(1/4) (beq a0 = btrue \/ beq a0 = bfalse) \/ (exists b' : bexp, beq a0 / st ==>b b')

any suggestions on how proceed?


definitions:

inductive bexp : type :=     btrue : bexp   | bfalse : bexp   | beq : aexp -> aexp -> bexp   | ble : aexp -> aexp -> bexp   | bnot : bexp -> bexp   | band : bexp -> bexp -> bexp . inductive aexp : type :=     anum : nat -> aexp   | aid : id -> aexp   | aplus : aexp -> aexp -> aexp   | aminus : aexp -> aexp -> aexp   | amult : aexp -> aexp -> aexp .  inductive bstep : state -> bexp -> bexp -> prop :=   | bs_eq : forall st n1 n2,       (beq (anum n1) (anum n2)) / st ==>b        (if (beq_nat n1 n2) btrue else bfalse)   | bs_eq1 : forall st a1 a1' a2,       a1 / st ==>a a1' ->       (beq a1 a2) / st ==>b (beq a1' a2)   | bs_eq2 : forall st v1 a2 a2',       aval v1 ->        a2 / st ==>a a2' ->       (beq v1 a2) / st ==>b (beq v1 a2')   | bs_lteq : forall st n1 n2,       (ble (anum n1) (anum n2)) / st ==>b                 (if (ble_nat n1 n2) btrue else bfalse)   | bs_lteq1 : forall st a1 a1' a2,       a1 / st ==>a a1' ->       (ble a1 a2) / st ==>b (ble a1' a2)   | bs_lteq2 : forall st v1 a2 a2',       aval v1 ->       a2 / st ==>a a2' ->       (ble v1 a2) / st ==>b (ble v1 (a2'))   | bs_nottrue : forall st,       (bnot btrue) / st ==>b bfalse   | bs_notfalse : forall st,       (bnot bfalse) / st ==>b btrue   | bs_notstep : forall st b1 b1',       b1 / st ==>b b1' ->       (bnot b1) / st ==>b (bnot b1')   | bs_andtruetrue : forall st,       (band btrue btrue) / st ==>b btrue   | bs_andtruefalse : forall st,       (band btrue bfalse) / st ==>b bfalse   | bs_andfalse : forall st b2,       (band bfalse b2) / st ==>b bfalse   | bs_andtruestep : forall st b2 b2',       b2 / st ==>b b2' ->       (band btrue b2) / st ==>b (band btrue b2')   | bs_andstep : forall st b1 b1' b2,       b1 / st ==>b b1' ->       (band b1 b2) / st ==>b (band b1' b2)    " t '/' st '==>b' t' " := (bstep st t t'). 

i'm not provable. given proof context:

4 subgoal : aexp a0 : aexp st : state ______________________________________(1/4) (beq a0 = btrue \/ beq a0 = bfalse) \/ (exists b' : bexp, beq a0 / st ==>b b') 

you need able prove @ least 1 disjunct. beq a0 = btrue not provable. beq , btrue 2 different constructors of same type, under coq's equality, never hold. same goes beq a0 = bfalse. in fact, can prove these things not equal:

theorem beqbfalseneq : forall a0, beq a0 <> bfalse. proof.   intros a0 contra. inversion contra.  qed.   theorem beqbtrueneq : forall a0, beq a0 <> btrue. proof.   intros a0 contra. inversion contra.  qed.  

one might think exists b' : bexp, beq a0 / st ==>b b' proven, inducting on a , destructing a0. give bunch of cases, , need show each case can take step, however, inevitably find in case won't able show step can taken. example, if have case a aplus (aid x) (anum 12), , a0 other arbitrary expression, need show possible beq (aplus (aid x) (anum 12)) a0 take step. might think can use bs_eq1 rule, however, have no guarantee aplus (aid x) (anum 12) can take step under ==>a relation, assuming use id, needs in current state. if x not exist in given state, not able take step.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -