- 26 Oct, 2021 14 commits
-
-
Leif-Erik Krüger authored
Adapt the existing test suite to the error message changes https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11 - No new tests have been added, but the current test suite now passes. - Some changes are due to small changes in the error messages, others correspond to the reworked predicate set reduction.
-
Leif-Erik Krüger authored
Update the export computation to support flexible contexts https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11
-
Leif-Erik Krüger authored
Update the import computation to support flexible contexts https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11
-
Leif-Erik Krüger authored
Update the dictionary translation to support flexible contexts https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11 - Most changes correspond to the switch from super class infos to super class predicates. - The dictionary translation also supports flexible instances, but no explicit changes for that were necessary.
-
Leif-Erik Krüger authored
Update the desugaring to support flexible instances and contexts https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11 Instance types and constraints (except those in qualified type expressions, which are ignored in the dictionary translation) are now desugared as they can contain type synonyms.
-
Leif-Erik Krüger authored
Update the warn check to support flexible contexts https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11
-
Leif-Erik Krüger authored
Update the type check to support flexible instances and contexts https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11 - The type check now carries the enabled extensions along to report inferred flexible contexts only when the respective extension is disabled. - Instead of using a dedicated explicit predicate set, predicates given by explicit type signatures are now instantiated correctly and added to the dynamic instance environment. -- As this environment can now also contain predicates without type variables, we can no longer use it globally. We therefore use a local environment whenever we type-check a declaration with an explicit type signature. - The predicate set reduction has been reworked: -- The function now receives a flag specifying whether the respective declaration is explicitly typed. --- If so, all predicates remaining after reduction which do not consist only of variable types are reported. --- Otherwise, only predicates not containing any type variable are reported. -- Predicates for which multiple unifiable instances exist are no longer reduced. -- Inferred predicates equal to given predicates are now directly removed from the predicate set. --- This allows using the existing dynamic instance environment for this purpose without changing its behaviour and simplifies further steps, but has the downside of potentially showing an incomplete inferred context when an error is reported in `checkTypeSig`. - Defaulting of `TypeConstrained`s is now restricted similarly to the defaulting of regular type variables. - Some outdated comments have been removed.
-
Leif-Erik Krüger authored
Update the instance check to support flexible instances and contexts https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11 - The predicate set reduction has been reworked: -- A new `ReductionMode` data type has been added to specify the purpose of the reduction. It replaces the `what` String used previously and stores additional data, like the flag set when inferring the predicate set of a derived `Data` instance. -- When checking for super class instances, the instance context is now taken into account during the reduction (otherwise, we might reduce "too much"). -- Like in the GHC, overlap with unifiable (but not matching) instances is only considered when inferring predicate sets of derived instances. - When an instance, which is completely overlapped by another instance (like `Eq String` by `Eq [a]`), does not implement every class method, it becomes ambiguous which default implementation should be chosen. -- These errors are now reported properly in the instance check. -- Unlike in the GHC, where only missing implementations of methods with actual default implementations are reported, the Curry frontend reports every missing implementation, because all class methods receive a default implementation in the dictionary translation.
-
Leif-Erik Krüger authored
Update the kind check to support flexible contexts https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11 Since super class contexts can now contain type synonyms, they must be expanded before entering the respective class into the class environment.
-
Leif-Erik Krüger authored
Update the interface check to support flexible contexts https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11
-
Leif-Erik Krüger authored
Update the interface syntax check to support flexible instances and contexts https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11 - Like in the type syntax check, the checks applied to instance types and constraints have been reduced for flexible instances and constraints. -- The full checks and most parts of the respective error messages have been removed, as the interface syntax check cannot access the activated extensions and must therefore assume that flexible instances and contexts are activated.
-
Leif-Erik Krüger authored
Update the type syntax check to support flexible instances and contexts https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11 - The checks applied to instance types and constraints are reduced when the respective flexible extension is enabled. - The error messages for illegal instance types and constraints now suggest using the respective extension.
-
Leif-Erik Krüger authored
Add lookup of unifiable instances to the instance environment https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11 - In addition to the matching instances, `lookupInstMatch` now also returns unifiable instances. -- With these unifiable instances, we mean those which could match the given constraint for some substitution applied to the latter (so those where the instance head and the constraint can be unified). -- For this purpose, a type unification algorithm has been added to the instance environment (similar to the one used in the instance check of the unfinished functional dependencies implementation). - The function `removeTypeConstrained`, which removes `TypeConstrained`s from a type by converting them to type variables, has been added to `Base.Types`. -- This function is applied to the given constraint when looking up unifiable instances (finding too many instances is not problematic here because of the defaulting restrictions).
-
Leif-Erik Krüger authored
Update the class environment to support flexible contexts https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11 - Super classes are now represented by a predicate set. - `constraintToSuperClass`, `applySuperClass` and `applyAllSuperClasses` have been removed, since they can now be replaced by other functions like `toPred` and `expandAliasType`. - `minPredSet` and `maxPredSet` have been moved from `Base.Types` to the class environment because the latter now needs to import the former. -- Since these operations use the class environment however, leaving them in `Base.Types` would have created a cyclic dependency.
-
- 25 Oct, 2021 2 commits
-
-
Leif-Erik Krüger authored
Update the parser to support flexible contexts https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11 The functions limiting the form of parsable constraints have been removed
-
Leif-Erik Krüger authored
Add `FlexibleInstances` and `FlexibleContexts` to the list of extensions https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/11
-
- 26 Aug, 2021 4 commits
-
-
Leif-Erik Krüger authored
Add new test modules for defaulting https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/4 - The added `NoDefaulting` module in the "fail" category tests cases where defaulting should not be applied because of the restrictions. - The added `Defaulting` module in the "pass" category tests if defaulting works under simple circumstances, with constraints of non-Prelude classes disappearing through context reduction, and with user-defined data types. - Both added test modules have been added to the test suite where they fail with the expected error messages or pass respectively.
-
Leif-Erik Krüger authored
Update the test suite to work with the added defaulting restrictions https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/4 - The updated test modules relied on defaulting no longer applied because of the added restrictions. -- To fix this, type annotations have been added where needed.
-
Leif-Erik Krüger authored
Implement defaulting restriction checks in the type check https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/4 - The added defaulting restriction checks ensure that type variables occurring in predicates of non-Prelude classes are not defaulted. - These checks are not applied in the defaulting mechanism for `TypeConstrained`s, which are generated for literals occurring in patterns. - The added function `isPreludeClass` returns whether a given qualified ident belongs to a Prelude class. - Many comments surrounding defaulting and related problems have been added, updated or removed.
-
Leif-Erik Krüger authored
Add identifiers for all missing Prelude type classes https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/4 The identifiers were added because it must be checked whether a type class is a Prelude class or not to implement the defaulting restriction checks mentioned in the linked issue.
-
- 24 Aug, 2021 1 commit
-
-
Leif-Erik Krüger authored
Revert all changes made to support functional dependencies https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10 - A severe problem regarding the implementation of functional dependencies in Curry has been discovered. -- The amount of work required to solve these problems is expected to be to high to be tackled in this master thesis. -- As the final code submission should not contain any half-implemented feature, all changes regarding functional dependencies are removed from this branch. --- The incomplete implementation of functional dependencies is still available in the `lkrueger-ma-fundeps` branch.
-
- 14 Aug, 2021 8 commits
-
-
Leif-Erik Krüger authored
Update the AbstractCurry output format to support functional dependencies https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10 - The type synonym `CFunDep` was added to the AbstractCurry AST data types to represent functional dependencies. - A list of `CFunDep`s was added to the fields of the `CClass` constructor. - The comment explaining how a class definition relates to its AbstractCurry term was updated to take functional dependencies into account.
-
Leif-Erik Krüger authored
Update the HTML syntax coloring to support functional dependencies https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10
-
Leif-Erik Krüger authored
Update the transformation phase to be compatible with the addition of functional dependencies https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10 The changes made here might be sufficient to fully support functional dependencies in the transformation phase. This will become apparent once further functionality for functional dependencies is implemented.
-
Leif-Erik Krüger authored
Update the import computation to support functional dependencies https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10
-
Leif-Erik Krüger authored
Update the export computation to support functional dependencies https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10 The export of instances of classes with functional dependencies has been changed. An added comment explains these changes.
-
Leif-Erik Krüger authored
Update the remaining checks to be compatible with the addition of functional dependencies https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10 - Note that this commit does not add any functionality for functional dependencies, but makes the changed modules compilable so that the other changes made can be tested. - To many of these modules, further changes will be necessary to fully support functional dependencies.
-
Leif-Erik Krüger authored
Add basic support for functional dependencies to the interface syntax check https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10 - The changes made here are analogous to the changes made to the type syntax check in the previous commit, with the exception of the extension check, which currently cannot be done in the interface syntax check. - Just like in the type syntax check, further changes will be necessary to fully support functional dependencies.
-
Leif-Erik Krüger authored
Add basic support for functional dependencies to the type syntax check https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10 - An error is now reported when functional dependencies are used without enabling the `FunctionalDependencies` extension. - It is checked whether functional dependencies are closed, i.e. only use bound type variables. - The function checking whether a class method includes all class variables in its type was changed to take functional dependencies into account. - Further changes will be necessary to fully support functional dependencies. For example, the closure check for contexts of functions will have to be removed or reworked.
-
- 13 Aug, 2021 6 commits
-
-
Leif-Erik Krüger authored
Add types and functions for the support of functional dependencies to the class environment https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10 - The type synonym `FunDep` was added to store functional dependencies in the class environment. -- Functional dependencies are represented by a pair of sets of type variable indices. -- A list of `FunDep`s is now part of the `ClassInfo` type synonym. They are therefore needed to add an entry to the class environment and can be looked up with the added `classFunDeps` function. -- The name `FunDep` is already used in the AST representation, so it might be necessary to qualify this identifier when using it. -- Functions converting between AST `FunDep`s and class environment `FunDep`s have been added. - With `funDepCoverage`, a function computing all type class arguments uniquely determined by a subset of type class arguments was added. - Many comments have been added or updated according to these changes. - Some functions might have to be reworked or further functions might have to be added once more of the functionality of functional dependencies is implemented.
-
Leif-Erik Krüger authored
Update further utility modules to support functional dependencies https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10
-
Leif-Erik Krüger authored
Update the remaining parts of the detection phase to support functional dependencies https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10
-
Leif-Erik Krüger authored
Add `FunctionalDependencies` to the list of extensions https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10 A mechanism for implied extensions, which would automatically enable `MultiParamTypeClasses` when `FunctionalDependencies` is enabled, might be added in the future.
-
Leif-Erik Krüger authored
Add parsing of functional dependencies https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10
-
Leif-Erik Krüger authored
Add functional dependencies to the Curry AST representation https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/10 - The new data type `FunDep` was added to represent functional dependencies. - Fields for functional dependencies have been added to the constructors for regular class declarations, hiding class declarations and interface class declarations.
-
- 10 Aug, 2021 4 commits
-
-
Leif-Erik Krüger authored
- Previously, when updating the source span end position of a class or instance declaration without a `where` clause, it did not go to the end of the declaration, because the last source info point of the declaration was used, which could, for example, be the double arrow separating the context from the head. -- To fix this for class and instance declarations without local declarations, we now compare the end of the last source info point and the source span end of the last class ident, class variable or instance type and take the maximum. --- This procedure is necessary because we cannot easily tell if a class or instance declaration has a `where` clause, so we do not know if it ends with that keyword or with the last class ident, class variable or instance type.
-
Leif-Erik Krüger authored
Update the tests in the "pass" category to test for the added features https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/8 - `MPTCPotentialInstanceOverlap` was added as a new test module. It tests for potential instance overlap that should be accepted. - New instances, a new data type with a derived instance and a new test expression testing for a case with potential instance overlap were added to `MPTCDeriving`. - New instances and a new test expression testing for a case with multiple super class instances for the correct type constructor, where only one fits in all cases because of its type variables, were added to `MPTCSuperClasses`. - The test front-end has been updated to include the added test module and has been run successfully.
-
Leif-Erik Krüger authored
Remove the free type variables from the functions reporting flexible contexts https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/8 - Further tests with the GHC have lead to the conclusion that the GHC ignores whether type variable are free when checking for flexible contexts. -- To match this behaviour, predicates containing free type variables are no longer filtered out and the parameter for the set of free type variables has therefore been from `reportFlexibleContextDecl` and `reportFlexibleContextPattern`.
-
Leif-Erik Krüger authored
Fix a bug in the dictionary translation that could lead to dictionary arguments being passed in the wrong order https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/8 - Previously, when looking up in the instance environment to construct a dictionary, a substitution was applied to the predicate set from the instance before converting it to a list. -- Because the set is sorted, this substitution could change the order of the predicates, which could lead to arguments being passed on to a dictionary function in the wrong order. -- To fix this, the substitution is now applied after converting the predicate set to a list.
-
- 09 Aug, 2021 1 commit
-
-
Leif-Erik Krüger authored
Update the tests in the "fail" category to test for the added features https://git.ps.informatik.uni-kiel.de/theses/2021/2021-lkrueger-ma/-/issues/8 - The tests should cover the new possibilities for errors when allowing repeating type variables in instance heads. - `MPTCDeriving` was added as a new test module. It tests for violations of instance termination rules, instance overlap and missing instances in derived instances. - `MPTCInstanceOverlap` was added as a new test module. It tests for different kinds of instance overlap errors occurring during the type check. - A new test function was added to `MPTCFlexibleContext` to test for subfunctions that do have a flexible context despite containing free type variables. - A test instance was removed from `MPTCInstanceTermination` because it tested for unbound type variables, which is still done in the type syntax check, while the termination checks were moved to a later phase. - A new section was added to `MPTCMissingInstance` to test for missing instance errors because of repeating type variables in instance heads. - New instances were added to `MPTCMissingSuperClassInstance` to test for missing and overlapping instance errors because of repeating type variables in instance heads. - The test front-end has been updated to include the added test modules and the other changes to the expected error messages. - The test suite has been run and the test cases fail with the expected error messages (so the test suite passes).
-