The calling code:
using System.Collections.Generic;
namespace PGP.Poetry
{
class Program
{
static void Main(string[] args)
{
// See Source Code Poetry: Genesis 1:1 for more on creating a God
//
USConstitution.Creator NaturesGodProvidence = new USConstitution.Creator();
// Create a Constitution
USConstitution.IConstitution UnitedStatesOfAmerica = new USConstitution.Government();
// Form some States
USConstitution.State Delaware = new USConstitution.State { Name = "Delaware", IsAmerican = true, IsUnited = true, ThePeople = new List(), PopulationCount = 60000 };
USConstitution.State Pennsylvania = new USConstitution.State { Name = "Pennsylvania", IsAmerican = true, IsUnited = true, ThePeople = new List(), PopulationCount = 434000 };
USConstitution.State NewJersey = new USConstitution.State { Name = "New Jersey", IsAmerican = true, IsUnited = true, ThePeople = new List(), PopulationCount = 184000 };
USConstitution.State Georgia = new USConstitution.State { Name = "Georgia", IsAmerican = true, IsUnited = true, ThePeople = new List(), PopulationCount = 83000 };
USConstitution.State Connecticut = new USConstitution.State { Name = "Connecticut", IsAmerican = true, IsUnited = true, ThePeople = new List(), PopulationCount = 238000 };
USConstitution.State Massachusetts = new USConstitution.State { Name = "Massachusetts", IsAmerican = true, IsUnited = true, ThePeople = new List(), PopulationCount = 475000 };
USConstitution.State Maryland = new USConstitution.State { Name = "Maryland", IsAmerican = true, IsUnited = true, ThePeople = new List(), PopulationCount = 320000 };
USConstitution.State SouthCarolina = new USConstitution.State { Name = "South Carolina", IsAmerican = true, IsUnited = true, ThePeople = new List(), PopulationCount = 250000 };
USConstitution.State NewHampshire = new USConstitution.State { Name = "New Hampshire", IsAmerican = true, IsUnited = true, ThePeople = new List(), PopulationCount = 142000 };
USConstitution.State Virginia = new USConstitution.State { Name = "Virginia", IsAmerican = true, IsUnited = true, ThePeople = new List(), PopulationCount = 821000 };
USConstitution.State NewYork = new USConstitution.State { Name = "New York", IsAmerican = true, IsUnited = true, ThePeople = new List(), PopulationCount = 340000 };
USConstitution.State NorthCarolina = new USConstitution.State { Name = "North Carolina", IsAmerican = true, IsUnited = true, ThePeople = new List(), PopulationCount = 429000 };
USConstitution.State RhodeIsland = new USConstitution.State { Name = "Rhode Island", IsAmerican = true, IsUnited = true, ThePeople = new List(), PopulationCount = 69000 };
// Add the original 13 states to the union.
UnitedStatesOfAmerica.States.Add(Delaware);
UnitedStatesOfAmerica.States.Add(Pennsylvania);
UnitedStatesOfAmerica.States.Add(NewJersey);
UnitedStatesOfAmerica.States.Add(Georgia);
UnitedStatesOfAmerica.States.Add(Connecticut);
UnitedStatesOfAmerica.States.Add(Massachusetts);
UnitedStatesOfAmerica.States.Add(SouthCarolina);
UnitedStatesOfAmerica.States.Add(NewHampshire);
UnitedStatesOfAmerica.States.Add(Virginia);
UnitedStatesOfAmerica.States.Add(NewYork);
UnitedStatesOfAmerica.States.Add(NorthCarolina);
UnitedStatesOfAmerica.States.Add(RhodeIsland);
UnitedStatesOfAmerica.States.ForEach(s =>
{
// Create ThePeople (in each state)
for (int i = 0; i <s>
{
p.Ordain(UnitedStatesOfAmerica);
p.Establish(UnitedStatesOfAmerica);
});
}
);
// Prudence, indeed, will dictate that Governments long established
// should not be changed for light and transient causes; and accordingly
// all experience hath shewn, that mankind are more disposed to suffer,
// while evils are sufferable, than to right themselves by abolishing
// the forms to which they are accustomed.
while (UnitedStatesOfAmerica.Evils.AreSufferable)
{
// We the People of the United States, in Order to form a more perfect Union, establish Justice,
// insure domestic Tranquility, provide for the common defence, promote the general Welfare, and
// secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this
// Constitution for the United States of America.
UnitedStatesOfAmerica.FormAMorePerfectUnion();
UnitedStatesOfAmerica.EstablishJustice();
UnitedStatesOfAmerica.InsureDomesticTranquility();
UnitedStatesOfAmerica.ProvideForTheCommonDefense();
UnitedStatesOfAmerica.PromoteTheGeneralWelfare();
UnitedStatesOfAmerica.SecureTheBlessingsOfLiberty();
// We hold these truths to be self-evident, that all men are created equal, that they are endowed
// by their Creator with certain unalienable Rights, that among these are Life, Liberty and the
// pursuit of Happiness.--That to secure these rights, Governments are instituted among Men,
// deriving their just powers from the consent of the governed,
UnitedStatesOfAmerica.States.ForEach(s =>
{
s.ThePeople.ForEach(p =>
{
p.Rights.ForEach(w => p.Exercise(unalienableRight: w));
}); ;
}
);
}
}
}
}
Some underlying classes:
using System.Collections.Generic;
namespace PGP.Poetry.USConstitution
{
public interface IConstitution
{
// We the People of the United States,
// in Order to form a more perfect Union,
// establish Justice,
// insure domestic Tranquility,
// provide for the common defence,
// promote the general Welfare, and
// secure the Blessings of Liberty to ourselves and our Posterity,
// do ordain and establish this Constitution for the United States of America.
List States { get; }
void EstablishJustice();
void InsureDomesticTranquility();
void ProvideForTheCommonDefense();
void PromoteTheGeneralWelfare();
void SecureTheBlessingsOfLiberty();
void FormAMorePerfectUnion();
Evils Evils { get; set; }
}
///
/// Prudence, indeed, will dictate that Governments long established
/// should not be changed for light and transient causes; and accordingly
/// all experience hath shewn, that mankind are more disposed to suffer,
/// while evils are sufferable, than to right themselves by abolishing
/// the forms to which they are accustomed.
///
public class Evils
{
public bool AreSufferable { get; }
}
///
/// and to assume among the powers of the earth, the separate and equal station to which the Laws of Nature and of Nature's God entitle them,
///
/// ...with a firm reliance on the protection of divine Providence, we mutually pledge to each other our Lives, our Fortunes and our sacred Honor.
///
public class Creator
{
public class PersonFactory
{
public Person CreatePerson()
{
Person returnValue = new Person
{
// Endow each person with certain unailabale rights
Rights = new List
{
new Right{ Name = "Life", IsUnalienable = true },
new Right{ Name = "Liberty", IsUnalienable = true },
new Right{ Name = "Persuit of Happiness", IsUnalienable = true }
}
};
return returnValue;
}
}
public Creator.PersonFactory Factory { get; set; }
public Creator()
{
this.Factory = new Creator.PersonFactory();
}
}
///
/// Governments are instituted among Men, deriving their just powers from the consent of the governed,
///
public class Government : IConstitution
{
public Evils Evils { get; set; }
public List States { get; }
public Government()
{
States = new List();
}
public void FormAMorePerfectUnion() { }
public void EstablishJustice(){ }
public void InsureDomesticTranquility(){ }
public void ProvideForTheCommonDefense(){ }
public void PromoteTheGeneralWelfare(){ }
public void SecureTheBlessingsOfLiberty(){ }
}
public class Person
{
public List Rights { get; set; }
///
/// Middle English ordeinen, from Anglo-French ordener, ordeiner, from Late
/// Latin ordinare, from Latin, to put in order, appoint, from ordin-, ordo order
/// https://www.merriam-webster.com/dictionary/ordain
///
///
public bool Ordain(object target)
{
return true;
}
public void Establish(object target)
{
}
public void Exercise(Right unalienableRight)
{
}
}
public class Right
{
public bool IsUnalienable { get; set; }
public string Name { get; set; }
}
public class State
{
public bool IsAmerican { get; set; }
public bool IsUnited { get; set; }
public string Name { get; set; }
public int PopulationCount { get; set; }
public List ThePeople { get; set; }
}
//public class America
//{
//}
}
ReadMe
PGP.Poetry\PGP.Poetry\USConstitution\ReadMe.txt
2018/06/16 PGP [Paul Guernsey Player]
This is a project to demonstrate the Preamble to the U.S. Constitution in code.
______
Things I Learned*
Who Ordains? Who Establishes?
One of the first things that I learned while doing this project is Ordaining and Establishing the Constitution. I had originally placed these methods [verbs] in the Preamble class, itself. Should there even be a Preamble class? Not sure yet, but its text clearly states who is doing these actions, so I moved the methods to the Person class.
Another thing I learned, or had to decide the proper position of People in the hierarchy of things. So far, a State has People. So far.
God figures prominently in this story. Had to go back to the Declaration of Independence to get the proper perspective. Given this, what type of God is the Declaration’s Creator? Under what authority did the framers seek “the separate and equal station” among Free and Independent States? And here we find the Declaration and the Preamble in complete accord. The Representatives “in the Name, and by Authority of the good People of these Colonies” publish and declare…We the People do these things. How do I model this in code? What properties do the people possess who can make such a Declaration? Whence do a government’s Just Powers derive?
______
*”Learned” may be too strong a word. I know these things, but doing a demonstration can CEMENT concepts in a way that had been missing before the exercise.