Skip to content

Commit

Permalink
Change ite syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin Jamner authored and ivg committed Aug 8, 2018
1 parent 001aecb commit 7a9d451
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bil.ott
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ grammar
{{ com -- bind $e_1$ to $var$ in expression $e_2$}}
| unknown [ string ] : type :: :: unk
{{ com -- unknown or undefined value of a given $type$ }}
| if e1 then e2 else e3 :: :: ite
| ite e1 e2 e3 :: :: ite
{{ com -- evaluates to $e_2$ if $e_1$ is true else to $e_3$ }}
| extract : nat1 : nat2 [ e ] :: :: ext
{{ com -- extract or extend bitvector $e$}}
Expand Down Expand Up @@ -384,7 +384,7 @@ defns typing_exp :: '' ::=
G |- e2 :: t
G |- e3 :: t
-------------------------- :: ite
G |- if e1 then e2 else e3 :: t
G |- ite e1 e2 e3 :: t

G |- e :: imm<sz>
sz1 >= sz2
Expand Down Expand Up @@ -581,26 +581,26 @@ defns reduce_exp :: '' ::=

delta |- e1 ~> e1'
------------------------------------------------------------------ :: ite_step_cond
delta |- if e1 then v2 else v3 ~> if e1' then v2 else v3
delta |- ite e1 v2 v3 ~> ite e1' v2 v3

delta |- e2 ~> e2'
------------------------------------------------------------------ :: ite_step_then
delta |- if e1 then e2 else v3 ~> if e1 then e2' else v3
delta |- ite e1 e2 v3 ~> ite e1 e2' v3

delta |- e3 ~> e3'
------------------------------------------------------------------ :: ite_step_else
delta |- if e1 then e2 else e3 ~> if e1 then e2 else e3'
delta |- ite e1 e2 e3 ~> ite e1 e2 e3'

----------------------------------------------- :: ite_true
delta |- if true then v2 else v3 ~> v2
delta |- ite true v2 v3 ~> v2


------------------------------------------------ :: ite_false
delta |- if false then v2 else v3 ~> v3
delta |- ite false v2 v3 ~> v3

type(v2) = t'
------------------------------------------------------------------ :: ite_unk
delta |- if unknown[str]:t then v2 else v3 ~> unknown[str]:t'
delta |- ite unknown[str]:t v2 v3 ~> unknown[str]:t'

delta |- e2 ~> e2'
------------------------------------------ :: bop_rhs
Expand Down

0 comments on commit 7a9d451

Please sign in to comment.