Last active
December 22, 2015 04:48
-
-
Save tonyg/6419046 to your computer and use it in GitHub Desktop.
Maude example showing overlapping subsorts
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
fmod T is | |
var XX : X . | |
var YY : Y . | |
var TT : Thing . | |
sort Thing . | |
op a : -> Thing [ctor] . | |
op b : -> Thing [ctor] . | |
op _|_ : Thing Thing -> Thing [ctor] . | |
sort X . | |
subsort X < Thing . | |
mb a | TT : X . | |
sort Y . | |
subsort Y < Thing . | |
mb TT | a : Y . | |
endfm | |
match [5] XX <=? a | a . *** expected: a solution. actual: no solution. BAD | |
match [5] XX <=? a | b . *** expected: a solution. actual: a solution. OK | |
match [5] XX <=? b | a . *** expected: no solution. actual: no solution. OK | |
match [5] XX <=? b | b . *** expected: no solution. actual: no solution. OK | |
match [5] YY <=? a | a . *** expected: a solution. actual: a solution. OK | |
match [5] YY <=? a | b . *** expected: no solution. actual: no solution. OK | |
match [5] YY <=? b | a . *** expected: a solution. actual: a solution. OK | |
match [5] YY <=? b | b . *** expected: no solution. actual: no solution. OK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment