Skip to content

Releases: sdcondon/SCFirstOrderLogic

7.0.1

22 Nov 22:18
Compare
Choose a tag to compare

Oops. Major FeatureVectorIndex.GetSubsumed performance fix - it was essentially just iterating all content looking for subsumed clauses due to a careless typo - sorry!

Also added MakeFeatureComparer overloads that use Comparer.Default for both of the features included in the lib.

7.0.0

20 Oct 10:46
Compare
Choose a tag to compare

Quite a substantial one. Apologies for any annoyance caused by the breaking changes, but I hope you'll agree that the overall structure of the library is markedly improved. Also hope you'll agree that the addition of feature vector index implementations is a fairly big deal - consider it an attempt to make up for all the breaking stuff..

Changes compared to 6.0.0:

  • BREAKING: Removed Constant type from the model. There has never been any real need for it - a constant is just a function with arity zero. Now that parsing and formatting are configurable with regards to the inclusion or not of brackets for zero arity functions, there really is no excuse not to get rid of this.
  • BREAKING: significant re-organisation of sentence manipulation logic. Two motivations here. First, to tidy up the SentenceManipulation namespace, by moving concrete manipulation classes downward into one of two sub-namespaces (Normalisation and VariableManipulation), leaving just the abstractions in SentenceManipulation itself. Second, to push the specifics of our CNF conversion logic (notably, the standardised variable and Skolem function identifier types) downward, so that they don't pollute our model. The CNFSentence and CNFClause types should be usable without needing to also use our conversion logic. If consumers want to normalise using their own logic/identifiers, that should be doable without confusion. Specifics:
    • SkolemFunctionIdentifier and StandardisedVariableIdentifier moved from SCFirstOrderLogic to new SCFirstOrderLogic.SentenceManipulation.Normalisation namespace.
    • CNFExplainer moved from SentenceFormatting to Normalisation namespace.
    • CNFInspector moved from SentenceManipulation to Normalisation namespace.
    • CNFClause.Restandardise method removed, replaced by extension method in new NormalisationExtensions class in Normalisation namespace.
    • ToCNF method removed from Sentence class, replaced by extension method in NormalisationExtensions.
    • CNFClause unification extension methods moved from SentenceManipulation.Unification to a new VariableManipulationExtensions class in a new SentenceManipulation.VariableManipulation namespace.
    • VariableSubstitution and MutableVariableSubstitution moved from SentenceManipulation to VariableManipulation namespace.
    • Unifier moved from SentenceManipulation.Unification to VariableManipulation namespace.
    • CNFSentence's Sentence-accepting ctor changed so that it no longer converts to CNF for you - it expects the sentence to already be a conjunction of disjunctions of literals.
  • Added a couple of feature vector index implementations (one synchronous, one asynchronous) to a new ClauseIndexing namespace. As with the term indexing types, there are node abstractions here to allow you to bring your own backing store, but the only node implementations provided by the library just store things in memory.
  • Optional ctor parameter added to SentenceFormatter - a delegate for controlling whether brackets should be included for zero arity functions with a given identifier. Defaults to always including them.
  • Added some extension methods for Terms to VariableManipulationExtensions class in the SentenceManipulation.VariableManipulation namespace. Specifically, added IsInstanceOf(Term), IsGeneralisationOf(Term), Ordinalise(Sentence), Ordinalise(Literal) and Ordinalise(Term).
  • Added an implicit conversion operator to OperableFunction, to eliminate a situation where the compiler complains due to ambiguity. Should probably also make several other similar additions to other operable types, but.. haven't bothered for now.
  • Minor changes to Unifier class - trivial performance improvement when working with Predicates.
  • Package README update
  • Some XML doc improvements

Changes compared to 7.0.0-pre.4

  • Optional ctor parameter added to SentenceFormatter - a delegate for controlling whether brackets should be included for zero arity functions with a given identifier. Defaults to always including them.
  • Package README update

7.0.0-pre.4

13 Oct 14:13
Compare
Choose a tag to compare
7.0.0-pre.4 Pre-release
Pre-release

