Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProofData"/> class.
 /// </summary>
 /// <param name="proofBuilder">The proof builder that builds actual <see cref="TheoremProof"/> instances.</param>
 /// <param name="inferenceData">The data explaining a theorem inference.</param>
 /// <param name="assumptions">The assumptions of a theorem inference.</param>
 public ProofData(TheoremProofBuilder proofBuilder, TheoremInferenceData inferenceData, IReadOnlyList <Theorem> assumptions)
 {
     ProofBuilder  = proofBuilder ?? throw new ArgumentNullException(nameof(proofBuilder));
     InferenceData = inferenceData ?? throw new ArgumentNullException(nameof(inferenceData));
     Assumptions   = assumptions ?? throw new ArgumentNullException(nameof(assumptions));
 }
Exemplo n.º 2
0
        /// <summary>
        /// Handles a new object by commuting it with the scheduler and finding its trivial theorems and passing those to be handled
        /// by the normalization helper and scheduler.
        /// </summary>
        /// <param name="newObject">The new object to be handled.</param>
        /// <param name="helper">The normalization helper used later for the trivial theorems of the object.</param>
        /// <param name="scheduler">The scheduler of inference rules used for the new object and later for its trivial theorems.</param>
        /// <param name="builder">Either the builder to build theorem proofs; or null, if we are not constructing proofs.</param>
        private void HandleNewObject(ConstructedConfigurationObject newObject, NormalizationHelper helper, Scheduler scheduler, TheoremProofBuilder builder)
        {
            // Schedule after finding this object
            scheduler.ScheduleAfterDiscoveringObject(newObject);

            // Look for its trivial theorems
            foreach (var trivialTheorem in _producer.InferTrivialTheoremsFromObject(newObject))
            {
                // Prepare the proof data in case we need to construct proofs
                var proofData = builder != null ? new ProofData(builder, new TheoremInferenceData(TrivialTheorem), assumptions: Array.Empty <Theorem>()) : null;

                // Let the other method handle this theorem, while ignoring whether it is geometrically valid (it just should be)
                HandleNonequality(trivialTheorem, helper, scheduler, proofData, out var _);
            }
        }