British military law derived from two documents, the Articles of War and the Mutiny Act and many of the same provisions were contained in both although the Act had the greater power. There were also the Rules and Regulations for the Army, periodically updated, which the power of making was vested by the Articles and the Act in the Sovereign (actually the Commander in Chief in reality and more likely the Adjutant General). All three sources were fairly clear, at least by 1808 as they did evolve on the proper conduct of soldiers toward civilians.
Neither enlisted men nor officer could plead ignorance of the Articles of War as, by regulation, they had to be read out in full to the troops on parade every two months and commanding officers had to certify that this had been done. Furthermore, regulations specified that any General Orders having to do with conduct and discipline had to be read out to the troops on parade as soon as practicably possible after they were issued. Many of the General Orders on conduct and discipline issued in the Peninsula had to do with the results of courts martial involving the mistreatment of civilians (both friendly and French).
If the soldier then misbehaved, he had really no excuse. If caught in the act, he might be subject to summary punishment and, depending on the gravity of the offence and the need to make a swift example, that could mean being strung up to the nearest tree. More often, he was placed under arrest and court-martialled which, depending on the circumstance (both of the crime and the soldier) might, by 1813 be one of four distinct procedures; Regimental, Garrison, General and Detachment General Courts Martials.
Well, that is British military law as it existed in the Peninsula in a nutshell and there is copious evidence of the application of it in Wellington's dispatches and General Orders.
I would really like to know whether the French army had a similar system of military law and whether it was applied but have given up on that as every time I raise the subject I am deluged by a shower of brickbats, red herrings and curses.
But I am intrigued by the potential uses of algorithms to solve problems where evidence is scarce or entirely lacking in history. See my post on their application.
dg