Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132946 views
License: OTHER
1
matches(\varepsilon, []).
2
3
matches(C, [C]) :- atom(C), !.
4
5
matches(\cup(A, _), S) :- matches(A, S).
6
matches(\cup(_, B), S) :- matches(B, S).
7
8
matches(\cdot(A, B), S) :- append(S1, S2, S),
9
matches(A, S1),
10
matches(B, S2).
11
12
matches(*(_), []).
13
matches(*(A), S) :- append(S1, S2, S),
14
not(S1=[]),
15
matches(A, S1),
16
matches(*(A), S2).
17