# Incidence relation trimming.

incid=
!for i=1 to $pointcnt
 l=!line $i of $incipoint
 n=!itemcnt $l
 l_=
 !for j=1 to $n
  t_=!item $j of $l
  !distribute word $t_ into c1,c2
  !if ($c1=l and $c2<=$linecnt) or ($c1=c and $c2<=$circlecnt)
   l_=!append item $t_ to $l_
  !endif
 !next j
 incid=!append line $ $l_ to $incid
!next i
incipoint=$incid

incid=
!for i=1 to $linecnt
 l=!line $i of $inciline
 n=!itemcnt $l
 l_=
 !for j=1 to $n
  t_=!item $j of $l
  !if $t_<=$pointcnt
   l_=!append item $t_ to $l_
  !endif
 !next j
 incid=!append line $ $l_ to $incid
!next i
inciline=$incid

incid=
!for i=1 to $circlecnt
 l=!line $i of $incicircle
 n=!itemcnt $l
 l_=
 !for j=1 to $n
  t_=!item $j of $l
  !if $t_<=$pointcnt
   l_=!append item $ $t_ to $l_
  !endif
 !next j
 incid=!append line $l_ to $incid
!next i
incicircle=$incid
stepcnt=$step

!for i=1 to $goalcnt
 g=!item $i of $goalready
 !if $g>$step
  goalready=!replace item number $i by 0 in $goalready
 !endif
!next i

