Nuprl Definition : combine-skips

combine-skips(as;bs;n) ==
  if null(bs) then []
  if null(as) then []
  else if hd(bs)=0
       then [n + hd(as) / combine-skips(tl(as);tl(bs);0)]
       else combine-skips(tl(as);[hd(bs) - 1 / tl(bs)];(n + 1) + hd(as))
  fi 



Definitions occuring in Statement :  null: null(as),  tl: tl(l),  hd: hd(l),  cons: [a / b],  nil: [],  ifthenelse: if b then t else f fi ,  int_eq: if a=b then c else d,  subtract: n - m,  add: n + m,  natural_number: $n
Definitions occuring in definition :  ifthenelse: if b then t else f fi ,  null: null(as),  nil: [],  int_eq: if a=b then c else d,  cons: [a / b],  subtract: n - m,  tl: tl(l),  add: n + m,  natural_number: $n,  hd: hd(l)
FDL editor aliases :  combine-skips

Latex:
combine-skips(as;bs;n)  ==
    if  null(bs)  then  []
    if  null(as)  then  []
    else  if  hd(bs)=0
              then  [n  +  hd(as)  /  combine-skips(tl(as);tl(bs);0)]
              else  combine-skips(tl(as);[hd(bs)  -  1  /  tl(bs)];(n  +  1)  +  hd(as))
    fi 



Date html generated: 2019_06_20-PM-01_21_06
Last ObjectModification: 2018_12_07-PM-03_43_08

Theory : list_1


Home Index