reaction_rules.plt 463 Bytes
Newer Older
Thierry Martinez's avatar
Thierry Martinez committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
:- use_module(library(plunit)).


:- begin_tests(reaction_rules).


test(
  'patch_arithmetic_expression',
  [Patched == (if a then (if b then c else d) else (if e then f else g))]
) :-
  patch_arithmetic_expression(
    if a then
      if b then c else d
    else
      if e then f else g,
    Patched
  ).

test(
  'patch_solution',
  [Patched == a * (b-c-d) + e * (f-g-h)]
) :-
  patch_solution(a * b-c-d + e * f-g-h, Patched).


:- end_tests(reaction_rules).