Changes compared to 7.0.0-pre.3:

  • BREAKING: Feature vector index changes:
    • Added a FeatureVectorComponent struct type (instead of using KeyValuePairs)
    • Significantly changed the node interfaces:
      • Moved ownership of the feature comparer from the index into the nodes, so that nodes can store their children in an ordered fashion. Aside from the benefit this gives to the index implementations (see below), this makes more sense anyway, since for nodes backed by external storage, that external storage is going to have the nodes structured in accordance with the comparer that was used when populating it.
      • Added separate "Ascending" and "Descending" child properties, for flexibility in how nodes facilitate Subsuming and Subsumed queries
      • Made the async and non-async versions more similar.
    • Indices now leverage node child ordering when performing queries, for performance.
    • Updated the node implementations provided by the library so that they use sorted lists rather than dictionaries

Changes compared to 6.0.0:

  • BREAKING: Removed Constant type from the model. There has never been any real need for it - a constant is just a function with arity zero. Now that parsing is somewhat configurable (lessening the chance of confusion/issues occurring due to zero arity functions being specifiable with or without parentheses), there really is no excuse not to get rid of this.
  • BREAKING: significant re-organisation of sentence manipulation logic. Two motivations here. First, to tidy up the SentenceManipulation namespace, by moving concrete manipulation classes downward into one of two sub-namespaces (Normalisation and VariableManipulation), leaving just the abstractions in SentenceManipulation itself. Second, to push the specifics of our CNF conversion logic (notably, the standardised variable and Skolem function identifier types) downward, so that they don't pollute our model. The CNFSentence and CNFClause types should be usable without needing to also use our conversion logic. If consumers want to normalise using their own logic/identifiers, that should be doable without confusion. Specifics:
    • SkolemFunctionIdentifier and StandardisedVariableIdentifier moved from SCFirstOrderLogic to new SCFirstOrderLogic.SentenceManipulation.Normalisation namespace.
    • CNFExplainer moved from SentenceFormatting to Normalisation namespace.
    • CNFInspector moved from SentenceManipulation to Normalisation namespace.
    • CNFClause.Restandardise method removed, replaced by extension method in new NormalisationExtensions class in Normalisation namespace.
    • ToCNF method removed from Sentence class, replaced by extension method in NormalisationExtensions.
    • CNFClause unification extension methods moved from SentenceManipulation.Unification to a new VariableManipulationExtensions class in a new SentenceManipulation.VariableManipulation namespace.
    • VariableSubstitution and MutableVariableSubstitution moved from SentenceManipulation to VariableManipulation namespace.
    • Unifier moved from SentenceManipulation.Unification to VariableManipulation namespace.
    • CNFSentence's Sentence-accepting ctor changed so that it no longer converts to CNF for you - it expects the sentence to already be a conjunction of disjunctions of literals.
  • Added a couple of feature vector index implementations (one synchronous, one asynchronous) to a new ClauseIndexing namespace. Nearly done now - just want to add some final (probably fuzz) tests prior to v7 release.
  • Added some extension methods for Terms to VariableManipulationExtensions class in the SentenceManipulation.VariableManipulation namespace. Specifically, added IsInstanceOf(Term), IsGeneralisationOf(Term), Ordinalise(Sentence), Ordinalise(Literal) and Ordinalise(Term).
  • Added an implicit conversion operator to OperableFunction, to eliminate a situation where the compiler complains due to ambiguity. Should probably also make several other similar additions to other operable types, but.. haven't bothered for now.
  • Minor changes to Unifier class - trivial performance improvement when working with Predicates.
  • Package README update
  • As always, some XML doc improvements

7.0.0-pre.3

29 Sep 19:30
Compare
Choose a tag to compare
7.0.0-pre.3 Pre-release
Pre-release

Changes compared to 7.0.0-pre.2:

  • BREAKING: Feature vector index changes:
    • Feature vector index nodes expose full key-value pair collection property instead of GetSubsuming/Subsumed methods. This is to keep the focus of the nodes on the backing store, and to facilitate e.g. visualisers.
    • Feature vector indices now ignore the actual variable identifiers for the purposes of uniqueness. That is, trying to add P(x, y) when P(a, b) has already been added will result in an exception stating that the key is already present (but will not for P(x, x)). And of course similar for get and delete.
    • Bug fix: when using an explicitly provided feature comparer (as opposed to the default) with the library-provided dictionary nodes, the comparer wasn't being passed down to new nodes, meaning that it was only being used for the root node.
  • Added Ordinalise(Sentence) and Ordinalise(Literal) to VariableManipulationExtensions.
  • Re-added Sentence-accepting CNFSentence ctor - though this new version expects the passed sentence to be in CNF - that is, be a conjunction of disjunctions of literals. Intended as another step on the road to a bit more flexibility for consumers in exactly how conversion to CNF is carried out.

Changes compared to 6.0.0:

  • BREAKING: Removed Constant type from the model. There has never been any real need for it - a constant is just a function with arity zero. Now that parsing is somewhat configurable (lessening the chance of confusion/issues occurring due to zero arity functions being specifiable with or without parentheses), there really is no excuse not to get rid of this.
  • BREAKING: significant re-organisation of sentence manipulation logic. Two motivations here. First, to tidy up the SentenceManipulation namespace, by moving concrete manipulation classes downward into one of two sub-namespaces (Normalisation and VariableManipulation), leaving just the abstractions in SentenceManipulation itself. Second, to push the specifics of our CNF conversion logic (notably, the standardised variable and Skolem function identifier types) downward, so that they don't pollute our model. The CNFSentence and CNFClause types should be usable without needing to also use our conversion logic. If consumers want to normalise using their own logic/identifiers, that should be doable without confusion. Specifics:
    • CNFExplainer moved from SentenceFormatting to SentenceManipulation.Normalisation.
    • CNFInspector moved from SentenceManipulation to SentenceManipulation.Normalisation.
    • CNFClause.Restandardise method removed, replaced with extension methods in Normalisation namespace.
    • SkolemFunctionIdentifier and StandardisedVariableIdentifier moved from SCFirstOrderLogic to SCFirstOrderLogc.SentenceManipulation.Normalisation.
    • CNFClause unification extension methods moved from SentenceManipulation.Unification to SentenceManipulation.VariableManipulation, & class renamed from CNFClauseExtensions to NormalisationExtensions.
    • ToCNF method removed from Sentence class, replaced by extension method in NormalisationExtensions.
    • Sentence-accepting ctor changed so that it no longer converts to CNF for you - it expects the sentence to already be a conjunction of disjunctions of literals.
    • VariableSubstitution and MutableVariableSubstitution moved from SentenceManipulation to SentenceManipulation.VariableManipulation.
    • Unifier moved from SentenceManipulation.Unification to SentenceManipulation.VariableManipulation.
  • Added first pass of a feature vector index implementation to a new ClauseIndexing namespace. It does need some (performance and robustness in the face of duplicates being added) tweaks and further testing prior to proper v7 release. Such changes are fairly likely to be breaking changes. But this is a good starting point.
  • Added some extension methods for Terms to a new VariableManipulationExtensions class in the new SentenceManipulation.VariableManipulation namespace. Specifically, added IsInstanceOf(Term), IsGeneralisationOf(Term), Ordinalise(Sentence), Ordinalise(Literal) and Ordinalise(Term).
  • Added an implicit conversion operator to OperableFunction, to eliminate a situation where the compiler complains due to ambiguity. Should probably also make several other similar additions to other operable types, but.. haven't bothered for now.
  • Minor changes to Unifier class - trivial performance improvement when working with Predicates.
  • Package README update
  • As always, some XML doc improvements

7.0.0-pre.2

27 Aug 12:27
Compare
Choose a tag to compare
7.0.0-pre.2 Pre-release
Pre-release

Changes compared to 7.0.0-pre.1:

  • BREAKING: Further breaking changes to sentence manipulation logic:
    • Renamed CNFClauseExtensions in the SentenceManipulation.Normalisation namespace to NormalisationExtensions.
    • Combined CNFClauseExtensions and TermExtensions in VariableManipulation namespace into a single VariableManipulationExtensions class.
    • ToCNF method removed from Sentence class, replaced by extension method in NormalisationExtensions.
    • Sentence-accepting ctor for CNFSentence removed.
  • Added first pass of a feature vector index implementation to a new ClauseIndexing namespace. It does need some (performance and robustness in the face of duplicates being added) tweaks and further testing prior to proper v7 release. Such changes are fairly likely to be breaking changes. But this is a good starting point.
  • Minor changes to Unifier class - trivial performance improvement when working with Predicates.

