Created
February 12, 2017 23:25
-
-
Save FlyingJester/03301b4cb907b045a1aa2cc4cfc76936 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
:- module rule_test. | |
:- interface. | |
:- type a ---> a1 ; a2. | |
:- type b ---> b1 ; b2. | |
% Verify that if a is a1, b is b2. | |
:- pred check(a::in, b::in) is semidet. | |
:- implementation. | |
% No rule for a1 and b1, since we said that if a1 then b must be b2. | |
check(a1, b2). | |
check(a2, b1). | |
check(a2, b2). | |
% Using an underscore means we don't care about the value. | |
% So alternatively, we could have written: | |
% check(a1, b2). | |
% check(a2, _). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment