forked from robincooper/pyttr
liesenf/pyttr
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is the beginnings of a TTR implementation in Python 3.4.3. Run the examples in the files example-records.py and example-types.py This implementation covers a core of TTR, including: Basic types Ptypes (types constructed with predicates and their arguments) Meet (intersection) types Join (union) types Function types List types Record types String types Judging (assigning objects to types) Querying (asking whether an object is of a type) Adding witness conditions to types Creating objects of types Subtyping Type merging (including asymmetric type merging) Possibilities (types may have different witnesses in different possibilities) 7th April 2017 The query method in ttrtypes will now add an object to the witness_cache that it computes as a witness on the basis of the witness conditions. Rudimentary support for projections from ttr variables in ttrtypes: lazy objects like LazyObj(['r','.','x']) Added in_poss method to functions in ttrtypes to restrict the domain type to a given possibility Judging an object to be of a meet type (ttrtypes) will now judge that object to be of the two component types of the meet type. A preliminary implementation of neural TTR has been added (neurons, nu, example-neurons, example-nu) together with a Jupiter notebook which is partially developed corresponding to example-nu (nu.ipynb). 2nd June 2017 Fixed bug with Possibility in ttrtypes.py Improved show-method for possibilities Changed subst and eval methods for LazyObj so that left recursive lazy objects will be correctly evaluated. A preliminary jupyter notebook (lspc.ipynb) has been added with examples from the paper Interfacing Language, Spatial Perception and Cognition in Type Theory with Records by Simon Dobnik and Robin Cooper (to appear in Journal of Language Modelling). 9th June 2017 Added animat.ipynb -- a very simple sheep that learns to associate types of the environment with types of actions Added switch neurons to neural TTR Added query_last_n to Type_n -- queries whether the end segment of the history matches the activity pattern associated with the type. (query_n queries whether any segment of the history matches.) 9th August 2017 Improved the display of network histories for neural ttr (nu.ipynb) as defined in neurons.py. Neurons which are not present at a time step are now represented with '*' (rather than '2'). 27th February 2018 Introduced a preliminary 'show_latex' facility. (Thanks to Mehdi Ghanimifard.) Changed the witness condition for singleton types so that the equality required is not Python equality but equality of the show-string. Added notebooks (preliminary) corresponding to the old example files: example-records.py and example-types.py. The new files are records.ipynb and types.ipynb. 6th September 2018 Improvements to the handling of possibilities. Added a facility for adding witness conditions for ptypes which are associate with the predicate used to construct the ptype. See the notebook 'ptype_learn.ipynb' for some examples. 12th September 2018 Fixed minor bugs in ttr-overview.ipynb 13th September 2018 Fixed minor bug in types.ipynb 7th October 2018 Minor improvements to utils.py (substitute, show_latex) 24th November 2018 Improvements to lspc.ipynb using the new treatment of possibilities and the facility for learning witness functions for predicates (see 6th September 2018). Improvements to the treatment of subscripts and labels in the LaTeX display. Adjustments to ttr-overview.ipynb.
About
Python implementation of TTR
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Jupyter Notebook 65.5%
- Python 34.5%