Changes compared to 6.0.0:

  • BREAKING: Removed Constant type from the model. There has never been any real need for it - a constant is just a function with arity zero. Now that parsing is somewhat configurable (lessening the chance of confusion/issues occurring due to zero arity functions being specifiable with or without parentheses), there really is no excuse not to get rid of this.
  • BREAKING: significant re-organisation of sentence manipulation logic. Two motivations here. First, to tidy up the SentenceManipulation namespace, by moving concrete manipulation classes downward into one of two sub-namespaces (Normalisation and VariableManipulation), leaving just the abstractions in SentenceManipulation itself. Second, to push the specifics of our CNF conversion logic (notably, the standardised variable and Skolem function identifier types) downward, so that they don't pollute our model. The CNFSentence and CNFClause types should be usable without needing to also use our conversion logic. If consumers want to normalise using their own logic/identifiers, that should be doable without confusion. Specifics:
    • CNFExplainer moved from SentenceFormatting to SentenceManipulation.Normalisation.
    • CNFInspector moved from SentenceManipulation to SentenceManipulation.Normalisation.
    • CNFClause.Restandardise method removed, replaced with extension methods in Normalisation namespace.
    • SkolemFunctionIdentifier and StandardisedVariableIdentifier moved from SCFirstOrderLogic to SCFirstOrderLogc.SentenceManipulation.Normalisation.
    • CNFClause unification extension methods moved from SentenceManipulation.Unification to SentenceManipulation.VariableManipulation, & class renamed from CNFClauseExtensions to NormalisationExtensions.
    • ToCNF method removed from Sentence class, replaced by extension method in NormalisationExtensions.
    • Sentence-accepting ctor for CNFSentence removed.
    • VariableSubstitution and MutableVariableSubstitution moved from SentenceManipulation to SentenceManipulation.VariableManipulation.
    • Unifier moved from SentenceManipulation.Unification to SentenceManipulation.VariableManipulation.
  • Added first pass of a feature vector index implementation to a new ClauseIndexing namespace. It does need some (performance and robustness in the face of duplicates being added) tweaks and further testing prior to proper v7 release. Such changes are fairly likely to be breaking changes. But this is a good starting point.
  • Added some extension methods for Terms to the new SentenceManipulation.VariableManipulation namespace. Specifically, added IsInstanceOf(Term), IsGeneralisationOf(Term) and Ordinalise().
  • Added an implicit conversion operator to OperableFunction, to eliminate a situation where the compiler complains due to ambiguity. Should probably also make several other similar additions to other operable types, but.. haven't bothered for now.
  • Minor changes to Unifier class - trivial performance improvement when working with Predicates.
  • Package README update
  • As always, some XML doc improvements

7.0.0-pre.1

03 Aug 12:52
Compare
Choose a tag to compare
7.0.0-pre.1 Pre-release
Pre-release

Changes in this pre-release:

  • BREAKING: Removed Constant type from the model. There has never been any real need for it - a constant is just a function with arity zero. Now that parsing is somewhat configurable (lessening the chance of confusion/issues occurring due to zero arity functions being specifiable with or without parentheses), there really is no excuse not to get rid of this.
  • BREAKING: namespace changes. Two motivations here. First, to tidy up the SentenceManipulation namespace, by moving concrete manipulation classes downward into one of two sub-namespaces (Normalisation and VariableManipulation), leaving just the abstractions in SentenceManipulation itself. Second, to push the specifics of our CNF conversion logic (notably, the standardised variable and Skolem function identifier types) downward, so that they don't pollute our model. The CNFSentence and CNFClause types should be usable without needing to also use our conversion logic - if consumers want to normalise using their own logic/identifiers, that should be doable without any awkwardness. Specifics:
    • CNFExplainer moved from SentenceFormatting to SentenceManipulation.Normalisation.
    • CNFClause.Restandardise method removed, replaced with extension methods in Normalisation namespace.
    • SkolemFunctionIdentifier and StandardisedVariableIdentifier moved from SCFirstOrderLogic to SCFirstOrderLogc.SentenceManipulation.Normalisation.
    • VariableSubstitution, MutableVariableSubstitution and CNFInspector moved from SentenceManipulation to SentenceManipulation.VariableManipulation.
    • Unifier class and CNFClause unification extension methods moved from SentenceManipulation.Unification to SentenceManipulation.VariableManipulation.
  • Added some extension methods for Terms to the new SentenceManipulation.VariableManipulation namespace. Specifically, added IsInstanceOf(Term), IsGeneralisationOf(Term) and Ordinalise().
  • Added an implicit conversion operator to OperableFunction, to eliminate a situation where the compiler complains due to ambiguity. Should probably also make several other similar additions to other operable types, but.. haven't bothered for now.
  • Package README update
  • As always, some XML doc improvements

