Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing TCC in Abbreviated Subtype #68

Open
marianomoscato opened this issue Dec 16, 2019 · 0 comments
Open

Missing TCC in Abbreviated Subtype #68

marianomoscato opened this issue Dec 16, 2019 · 0 comments

Comments

@marianomoscato
Copy link
Collaborator

Some TCCs for subtype abbreviated forms are not being generated.

See, for example, the following theory.

test: THEORY
BEGIN
  p(b: above(3))(c: nat): bool = 3 <= b + c
  f(m: nat): (p(m)) = 3
END test

The only TCC generated after typechecking is

% Subtype TCC generated (at line 4, column 22) for  3
    % expected type  (p(m))
  % unfinished
f_TCC1: OBLIGATION FORALL (m: nat): p(m)(3);

Nevertheless, a subtype tcc should be generated for the apparition of m in the expression p(m) (line 4, column 14).

In fact, the missing TCC is generated when typechecking the following version of the theory, in which the return type of f is defined using the expanded form instead of the abbreviation.

test: THEORY
BEGIN
  p(b: above(3))(c: nat): bool = 3 <= b + c
  f(m: nat): {c: nat | p(m)(c)} = 3
END test

In such case, the TCCs generated by the typechecker are shown below.

% Subtype TCC generated (at line 4, column 26) for  m
    % expected type  above(3)
  % unfinished
f_TCC1: OBLIGATION FORALL (m: nat): m > 3;

% Subtype TCC generated (at line 4, column 35) for  3
    % expected type  {c: nat | p(m)(c)}
  % unfinished
f_TCC2: OBLIGATION FORALL (m: nat): p(m)(3);

This problem occurs both in PVS 6.0 and PVS 7.0.

cesaramh pushed a commit to nasa/pvslib that referenced this issue Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant