// the product basis a x b. public ProofBasis(ProofBasis a, ProofBasis b) { var productPremises = new List <Expression>(); productPremises.AddRange(a.Premises); foreach (var bPremise in b.Premises) { productPremises.Add(bPremise.Substitute(a.Substitution)); } var productSubstitution = Compose(a.Substitution, b.Substitution); Premises = productPremises; Substitution = productSubstitution; }
public override bool Equals(object o) { if (!(o is ProofBasis)) { return(false); } ProofBasis that = o as ProofBasis; if (this.Premises.Count != that.Premises.Count) { return(false); } for (int i = 0; i < Premises.Count; i++) { if (!this.Premises[i].Equals(that.Premises[i])) { return(false); } } if (this.Substitution.Count != that.Substitution.Count) { return(false); } foreach (var assignment in this.Substitution.Keys) { if (!that.Substitution.ContainsKey(assignment)) { return(false); } if (!this.Substitution[assignment].Equals(that.Substitution[assignment])) { return(false); } } return(true); }
public void Add(ProofBasis basis) { ProofBasisCollection.Add(basis); }
public bool Contains(ProofBasis basis) { return(ProofBasisCollection.Contains(basis)); }