version	U12.1.00
uid	trees.u1-1786291389-0
impl	error
global	7
	0,000005,depth,1
	1,000005,ldag,2
	2,000005,ltree,1
	3,000005,stree,1
	4,000005,tcopy,1
	5,000005,teq,2
	6,000005,visit,1

proc depth
	local	0,001000,ltree
	local	1,000020,count
	local	2,000000,depth
	con	0,002000,1,0
	con	1,002000,1,1
	con	2,002000,1,2
	declend
	filen	trees.icn
	line	33
	colm	11
	synt	any
	mark	L1
	pnull
	var	1
	int	0
	line	36
	colm	10
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	line	37
	colm	4
	synt	every
	mark0
	pnull
	var	1
	dup
	pnull
	int	1
	var	2
	pnull
	var	0
	pnull
	int	2
	pnull
	var	0
	line	37
	colm	41
	synt	any
	size
	push1
	line	37
	colm	38
	synt	any
	toby
	line	37
	colm	35
	synt	any
	subsc
	line	37
	colm	29
	synt	any
	invoke	1
	line	37
	colm	22
	synt	any
	plus
	line	37
	colm	16
	synt	any
	numlt
	asgn
	pop
lab L3
	efail
lab L4
	line	37
	colm	4
	synt	endevery
	unmark
lab L2
	mark	L5
	mark	L6
	var	1
	line	38
	colm	4
	synt	any
	pret
lab L6
	synt	any
	pfail
	unmark
lab L5
	pnull
	line	40
	colm	1
	synt	any
	pfail
	end
proc ldag
	local	0,001000,stree
	local	1,001000,done
	local	2,000020,L
	local	3,000000,table
	local	4,000000,tab
	local	5,000000,upto
	local	6,000000,move
	local	7,000000,put
	local	8,000000,ldag
	local	9,000000,bal
	con	0,020000,1,050
	con	1,002000,1,1
	con	2,020000,2,054,051
	con	3,002000,1,0
	declend
	line	42
	colm	11
	synt	any
	mark	L1
	pnull
	pnull
	var	1
	line	45
	colm	4
	synt	any
	null
	var	3
	line	45
	colm	18
	synt	any
	invoke	0
	line	45
	colm	10
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	line	46
	colm	4
	synt	if
	mark0
	pnull
	var	2
	pnull
	pnull
	var	1
	var	0
	line	46
	colm	17
	synt	any
	subsc
	line	46
	colm	12
	synt	any
	nonnull
	line	46
	colm	9
	synt	any
	asgn
	unmark
	mark	L3
	var	2
	line	46
	colm	30
	synt	any
	pret
lab L3
	synt	any
	pfail
	line	46
	colm	4
	synt	endif
	unmark
lab L2
	mark	L4
	var	0
	line	47
	colm	10
	synt	any
	bscan
	line	48
	colm	7
	synt	ifelse
	mark	L5
	pnull
	var	2
	pnull
	var	4
	var	5
	cset	0
	line	48
	colm	24
	synt	any
	invoke	1
	line	48
	colm	19
	synt	any
	invoke	1
	line	48
	colm	15
	synt	any
	llist	1
	line	48
	colm	12
	synt	any
	asgn
	unmark
	mark	L7
	var	6
	int	1
	line	49
	colm	14
	synt	any
	invoke	1
	unmark
lab L7
lab L8
	line	50
	colm	10
	synt	while
	mark0
	var	7
	var	2
	var	8
	var	4
	var	9
	cset	2
	line	50
	colm	34
	synt	any
	invoke	1
	line	50
	colm	30
	synt	any
	invoke	1
	var	1
	line	50
	colm	26
	synt	any
	invoke	2
	line	50
	colm	19
	synt	any
	invoke	2
	unmark
	mark	L8
	var	6
	int	1
	line	51
	colm	17
	synt	any
	invoke	1
lab L9
	unmark
	goto	L8
lab L10
	line	50
	colm	10
	synt	endwhile
	goto	L6
lab L5
	pnull
	var	2
	pnull
	var	4
	int	3
	line	53
	colm	21
	synt	any
	invoke	1
	line	53
	colm	17
	synt	any
	llist	1
	line	53
	colm	14
	synt	any
	asgn
lab L6
	line	48
	colm	7
	synt	endifelse
	line	47
	colm	10
	synt	any
	escan
	unmark
lab L4
	mark	L11
	mark	L12
	pnull
	pnull
	var	1
	var	0
	line	54
	colm	15
	synt	any
	subsc
	var	2
	line	54
	colm	23
	synt	any
	asgn
	line	54
	colm	4
	synt	any
	pret
