-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store the closedness of a term on its leaves in unification matchrec.
We introduce a new internal type of annotated terms which are essentially a pair of a term and an annotation, in a recursive way. The annotation is a boolean standing for the closedness of the term. This guarantees a O(1) access to the underlying term, as well as a O(1) access to closedness. Building the annotation is O(n) in the term and is an upfront cost payed before entering the recursion. This trick could be generalized to any annotation which is local, i.e. only depends on the data of the direct subterms of a term. There are various places that could benefit from it, but for the time being I do not want to introduce yet another generic term API.
- Loading branch information
Showing
1 changed file
with
132 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters