<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hello,<div class=""><br class=""></div><div class="">Is it possible / allowed to write a predicate declaration to explicitly mention a single type from a set of types? I seem to have a pattern cropping up again and again lately, here is my current situation. I have a node type:</div><div class=""><br class=""></div><div class=""><font face="MonoidNerdFontComplete-Regular" style="font-size: 14px;" class="">:- type snode<br class=""> ---> sexp(location, list(snode))<br class=""> ; list(location, list(snode))<br class=""> ; map(location, list(snode))<br class=""> ; tk(location,string)<br class=""> ; kw(location, string)<br class=""> ; s1(location,string)<br class=""> ; s2(location,string)<br class=""> .</font></div><div class=""><br class=""></div><div class="">In my code, I have performed some pre-checks on a term </div><div class=""><br class=""></div><div class=""><span style="font-size: 14px;" class=""><font face="MonoidNerdFontComplete-Regular" class=""> ( if Term = sexp(_, [tk(_, F)|_]) then</font></span><br class=""></div><div class=""><br class=""></div><div class="">such that when I call the predicate to handle it, I —know— that it can only be the one containing an s-expression, but it seems that I am forced to define the predicate I call as the containing `snode` type, I guess what I am saying is is it possible to change this:</div><div class=""><br class=""></div><div class=""><font face="MonoidNerdFontComplete-Regular" class=""><span style="font-size: 14px;" class="">:- pred do_gencall(int, renderer, <b class="">snode</b>, tcon, tcon).<br class="">:- mode do_gencall(in, renderer, in, in, out) is det.<br class="">do_gencall(L, R, Term, !T) :-</span><br class=""></font></div><div class=""><br class=""></div><div class="">to this in some way?</div><div class=""><br class=""></div><div class=""><font face="MonoidNerdFontComplete-Regular" style="font-size: 14px;" class="">:- pred do_gencall(int, renderer, <b class="">snode:sexp</b>, tcon, tcon).<br class="">:- mode do_gencall(in, renderer, in, in, out) is det.<br class="">do_gencall(L, R, Term, !T) :-</font><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Sean.</div><div class=""><br class=""></div></body></html>