I'm using F* 0.9.6.0 and I can't get this simple program to pass subtyping checks:
module Test
open FStar.String
let minlen s n = strlen s >= n
let maxlen s n = strlen s <= n
let isLanguageValid s = (minlen s 2) && (maxlen s 8)
type language = s : string { isLanguageValid s }
let english : language = "en"
let invalid : language = "abcdefghi"
I would expect english
to pass but invalid
to fail. Everything I've tried either leads to both of them being rejected, or both being accepted. What am I doing wrong? I'd just like to accept strings of certain lengths for this type.