mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
use the syntax <x : A> in PGF.Expr for typed expressions. This is consistent with the GF language
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
i -src testsuite/runtime/eval/Test.gf
|
||||
|
||||
pt -compute \x -> x 1 : (Int->Int)->Int
|
||||
pt -compute (? : Int -> Int) 1
|
||||
pt -compute (\x -> x 1 : (Int->Int)->Int) ?
|
||||
pt -compute <\x -> x 1 : (Int->Int)->Int>
|
||||
pt -compute <? : Int -> Int> 1
|
||||
pt -compute <\x -> x 1 : (Int->Int)->Int> ?
|
||||
pt -compute f 1 2
|
||||
pt -compute \x -> x : Nat -> Nat
|
||||
pt -compute ? : String
|
||||
pt -compute <\x -> x : Nat -> Nat>
|
||||
pt -compute <? : String>
|
||||
pt -compute f
|
||||
pt -compute (\x -> x 2 : (Int->Int)->Int) (f 1)
|
||||
pt -compute <\x -> x 2 : (Int->Int)->Int> (f 1)
|
||||
pt -compute g 1
|
||||
pt -compute g 0
|
||||
pt -compute \x -> g x : Int -> Int
|
||||
pt -compute <\x -> g x : Int -> Int>
|
||||
pt -compute g ?
|
||||
pt -compute (\x -> x 5 : (Int->Int)->Int) (g2 1)
|
||||
pt -compute (\x -> x 3 : (Int->Int)->Int) (\x -> x)
|
||||
pt -compute <\x -> x 5 : (Int->Int)->Int> (g2 1)
|
||||
pt -compute <\x -> x 3 : (Int->Int)->Int> (\x -> x)
|
||||
pt -compute g0
|
||||
pt -compute (\x -> x 32 : (Int -> Int -> Int) -> Int -> Int) (\x -> f x : Int -> Int -> Int)
|
||||
pt -compute <\x -> x 32 : (Int -> Int -> Int) -> Int -> Int> <\x -> f x : Int -> Int -> Int>
|
||||
pt -compute g0 23
|
||||
pt -compute const 3.14 "pi"
|
||||
pt -compute dec (succ (succ zero))
|
||||
pt -compute dec (succ ?)
|
||||
pt -compute \x -> dec x : Nat -> Nat
|
||||
pt -compute <\x -> dec x : Nat -> Nat>
|
||||
pt -compute dec ?
|
||||
pt -compute (\f -> f 0 : (Int -> Int) -> Int) (g3 ?)
|
||||
pt -compute <\f -> f 0 : (Int -> Int) -> Int> (g3 ?)
|
||||
pt -compute g (g2 ? 0)
|
||||
pt -compute plus (succ zero) (succ zero)
|
||||
pt -compute dec2 0 (succ zero)
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
i -src testsuite/runtime/typecheck/Test.gf
|
||||
|
||||
ai succ "0"
|
||||
ai succ : Int 0
|
||||
ai <succ : Int 0>
|
||||
ai 1 2
|
||||
ai (\x -> x 2 : (Int->Int)->Int) 1
|
||||
ai <\x -> x 2 : (Int->Int)->Int> 1
|
||||
ai unknown_fun
|
||||
ai 0 : unknown_cat
|
||||
ai <0 : unknown_cat>
|
||||
ai \x -> x
|
||||
ai \x -> x : Int
|
||||
ai <\x -> x : Int>
|
||||
ai append (succ (succ zero)) (succ zero) (vector (succ (succ zero))) (vector (succ zero))
|
||||
ai \m,n -> vector (plus m n) : (m,n : Nat) -> Vector (plus m n)
|
||||
ai <\m,n -> vector (plus m n) : (m,n : Nat) -> Vector (plus m n)>
|
||||
ai mkMorph (\x -> succ zero)
|
||||
ai idMorph (mkMorph (\x -> x))
|
||||
ai idMorph (mkMorph (\x -> succ zero))
|
||||
ai append zero (succ zero) : Vector zero -> Vector (succ zero) -> Vector (succ zero)
|
||||
ai \n,v1,n,v2 -> append ? ? v1 v2 : (n : Nat) -> Vector n -> (m : Nat) -> Vector m -> Vector (plus n m)
|
||||
ai \n -> (\v1,v2 -> eqVector n v1 v2 : Vector ? -> Vector ? -> EQ) (vector ?) : (n : Nat) -> Vector n -> EQ
|
||||
ai (\v1,v2 -> cmpVector ? v1 v2 : Vector ? -> Vector ? -> Int) (vector ?)
|
||||
ai <append zero (succ zero) : Vector zero -> Vector (succ zero) -> Vector (succ zero)>
|
||||
ai <\n,v1,n,v2 -> append ? ? v1 v2 : (n : Nat) -> Vector n -> (m : Nat) -> Vector m -> Vector (plus n m)>
|
||||
ai <\n -> <\v1,v2 -> eqVector n v1 v2 : Vector ? -> Vector ? -> EQ> (vector ?) : (n : Nat) -> Vector n -> EQ>
|
||||
ai <\v1,v2 -> cmpVector ? v1 v2 : Vector ? -> Vector ? -> Int> (vector ?)
|
||||
ai f0 ? vector
|
||||
ai f1 ? vector
|
||||
ai f1 ? (\x -> vector (succ x))
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
|
||||
Couldn't match expected type Nat
|
||||
|
||||
against inferred type String
|
||||
against inferred type String
|
||||
|
||||
|
||||
In the expression: "0"
|
||||
|
||||
|
||||
|
||||
|
||||
Category Int should have 0 argument(s), but has been given 1
|
||||
Category Int should have 0 argument(s), but has been given 1
|
||||
|
||||
In the type: Int 0
|
||||
@@ -20,17 +13,12 @@ Function unknown_fun is not in scope
|
||||
Couldn't match expected type Int -> Int
|
||||
|
||||
against inferred type Int
|
||||
|
||||
|
||||
|
||||
|
||||
Couldn't match expected type Int -> Int
|
||||
In the expression: 1
|
||||
against inferred type Int
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Function unknown_fun is not in scope
|
||||
|
||||
@@ -39,64 +27,48 @@ Type: Morph (\x -> succ zero)
|
||||
|
||||
|
||||
Category unknown_cat is not in scope
|
||||
|
||||
|
||||
Cannot infer the type of expression \x -> x
|
||||
|
||||
|
||||
|
||||
A function type is expected for the expression \x -> x instead of type Int
|
||||
|
||||
Expression: append (succ (succ zero)) (succ zero) (vector (succ (succ zero))) (vector (succ zero))
|
||||
|
||||
|
||||
Type: Vector (plus (succ (succ zero)) (succ zero))
|
||||
|
||||
|
||||
|
||||
A function type is expected for the expression \x -> x instead of type Int
|
||||
|
||||
|
||||
Expression: <\m, n -> vector (plus m n) : (m : Nat) -> (n : Nat) -> Vector (plus m n)>
|
||||
|
||||
Expression: append (succ (succ zero)) (succ zero) (vector (succ (succ zero))) (vector (succ zero))
|
||||
Type: (m : Nat) -> (n : Nat) -> Vector (plus m n)
|
||||
|
||||
|
||||
|
||||
|
||||
Expression: mkMorph (\x -> succ zero)
|
||||
|
||||
Type: Morph (\x -> succ zero)
|
||||
|
||||
|
||||
|
||||
|
||||
Expression: idMorph (mkMorph (\x -> x))
|
||||
|
||||
|
||||
|
||||
Type: Nat
|
||||
|
||||
|
||||
Type: Nat
|
||||
|
||||
Couldn't match expected type Morph (\x -> x)
|
||||
|
||||
|
||||
against inferred type Morph (\x -> succ zero)
|
||||
|
||||
In the expression: mkMorph (\x -> succ zero)
|
||||
against inferred type Morph (\x -> succ zero)
|
||||
|
||||
|
||||
Expression: <append zero (succ zero) : Vector zero -> Vector (succ zero) -> Vector (succ zero)>
|
||||
|
||||
|
||||
Type: Vector zero -> Vector (succ zero) -> Vector (succ zero)
|
||||
|
||||
|
||||
|
||||
Expression: <\n, v1, n'1, v2 -> append n n'1 v1 v2 : (n : Nat) -> Vector n -> (m : Nat) -> Vector m -> Vector (plus n m)>
|
||||
|
||||
|
||||
Type: (n : Nat) -> Vector n -> (m : Nat) -> Vector m -> Vector (plus n m)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user