All v7 changes so far:

As above

6.0.0

07 Jul 15:06
Compare
Choose a tag to compare
  • BREAKING: Removed knowledge base implementations, leaving only the abstractions. The implementations have been moved to the new SCFirstOrderLogic.Inference.Basic package. I'm separating these out because it's no longer completely beyond the realms of possibility that I'll have a go at creating a "real" knowledge base implementation at some point. If and when I do (or indeed if someone else wants to), I don't want these ones getting in the way. Besides, there is enough scope for different KB implementations for different purposes that I don't think any implementations belong in the core package.
  • BREAKING: Significant SentenceFormatting namespace refactoring. Cleaned up SentenceFormatter a little - removed its knowledge of specific identifier types.
  • Some changes in the TermIndexing namespace:
    • BREAKING: IDiscriminationTreeElementInfo renamed to IDiscriminationTreeNodeKey. Its implementations have also been renamed.
    • BREAKING: IAsyncDiscriminationTreeNode methods modified to return ValueTasks instead of Tasks.
  • Some changes to VariableSubstitution:
    • Added MutableVariableSubstitution. Derives from VariableSubstitution and is modifiable in-place.
    • Added CopyAsMutable method to VariableSubstitution.
    • Added CopyAndAdd methods to VariableSubstitution.
    • BREAKING: renamed VariableSubstitution.Clone() to CopyAsReadOnly(). Didn't want to use the term "Clone" for the methods above, because "Clone" suggests no change quite strongly - "CloneAndAdd" is a bit awkward. So, renaming this method for consistency.
  • BREAKING: Made the implicit Predicate to Literal conversion operator explicit. Making it implicit was a mistake - causes the compiler to make some undesirable decisions when working with Predicates.
  • Added some overloads to Unifier, to make up for the Predicate to Literal conversion change (above).

6.0.0-pre.3

07 Jul 13:03
Compare
Choose a tag to compare
6.0.0-pre.3 Pre-release
Pre-release

New in this pre-release:

  • BREAKING: Significant SentenceFormatting namespace refactoring. Cleaned up SentenceFormatter a little - removed its knowledge of specific identifier types.

All v6 changes so far:

  • BREAKING: Removed knowledge base implementations, leaving only the abstractions. The implementations have been moved to the new SCFirstOrderLogic.Inference.Basic package. I'm separating these out because it's no longer completely beyond the realms of possibility that I'll have a go at creating a "real" knowledge base implementation at some point. If and when I do (or indeed if someone else wants to), I don't want these ones getting in the way. Besides, there is enough scope for different KB implementations for different purposes that I don't think any implementations belong in the core package.
  • BREAKING: Significant SentenceFormatting namespace refactoring. Cleaned up SentenceFormatter a little - removed its knowledge of specific identifier types.
  • Some changes in the TermIndexing namespace:
    • BREAKING: IDiscriminationTreeElementInfo renamed to IDiscriminationTreeNodeKey. Its implementations have also been renamed.
    • BREAKING: IAsyncDiscriminationTreeNode methods modified to return ValueTasks instead of Tasks.
  • Some changes to VariableSubstitution:
    • Added MutableVariableSubstitution. Derives from VariableSubstitution and is modifiable in-place.
    • Added CopyAsMutable method to VariableSubstitution.
    • Added CopyAndAdd methods to VariableSubstitution.
    • BREAKING: renamed VariableSubstitution.Clone() to CopyAsReadOnly(). Didn't want to use the term "Clone" for the methods above, because "Clone" suggests no change quite strongly - "CloneAndAdd" is a bit awkward. So, renaming this method for consistency.
  • BREAKING: Made the implicit Predicate to Literal conversion operator explicit. Making it implicit was a mistake - causes the compiler to make some undesirable decisions when working with Predicates.
  • Added some overloads to Unifier, to make up for the Predicate to Literal conversion change (above).

