IFC Step 1

Task: Copy the contents of boolean variables h1, h2, h3, h4, h5, h6 to l1, l2, l3, l4, l5, l6, respectively.

Write in your program in the text area below, satisfying the following type system. After running a well typed program, you will get a list of all low variables and their values.

A variable is high if its name starts with the letter "h", otherwise it is low.

The program will be run twice with fresh random secrets every time. Both runs must leak successfully.


Type system

(If you don't know inference rules, or they are too confusing, see the note below.)

Note: Any syntactically valid program is accepted.


<program> ::= <stms>

    <stm> ::= skip;                            (a statement with no effect)
           |  x = <expr>;                      (assignment)
           |  { <stm> ... }                    (block statement)
           |  if (<expr>) then <stm> else <stm>  (a conditional statement)
           |  while (<expr>) <stm>             (a loop statement)

   <expr> ::= true | false                     (boolean literals)
           |  <expr> && <expr>                 (boolean and)
           |  <expr> || <expr>                 (boolean or)
           |  ! <expr>                         (boolean negation)
           |  x                                (boolean variable)