previous up next
Go backward to Order Predicates
Go up to Top
Go forward to Difference
RISC-Linz logo

Logic Evaluator

pred N(x) <=> Nat(x);

fun N0 = 0;
fun '(x: N) = +(x, 1);
fun ^-(x: N) = such(n in nat(0, x): =(x, '(n)), n);

fun N1 = '(N0);
fun N2 = '(N1);

fun +N(x: N, y: N) recursive y =
  if(=(y, N0), x, '(+N(x, ^-(y))));
fun *N(x: N, y: N) recursive y =
  if(=(y, N0), N0, +N(x, *N(x, ^-(y))));
pred <=N(x: N, y: N) recursive y <=>
  if(=(x, N0), true, if(=(y, N0), false, <=N(^-(x), ^-(y))));

Author: Wolfgang Schreiner
Last Modification: November 16, 1999

previous up next