-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix handling of overloaded symbols in standalone positions (#84)
Previously we were using a policy of handling overloaded symbols that did not update the symbol table when a symbol was overloaded but instead kept a reference to it via the original expression. When an overloaded expression was applied, it would be disambiguated based on the other expressions that had the same name. This was incorrect for overloaded symbols that appear in unapplied positions, where we would always take the oldest expression. This fixes the issue by always updating the symbol table and by carrying the overloads to the new expression. This simplifies the logic a bit when expressions are unbound.
- Loading branch information
Showing
5 changed files
with
45 additions
and
19 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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(declare-const or (-> Bool Bool Bool) :right-assoc-nil false) | ||
(declare-const = (-> (! Type :var T :implicit) T T Bool)) | ||
|
||
(declare-const a Bool) | ||
(declare-const b Bool) | ||
|
||
(define singleton-list ((T Type :implicit) (f (-> T T T)) (a T)) (eo::cons f a (eo::nil f))) | ||
|
||
(declare-rule refl ((T Type) (t T)) | ||
:args (t) | ||
:conclusion (= t t) | ||
) | ||
|
||
(step @p0 (= (or b) (or b)) :rule refl :args ((singleton-list or b))) |