Skip to content

Pulse expects type constructors to be injective #495

@gebner

Description

@gebner

The following is code that works in F*, but not in Pulse:

module Natlt
open Pulse.Nolib
#lang-pulse

let natlt (n: nat) = i:nat { i < n }

let works #n (x: natlt n -> bool) (i: nat { i < n }) =
  let a: (natlt i -> bool) = x in
  ()

fn doesnt_work #n (x: natlt n -> bool) (i: nat { i < n }) {
  let a: (natlt i -> bool) = x;
  ()
}

Looking at the debugging output, the core type checker produces the guard forall (_: Natlt.natlt i). i == n which is obviously not provable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions