[erlang-questions] A subtyping system for Erlang

Edmond Begumisa ebegumisa@REDACTED
Fri Oct 11 13:39:01 CEST 2019


Hello,

This looks appetizing and quite a feat.

So I'm following the README instructions. Everything compiled fine.  
However, when I try to run the tests I get the a bunch of errors of the  
form "File operation error: ebadf. Target: ./con.beam. Function: get_file.  
Process: code_server" as shown in full shell output below.

I get similar error output with the bad tests and when type checking the  
type checker.

Any ideas?

Thanks in advance.

- Edmond -

OUTPUT >>>>

Erlang/OTP 21 [erts-10.3] [smp:4:4] [ds:4:4:10] [async-threads:1]

Eshell V10.3  (abort with ^G)
1> code:add_path("../ebin/").
true
2> c("../test/test_scfa.erl").
../test/test_scfa.erl:3: Warning: export_all flag enabled - all functions  
will be exported
{ok,test_scfa}
3> test_scfa:good(["../test/good"]).

Test g004
Specs: 1
Constraints: 7=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: ./con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/kernel-6.3/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/stdlib-3.8/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/xmerl-1.3.19/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/wx-1.8.7/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/tools-3.1/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/tftp-1.0.1/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/syntax_tools-2.1.7/ebin/con.beam. Function: get_file.  
Process: code_server.
** exception error: undefined function con:variance/2
      in function  reach:right_reachable_support/4 (reach.erl, line 169)
      in call from reach:right_reachable_supports/4 (reach.erl, line 165)
      in call from reach:reachability/2 (reach.erl, line 83)
      in call from reach:simplifyx/3 (reach.erl, line 25)
      in call from poly:solve_and_simplify/2 (poly.erl, line 152)
      in call from poly:collapse_dag/4 (poly.erl, line 122)
      in call from poly:check_fnid_list/3 (poly.erl, line 82)
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/ssl-9.2/ebin/con.beam. Function: get_file. Process:  
code_server.
4> =ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/ssh-4.7.4/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/snmp-5.2.12/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/sasl-3.3/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/runtime_tools-1.13.2/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/reltool-0.7.8/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/public_key-1.6.5/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/parsetools-2.1.8/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/otp_mibs-1.2.1/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/os_mon-2.4.7/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/odbc-2.12.3/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/observer-2.9/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/mnesia-4.15.6/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/megaco-3.18.4/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/jinterface-1.9.1/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/inets-7.0.6/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/hipe-3.18.3/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/ftp-1.0.2/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/eunit-2.3.7/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/et-1.6.4/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/erts-10.3/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/erl_interface-3.11/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/erl_docgen-0.9/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/eldap-1.2.6/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/edoc-0.10/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/diameter-2.2/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/dialyzer-3.3.2/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/debugger-4.2.6/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/crypto-4.4.1/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/compiler-7.3.2/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/common_test-1.17/ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: c:/Program Files  
(x86)/erl10.3/lib/asn1-5.0.8/ebin/con.beam. Function: get_file. Process:  
code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: ../ebin/con.beam. Function: get_file.  
Process: code_server.
=ERROR REPORT==== 11-Oct-2019::21:24:47.715000 ===
File operation error: ebadf. Target: con.beam. Function: get_file.  
Process: code_server.




On Fri, 11 Oct 2019 19:11:55 +1000, Sven-Olof Nystrom <svenolof@REDACTED>  
wrote:

>
> Hello,
>
> I would like to announce a type system for Erlang.
>
> This type system offers guarantees for safety; a program that types
> should not fail (at least, it should not fail with a type
> error). Typing a program requires specifications and declarations of
> visible functions and visible data types.
>
> As Erlang data structures such as lists and tuples cannot be modified
> at run-time it is a good fit to base the type system on
> *subtyping*. Among other advantages, subtyping allows some values to
> be typed as the universal type.
>
> The implementation is written in Erlang. It uses a modified Erlang
> parser to process Erlang modules extended with function specifications
> and type declarations. The type system can type itself, of course.
>
>
> Below follows two examples of modules that type:
>
> -module(example1).
>
> -compile(export_all).
>
> %: +type list(X) = [] + [X|list(X)].
>
> %: +func append :: list(X) * list(X) -> !list(X).
> append([A | B], C) ->
>     [A | append(B, C)];
> append([], C) -> C.
>
>
> %: +func dup :: list(integer()) -> !list(!integer()).
> dup(S) ->
>     append(S, S).
>
> The module starts with a declaration of the recursive parametric data
> type "list". This is followed by a specification and a definition of
> the recursive function append. The function "dup" is only specified
> for lists of integers (but that can be changed). The exclamation marks
> force the type system to check that something interested is returned
> by the functions.
>
> Let's take a look at a less orthodox example. This example gives a
> hint of what the type system can express, even though it is perhaps
> not very practical:
>
> -module(tsil).
>
> -compile(export_all).
>
> %: +type tsil(X) = [tsil(X)|X] + [].
> %: +func dneppa :: tsil(X) * tsil(X) -> tsil(X).
>
> dneppa([], L) ->
>     L;
> dneppa([L1|X], L2) ->
>     [ dneppa(L1, L2) | X].
>
> %: +type list(X) = [X|list(X)] + [].
> %: +func from_list :: list(X) -> tsil(X).
> from_list([]) ->
>     [];
> from_list([X|L]) ->
>     [from_list(L)|X].
>
>
> %: +func to_list :: tsil(X) -> list(X).
> to_list([]) ->
>     [];
> to_list([L|X]) ->
>     [X|to_list(L)].
>
> "tsil" is of course "list" backwards. "dneppa" concatenates two
> "tsil"s. Included are also functions that convert between "tsil"s and
> lists, just to show that the type system can reason about combinations
> of types that use the same data type constructors in different ways.
>
>
> Currently there is not much documentation of the system available,
> beside what I have written here and the README file that comes with
> the source. The download page also contains some paper that describe
> the theory.
>
> Download:
> http://user.it.uu.se/~svenolof/scfa/
>
>
> yours,
>
> Sven-Olof Nyström
>
>
>


-- 
Using Opera's mail client: http://www.opera.com/mail/



More information about the erlang-questions mailing list