Can I anyhow create my own types in the type_check package?

With “my own types” I don’t mean the type notation of the type_check package.

There are some swi prolog types which are not covered by this package for instance: strings and dicts. Atoms are covered by the ‘strings’ type of the package, but that was not really obvious.

Terms can be represented by this package as a type.

What I would like to have here would maybe not be 100% compilant to the Hindley Milner idea of type construction. But maybe there is a possibility to check the contents of facts / clauses via a goal which can be called at startup from the type_check package.

And btw. there are some bugs: when I write

:- type mytype_001(A) —> A.

then I get 99% CPU load upto a ^C.

When I write

:- type mytype_002(A,B) —> alt(A) ; alt(B).

then alt() accepts all values. It should be at least a warning there.

:- pred demo_005(mytype_002(integer,float)).

demo_005( alt(a)). % no warning from the typechecker

And I get the Warning:

Warning: Singleton variable in branch: A

Warning: Singleton variable in branch: B

How can I get rid of that?

Don’t get me wrong this package is actually really good but has some minor flaws compared to the possibilities which provides it.

Thanks in Advance, Frank Schwidom