lab L12
	synt	any
	pfail
	unmark
lab L11
	pnull
	line	56
	colm	1
	synt	any
	pfail
	end
proc ltree
	local	0,001000,stree
	local	1,000020,L
	local	2,000000,tab
	local	3,000000,upto
	local	4,000000,move
	local	5,000000,put
	local	6,000000,ltree
	local	7,000000,bal
	con	0,020000,1,050
	con	1,002000,1,1
	con	2,020000,2,054,051
	con	3,002000,1,0
	declend
	line	58
	colm	11
	synt	any
	mark	L1
	var	0
	line	61
	colm	10
	synt	any
	bscan
	line	62
	colm	7
	synt	ifelse
	mark	L2
	pnull
	var	1
	pnull
	var	2
	var	3
	cset	0
	line	62
	colm	24
	synt	any
	invoke	1
	line	62
	colm	19
	synt	any
	invoke	1
	line	62
	colm	15
	synt	any
	llist	1
	line	62
	colm	12
	synt	any
	asgn
	unmark
	mark	L4
	var	4
	int	1
	line	63
	colm	14
	synt	any
	invoke	1
	unmark
lab L4
lab L5
	line	64
	colm	10
	synt	while
	mark0
	var	5
	var	1
	var	6
	var	2
	var	7
	cset	2
	line	64
	colm	35
	synt	any
	invoke	1
	line	64
	colm	31
	synt	any
	invoke	1
	line	64
	colm	27
	synt	any
	invoke	1
	line	64
	colm	19
	synt	any
	invoke	2
	unmark
	mark	L5
	var	4
	int	1
	line	65
	colm	17
	synt	any
	invoke	1
lab L6
	unmark
	goto	L5
lab L7
	line	64
	colm	10
	synt	endwhile
	goto	L3
lab L2
	pnull
	var	1
	pnull
	var	2
	int	3
	line	67
	colm	21
	synt	any
	invoke	1
	line	67
	colm	17
	synt	any
	llist	1
	line	67
	colm	14
	synt	any
	asgn
lab L3
	line	62
	colm	7
	synt	endifelse
	line	61
	colm	10
	synt	any
	escan
	unmark
lab L1
	mark	L8
	mark	L9
	var	1
	line	68
	colm	4
	synt	any
	pret
lab L9
	synt	any
	pfail
	unmark
lab L8
	pnull
	line	70
	colm	1
	synt	any
	pfail
	end
proc stree
	local	0,001000,ltree
	local	1,000020,s
	local	2,000000,stree
	con	0,002000,1,1
	con	1,010000,1,050
	con	2,002000,1,2
	con	3,010000,1,054
	con	4,010000,1,051
	declend
	line	72
	colm	11
	synt	any
	mark	L1
	line	75
	colm	4
	synt	if
	mark0
	pnull
	pnull
	var	0
	line	75
	colm	7
	synt	any
	size
	int	0
	line	75
	colm	14
	synt	any
	numeq
	unmark
	mark	L2
	pnull
	var	0
	int	0
	line	75
	colm	35
	synt	any
	subsc
	line	75
	colm	23
	synt	any
	pret
lab L2
	synt	any
	pfail
	line	75
	colm	4
	synt	endif
	unmark
lab L1
	mark	L3
	pnull
	var	1
	pnull
	pnull
	var	0
	int	0
	line	76
	colm	14
	synt	any
	subsc
	str	1
	line	76
	colm	18
	synt	any
	cat
	line	76
	colm	6
	synt	any
	asgn
	unmark
lab L3
	mark	L4
	line	77
	colm	4
	synt	every
	mark0
	pnull
	var	1
	dup
	pnull
	var	2
	pnull
	var	0
	pnull
	int	2
	pnull
	var	0
	line	77
	colm	34
	synt	any
	size
	push1
	line	77
	colm	31
	synt	any
	toby
	line	77
	colm	28
	synt	any
	subsc
	line	77
	colm	22
	synt	any
	invoke	1
	str	3
	line	77
	colm	43
	synt	any
	cat
	line	77
	colm	12
	synt	any
	cat
	asgn
	pop
lab L5
	efail
lab L6
	line	77
	colm	4
	synt	endevery
	unmark
lab L4
	mark	L7
	mark	L8
	pnull
	pnull
	var	1
	int	0
	pnull
	int	0
	line	78
	colm	15
	synt	any
	neg
	line	78
	colm	14
	synt	any
	synt	any
	sect
	str	4
	line	78
	colm	19
	synt	any
	cat
	line	78
	colm	4
	synt	any
	pret
lab L8
	synt	any
	pfail
	unmark
lab L7
	pnull
	line	80
	colm	1
	synt	any
	pfail
	end
proc tcopy
	local	0,001000,ltree
	local	1,000020,L
	local	2,000000,put
	local	3,000000,tcopy
	con	0,002000,1,1
	con	1,002000,1,2
	declend
	line	82
	colm	11
	synt	any
	mark	L1
	pnull
	var	1
	pnull
	pnull
	var	0
	int	0
	line	85
	colm	15
	synt	any
	subsc
	line	85
	colm	9
	synt	any
	llist	1
	line	85
	colm	6
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	line	86
	colm	4
	synt	every
	mark0
	var	2
	var	1
	var	3
	pnull
	var	0
	pnull
	int	1
	pnull
	var	0
	line	86
	colm	33
	synt	any
	size
	push1
	line	86
	colm	30
	synt	any
	toby
	line	86
	colm	27
	synt	any
	subsc
	line	86
	colm	21
	synt	any
	invoke	1
	line	86
	colm	13
	synt	any
	invoke	2
	pop
lab L3
	efail
lab L4
	line	86
	colm	4
	synt	endevery
	unmark
lab L2
	mark	L5
	mark	L6
	var	1
	line	87
	colm	4
	synt	any
	pret
lab L6
	synt	any
	pfail
	unmark
lab L5
	pnull
	line	89
	colm	1
	synt	any
	pfail
	end
proc teq
	local	0,001000,L1
	local	1,001000,L2
	local	2,000020,i
	local	3,000000,teq
	con	0,002000,1,1
	con	1,002000,1,2
	declend
	line	91
	colm	11
	synt	any
	mark	L1
	line	94
	colm	4
	synt	if
	mark0
	pnull
	pnull
	var	0
	line	94
	colm	7
	synt	any
	size
	pnull
	var	1
	line	94
	colm	14
	synt	any
	size
	line	94
	colm	11
	synt	any
	numne
	unmark
	line	94
	colm	23
	synt	any
	pfail
	line	94
	colm	4
	synt	endif
	unmark
lab L1
	mark	L2
	line	95
	colm	4
	synt	if
	mark0
	pnull
	pnull
	var	0
	int	0
	line	95
	colm	9
	synt	any
	subsc
	pnull
	var	1
	int	0
	line	95
	colm	19
	synt	any
	subsc
	line	95
	colm	13
	synt	any
	lexne
	unmark
	line	95
	colm	28
	synt	any
	pfail
	line	95
	colm	4
	synt	endif
	unmark
lab L2
	mark	L3
	line	96
	colm	4
	synt	every
	mark0
	pnull
	var	2
	pnull
	int	1
	pnull
	var	0
	line	96
	colm	20
	synt	any
	size
	push1
	line	96
	colm	17
	synt	any
	toby
	line	96
	colm	12
	synt	any
	asgn
	pop
	mark0
	line	97
	colm	7
	synt	if
	mark0
	mark	L6
	var	3
	pnull
	var	0
	var	2
	line	97
	colm	20
	synt	any
	subsc
	pnull
	var	1
	var	2
	line	97
	colm	26
	synt	any
	subsc
	line	97
	colm	17
	synt	any
	invoke	2
	unmark
	efail
lab L6
	pnull
	unmark
	line	97
	colm	36
	synt	any
	pfail
	line	97
	colm	7
	synt	endif
	unmark
lab L4
	efail
lab L5
	line	96
	colm	4
	synt	endevery
	unmark
lab L3
	mark	L7
	mark	L8
	var	1
	line	98
	colm	4
	synt	any
	pret
lab L8
	synt	any
	pfail
	unmark
lab L7
	pnull
	line	100
	colm	1
	synt	any
	pfail
	end
proc visit
	local	0,001000,ltree
	local	1,000000,visit
	con	0,002000,1,2
	declend
	line	102
	colm	11
	synt	any
	mark	L1
	line	104
	colm	4
	synt	suspend
	mark0
	mark	L4
	var	0
	line	104
	colm	18
	synt	any
	esusp
	goto	L5
lab L4
	var	1
	pnull
	var	0
	pnull
	int	0
	pnull
	var	0
	line	104
	colm	37
	synt	any
	size
	push1
	line	104
	colm	34
	synt	any
	toby
	line	104
	colm	31
	synt	any
	subsc
	line	104
	colm	25
	synt	any
	invoke	1
lab L5
	line	104
	colm	4
	synt	any
	psusp
	pop
lab L2
	efail
lab L3
	line	104
	colm	4
	synt	endsuspend
	unmark
lab L1
	pnull
	line	106
	colm	1
	synt	any
	pfail
	end