6.0.0-pre.2

06 Jul 15:04
Compare
Choose a tag to compare
6.0.0-pre.2 Pre-release
Pre-release

New in this pre-release:

  • BREAKING: Removed knowledge base implementations, leaving only the abstractions. The implementations have been moved to the new SCFirstOrderLogic.Inference.Basic package. I'm separating these out because it's no longer completely beyond the realms of possibility that I'll have a go at creating a "real" knowledge base implementation at some point. If and when I do (or indeed if someone else wants to), I don't want these ones getting in the way. Besides, there is enough scope for different KB implementations for different purposes that I don't think any implementations belong in the core package.

All v6 changes so far:

  • BREAKING: Removed knowledge base implementations, leaving only the abstractions. The implementations have been moved to the new SCFirstOrderLogic.Inference.Basic package. I'm separating these out because it's no longer completely beyond the realms of possibility that I'll have a go at creating a "real" knowledge base implementation at some point. If and when I do (or indeed if someone else wants to), I don't want these ones getting in the way. Besides, there is enough scope for different KB implementations for different purposes that I don't think any implementations belong in the core package.
  • Some changes in the TermIndexing namespace:
    • BREAKING: IDiscriminationTreeElementInfo renamed to IDiscriminationTreeNodeKey. Its implementations have also been renamed.
    • BREAKING: IAsyncDiscriminationTreeNode methods modified to return ValueTasks instead of Tasks.
  • Some changes to VariableSubstitution:
    • Added MutableVariableSubstitution. Derives from VariableSubstitution and is modifiable in-place.
    • Added CopyAsMutable method to VariableSubstitution.
    • Added CopyAndAdd methods to VariableSubstitution.
    • BREAKING: renamed VariableSubstitution.Clone() to CopyAsReadOnly(). Didn't want to use the term "Clone" for the methods above, because "Clone" suggests no change quite strongly - "CloneAndAdd" is a bit awkward. So, renaming this method for consistency.
  • BREAKING: Made the implicit Predicate to Literal conversion operator explicit. Making it implicit was a mistake - causes the compiler to make some undesirable decisions when working with Predicates.
  • Added some overloads to Unifier, to make up for the Predicate to Literal conversion change (above).

6.0.0-pre.1

09 Jun 15:34
Compare
Choose a tag to compare
6.0.0-pre.1 Pre-release
Pre-release

New in this pre-release:

  • Some changes in the TermIndexing namespace:
    • BREAKING: IDiscriminationTreeElementInfo renamed to IDiscriminationTreeNodeKey. Its implementations have also been renamed.
    • BREAKING: IAsyncDiscriminationTreeNode methods modified to return ValueTasks instead of Tasks.
  • Some changes to VariableSubstitution:
    • Added MutableVariableSubstitution. Derives from VariableSubstitution and is modifiable in-place.
    • Added CopyAsMutable method to VariableSubstitution.
    • Added CopyAndAdd methods to VariableSubstitution.
    • BREAKING: renamed VariableSubstitution.Clone() to CopyAsReadOnly(). Didn't want to use the term "Clone" for the methods above, because "Clone" suggests no change quite strongly - "CloneAndAdd" is a bit awkward. So, renaming this method for consistency.
  • BREAKING: Made the implicit Predicate to Literal conversion operator explicit. Making it implicit was a mistake - causes the compiler to make some undesirable decisions when working with Predicates.
  • Added some overloads to Unifier, to make up for the Predicate to Literal conversion change (above).

All v6 changes so far:

As above..