Changeset [dc52e1d16eebfbca200add57115bf33d95f9962d] by Douglas Creager
November 19th, 2008 @ 11:32 PM
Functions defined in multiple branches
The CSPM parser now supports defining functions using multiple branches, such as:
length(<>) = 0 length(<_>^xs) = 1 + length(xs)
reverse(<>) = <> reverse(^xs) = reverse(xs) ^
(These two examples are included as test cases.) Since lambdas were already implemented using multiple pattern-based clauses, this patch only required syntax manipulations to create the right AST. No new evaluation logic was needed. http://github.com/hst/hst/commit...
Committed by Douglas Creager
- M cspm/src/HST/CSPM/Definitions.lhs
- M cspm/src/HST/CSPM/Parser.hs
- M cspm/src/HST/CSPM/Parser.ly
- M cspm/src/HST/CSPM/Types.hs
- M cspm/tests/expressions/test-lambdas.sh
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
An open-source refinement checker for the CSP process algebra.