mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-19 11:23:46 +00:00
30 lines
605 B
Mathematica
30 lines
605 B
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ts=4 sw=4 et ft=mercury
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module parsing_bug.
|
|
|
|
:- interface.
|
|
|
|
:- import_module list.
|
|
:- import_module set.
|
|
|
|
:- func { list(T) } = set(T).
|
|
:- func (set(T) /\ set(T)) = set(T).
|
|
:- func (set(T) \/ set(T)) = set(T).
|
|
:- func (set(T) - set(T)) = set(T).
|
|
|
|
:- implementation.
|
|
|
|
{ List } = Set :-
|
|
list_to_set(List, Set).
|
|
|
|
A /\ B = C :-
|
|
set.intersect(A, B, C).
|
|
|
|
A \/ B = C :-
|
|
set.union(A, B, C).
|
|
|
|
A - B = C :-
|
|
set.difference(A, B, C).
|