mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 09:23:44 +00:00
167 lines
6.7 KiB
Plaintext
167 lines
6.7 KiB
Plaintext
Test list and rev_list
|
|
empty_cord
|
|
[]
|
|
[]
|
|
nonempty_cord(list_node(1, []))
|
|
[1]
|
|
[1]
|
|
nonempty_cord(list_node(2, [3, 4]))
|
|
[2, 3, 4]
|
|
[4, 3, 2]
|
|
nonempty_cord(branch_node(list_node(1, []), list_node(1, [])))
|
|
[1, 1]
|
|
[1, 1]
|
|
nonempty_cord(branch_node(list_node(1, []), list_node(2, [3, 4])))
|
|
[1, 2, 3, 4]
|
|
[4, 3, 2, 1]
|
|
nonempty_cord(branch_node(list_node(1, []), branch_node(list_node(1, []), list_node(1, []))))
|
|
[1, 1, 1]
|
|
[1, 1, 1]
|
|
nonempty_cord(branch_node(list_node(1, []), branch_node(list_node(1, []), list_node(2, [3, 4]))))
|
|
[1, 1, 2, 3, 4]
|
|
[4, 3, 2, 1, 1]
|
|
nonempty_cord(branch_node(list_node(1, []), branch_node(list_node(2, [3, 4]), list_node(1, []))))
|
|
[1, 2, 3, 4, 1]
|
|
[1, 4, 3, 2, 1]
|
|
nonempty_cord(branch_node(list_node(1, []), branch_node(list_node(2, [3, 4]), list_node(2, [3, 4]))))
|
|
[1, 2, 3, 4, 2, 3, 4]
|
|
[4, 3, 2, 4, 3, 2, 1]
|
|
nonempty_cord(branch_node(list_node(2, [3, 4]), list_node(1, [])))
|
|
[2, 3, 4, 1]
|
|
[1, 4, 3, 2]
|
|
nonempty_cord(branch_node(list_node(2, [3, 4]), list_node(2, [3, 4])))
|
|
[2, 3, 4, 2, 3, 4]
|
|
[4, 3, 2, 4, 3, 2]
|
|
nonempty_cord(branch_node(list_node(2, [3, 4]), branch_node(list_node(1, []), list_node(1, []))))
|
|
[2, 3, 4, 1, 1]
|
|
[1, 1, 4, 3, 2]
|
|
nonempty_cord(branch_node(list_node(2, [3, 4]), branch_node(list_node(1, []), list_node(2, [3, 4]))))
|
|
[2, 3, 4, 1, 2, 3, 4]
|
|
[4, 3, 2, 1, 4, 3, 2]
|
|
nonempty_cord(branch_node(list_node(2, [3, 4]), branch_node(list_node(2, [3, 4]), list_node(1, []))))
|
|
[2, 3, 4, 2, 3, 4, 1]
|
|
[1, 4, 3, 2, 4, 3, 2]
|
|
nonempty_cord(branch_node(list_node(2, [3, 4]), branch_node(list_node(2, [3, 4]), list_node(2, [3, 4]))))
|
|
[2, 3, 4, 2, 3, 4, 2, 3, 4]
|
|
[4, 3, 2, 4, 3, 2, 4, 3, 2]
|
|
nonempty_cord(branch_node(branch_node(list_node(1, []), list_node(1, [])), list_node(1, [])))
|
|
[1, 1, 1]
|
|
[1, 1, 1]
|
|
nonempty_cord(branch_node(branch_node(list_node(1, []), list_node(1, [])), list_node(2, [3, 4])))
|
|
[1, 1, 2, 3, 4]
|
|
[4, 3, 2, 1, 1]
|
|
nonempty_cord(branch_node(branch_node(list_node(1, []), list_node(1, [])), branch_node(list_node(1, []), list_node(1, []))))
|
|
[1, 1, 1, 1]
|
|
[1, 1, 1, 1]
|
|
nonempty_cord(branch_node(branch_node(list_node(1, []), list_node(1, [])), branch_node(list_node(1, []), list_node(2, [3, 4]))))
|
|
[1, 1, 1, 2, 3, 4]
|
|
[4, 3, 2, 1, 1, 1]
|
|
nonempty_cord(branch_node(branch_node(list_node(1, []), list_node(1, [])), branch_node(list_node(2, [3, 4]), list_node(1, []))))
|
|
[1, 1, 2, 3, 4, 1]
|
|
[1, 4, 3, 2, 1, 1]
|
|
nonempty_cord(branch_node(branch_node(list_node(1, []), list_node(1, [])), branch_node(list_node(2, [3, 4]), list_node(2, [3, 4]))))
|
|
[1, 1, 2, 3, 4, 2, 3, 4]
|
|
[4, 3, 2, 4, 3, 2, 1, 1]
|
|
nonempty_cord(branch_node(branch_node(list_node(1, []), list_node(2, [3, 4])), list_node(1, [])))
|
|
[1, 2, 3, 4, 1]
|
|
[1, 4, 3, 2, 1]
|
|
nonempty_cord(branch_node(branch_node(list_node(1, []), list_node(2, [3, 4])), list_node(2, [3, 4])))
|
|
[1, 2, 3, 4, 2, 3, 4]
|
|
[4, 3, 2, 4, 3, 2, 1]
|
|
nonempty_cord(branch_node(branch_node(list_node(1, []), list_node(2, [3, 4])), branch_node(list_node(1, []), list_node(1, []))))
|
|
[1, 2, 3, 4, 1, 1]
|
|
[1, 1, 4, 3, 2, 1]
|
|
nonempty_cord(branch_node(branch_node(list_node(1, []), list_node(2, [3, 4])), branch_node(list_node(1, []), list_node(2, [3, 4]))))
|
|
[1, 2, 3, 4, 1, 2, 3, 4]
|
|
[4, 3, 2, 1, 4, 3, 2, 1]
|
|
nonempty_cord(branch_node(branch_node(list_node(1, []), list_node(2, [3, 4])), branch_node(list_node(2, [3, 4]), list_node(1, []))))
|
|
[1, 2, 3, 4, 2, 3, 4, 1]
|
|
[1, 4, 3, 2, 4, 3, 2, 1]
|
|
nonempty_cord(branch_node(branch_node(list_node(1, []), list_node(2, [3, 4])), branch_node(list_node(2, [3, 4]), list_node(2, [3, 4]))))
|
|
[1, 2, 3, 4, 2, 3, 4, 2, 3, 4]
|
|
[4, 3, 2, 4, 3, 2, 4, 3, 2, 1]
|
|
nonempty_cord(branch_node(branch_node(list_node(2, [3, 4]), list_node(1, [])), list_node(1, [])))
|
|
[2, 3, 4, 1, 1]
|
|
[1, 1, 4, 3, 2]
|
|
nonempty_cord(branch_node(branch_node(list_node(2, [3, 4]), list_node(1, [])), list_node(2, [3, 4])))
|
|
[2, 3, 4, 1, 2, 3, 4]
|
|
[4, 3, 2, 1, 4, 3, 2]
|
|
nonempty_cord(branch_node(branch_node(list_node(2, [3, 4]), list_node(1, [])), branch_node(list_node(1, []), list_node(1, []))))
|
|
[2, 3, 4, 1, 1, 1]
|
|
[1, 1, 1, 4, 3, 2]
|
|
nonempty_cord(branch_node(branch_node(list_node(2, [3, 4]), list_node(1, [])), branch_node(list_node(1, []), list_node(2, [3, 4]))))
|
|
[2, 3, 4, 1, 1, 2, 3, 4]
|
|
[4, 3, 2, 1, 1, 4, 3, 2]
|
|
nonempty_cord(branch_node(branch_node(list_node(2, [3, 4]), list_node(1, [])), branch_node(list_node(2, [3, 4]), list_node(1, []))))
|
|
[2, 3, 4, 1, 2, 3, 4, 1]
|
|
[1, 4, 3, 2, 1, 4, 3, 2]
|
|
nonempty_cord(branch_node(branch_node(list_node(2, [3, 4]), list_node(1, [])), branch_node(list_node(2, [3, 4]), list_node(2, [3, 4]))))
|
|
[2, 3, 4, 1, 2, 3, 4, 2, 3, 4]
|
|
[4, 3, 2, 4, 3, 2, 1, 4, 3, 2]
|
|
nonempty_cord(branch_node(branch_node(list_node(2, [3, 4]), list_node(2, [3, 4])), list_node(1, [])))
|
|
[2, 3, 4, 2, 3, 4, 1]
|
|
[1, 4, 3, 2, 4, 3, 2]
|
|
nonempty_cord(branch_node(branch_node(list_node(2, [3, 4]), list_node(2, [3, 4])), list_node(2, [3, 4])))
|
|
[2, 3, 4, 2, 3, 4, 2, 3, 4]
|
|
[4, 3, 2, 4, 3, 2, 4, 3, 2]
|
|
nonempty_cord(branch_node(branch_node(list_node(2, [3, 4]), list_node(2, [3, 4])), branch_node(list_node(1, []), list_node(1, []))))
|
|
[2, 3, 4, 2, 3, 4, 1, 1]
|
|
[1, 1, 4, 3, 2, 4, 3, 2]
|
|
nonempty_cord(branch_node(branch_node(list_node(2, [3, 4]), list_node(2, [3, 4])), branch_node(list_node(1, []), list_node(2, [3, 4]))))
|
|
[2, 3, 4, 2, 3, 4, 1, 2, 3, 4]
|
|
[4, 3, 2, 1, 4, 3, 2, 4, 3, 2]
|
|
nonempty_cord(branch_node(branch_node(list_node(2, [3, 4]), list_node(2, [3, 4])), branch_node(list_node(2, [3, 4]), list_node(1, []))))
|
|
[2, 3, 4, 2, 3, 4, 2, 3, 4, 1]
|
|
[1, 4, 3, 2, 4, 3, 2, 4, 3, 2]
|
|
nonempty_cord(branch_node(branch_node(list_node(2, [3, 4]), list_node(2, [3, 4])), branch_node(list_node(2, [3, 4]), list_node(2, [3, 4]))))
|
|
[2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4]
|
|
[4, 3, 2, 4, 3, 2, 4, 3, 2, 4, 3, 2]
|
|
|
|
Test cons_list
|
|
[111, 222]
|
|
[111, 222, 1]
|
|
[111, 222, 2, 3, 4]
|
|
[111, 222, 1, 1]
|
|
[111, 222, 1, 2, 3, 4]
|
|
[111, 222, 1, 1, 1]
|
|
[111, 222, 1, 1, 2, 3, 4]
|
|
[111, 222, 1, 2, 3, 4, 1]
|
|
[111, 222, 1, 2, 3, 4, 2, 3, 4]
|
|
[111, 222, 2, 3, 4, 1]
|
|
[111, 222, 2, 3, 4, 2, 3, 4]
|
|
[111, 222, 2, 3, 4, 1, 1]
|
|
[111, 222, 2, 3, 4, 1, 2, 3, 4]
|
|
[111, 222, 2, 3, 4, 2, 3, 4, 1]
|
|
[111, 222, 2, 3, 4, 2, 3, 4, 2, 3, 4]
|
|
[111, 222, 1, 1, 1]
|
|
[111, 222, 1, 1, 2, 3, 4]
|
|
[111, 222, 1, 1, 1, 1]
|
|
[111, 222, 1, 1, 1, 2, 3, 4]
|
|
[111, 222, 1, 1, 2, 3, 4, 1]
|
|
[111, 222, 1, 1, 2, 3, 4, 2, 3, 4]
|
|
[111, 222, 1, 2, 3, 4, 1]
|
|
[111, 222, 1, 2, 3, 4, 2, 3, 4]
|
|
[111, 222, 1, 2, 3, 4, 1, 1]
|
|
[111, 222, 1, 2, 3, 4, 1, 2, 3, 4]
|
|
[111, 222, 1, 2, 3, 4, 2, 3, 4, 1]
|
|
[111, 222, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4]
|
|
[111, 222, 2, 3, 4, 1, 1]
|
|
[111, 222, 2, 3, 4, 1, 2, 3, 4]
|
|
[111, 222, 2, 3, 4, 1, 1, 1]
|
|
[111, 222, 2, 3, 4, 1, 1, 2, 3, 4]
|
|
[111, 222, 2, 3, 4, 1, 2, 3, 4, 1]
|
|
[111, 222, 2, 3, 4, 1, 2, 3, 4, 2, 3, 4]
|
|
[111, 222, 2, 3, 4, 2, 3, 4, 1]
|
|
[111, 222, 2, 3, 4, 2, 3, 4, 2, 3, 4]
|
|
[111, 222, 2, 3, 4, 2, 3, 4, 1, 1]
|
|
[111, 222, 2, 3, 4, 2, 3, 4, 1, 2, 3, 4]
|
|
[111, 222, 2, 3, 4, 2, 3, 4, 2, 3, 4, 1]
|
|
[111, 222, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4]
|
|
done.
|
|
|
|
Test folds
|
|
done.
|
|
|
|
Test cord_list_to_cord and cord_list_to_list
|
|
done.
|