Even both Xiangqi (Chinese chess) and chess are considered to have the same origin and similar playing style, Xiangqi has a very difficult rule set for both understanding and implementing fully to judge games when repetitions happen. This paper introduces an algorithm to implement completely the rule set of Asian Xiangqi Federation (AXF Rules) and some discussions about a few controversial cases of illustrational games.
Horng, W.B. & Hsu, Y.T. (2006). Analysis of the Chinese Chess Rules with Logic and a Real-Time Chinese Chess Computer Judgment System Implementation. Airiti library.