Skip to content

Conversation

aqjune-aws
Copy link
Contributor

This patch adds a small but useful check to e(tac): detecting seemingly identical variables that in fact have different types.

  # g `f (x:num) = f 1`;;
  Warning: inventing type variables
  Warning: Free variables in goal: f, x
  val it : goalstack = 1 subgoal (1 total)

  `(f:num->?142774) x = (f:num->?142774) 1`

  # e (SUBGOAL_THEN `x = true` ASSUME_TAC);;
  Exception: Failure "var x appearing with different types: bool vs. num".

This patch adds a small but useful check to `e(tac)`: detecting seemingly identical
variables that in fact have different types.

```
  # g `f (x:num) = f 1`;;
  Warning: inventing type variables
  Warning: Free variables in goal: f, x
  val it : goalstack = 1 subgoal (1 total)

  `(f:num->?142774) x = (f:num->?142774) 1`

  # e (SUBGOAL_THEN `x = true` ASSUME_TAC);;
  Exception: Failure "var x appearing with different types: bool vs. num".
```
@jrh13
Copy link
Owner

jrh13 commented Aug 1, 2025

This looks like a very helpful sanity check, thank you! Since CHECK_VARTYPES_TAC is bound at the top level, perhaps it is worth adding a Help/CHECK_VARTYPES_TAC.hlp file for it?

@aqjune-aws
Copy link
Contributor Author

aqjune-aws commented Aug 1, 2025

Yes. I also updated e.hlp and included a small fix for #135 :)

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

Successfully merging this pull request may close these issues.

2 participants