
Require Import JsCommon JsCommonAux JsPrettyInterm JsPrettyIntermAux JsSyntaxInfos JsPrettyRules.

Definition one := JsNumber.one.
Definition two := JsNumber.add one one.

Definition one_plus_one :=
  expr_binary_op
    (expr_literal (literal_number one))
    binary_op_add
    (expr_literal (literal_number one)).

Lemma one_plus_one_exec : forall S C,
  red_expr S C one_plus_one (out_ter S (prim_number two)).
Proof.
  (* FILL IN HERE *)
Qed.

Definition while_true_break :=
  stat_while (label_empty :: nil) (expr_literal (literal_bool true)) (stat_break (label_empty)).

Lemma while_true_break_exec : forall S C,
  red_stat S C while_true_break (out_ter S resvalue_empty).
Proof.
  (* FILL IN HERE *)
Qed.

Require Import JsPrettyCoRules.

Definition while_true :=
  stat_while (label_empty :: nil) (expr_literal (literal_bool true)) (stat_block nil).

Lemma while_true_loops : forall S C, red_stat S C while_true out_div.
Proof.
  intros S C. unfold while_true. apply red_stat_while. cofix R. 
  (* FILL IN HERE, only using [apply]. *)
Qed.
