Skip to content
Snippets Groups Projects
Commit e00fa71b authored by Hichem R. A.'s avatar Hichem R. A. Committed by François Bobot
Browse files

[NSeq] Added the nseq_content builtin

parent 41004c69
No related branches found
No related tags found
1 merge request!27New array and sequence theory
...@@ -25,6 +25,7 @@ module Builtin = struct ...@@ -25,6 +25,7 @@ module Builtin = struct
| NSeq | NSeq
| NSeq_first | NSeq_first
| NSeq_last | NSeq_last
| NSeq_content
| NSeq_length | NSeq_length
| NSeq_get | NSeq_get
| NSeq_set | NSeq_set
...@@ -56,6 +57,12 @@ module Builtin = struct ...@@ -56,6 +57,12 @@ module Builtin = struct
(Dolmen_std.Path.global "nseq_last") (Dolmen_std.Path.global "nseq_last")
(Expr.Ty.pi [ val_ty_var ] (Expr.Ty.arrow [ val_nseq_ty ] int_ty)) (Expr.Ty.pi [ val_ty_var ] (Expr.Ty.arrow [ val_nseq_ty ] int_ty))
let nseq_content : Dolmen_std.Expr.term_cst =
Expr.Id.mk ~name:"nseq_content" ~builtin:NSeq_content
(Dolmen_std.Path.global "nseq_content")
(Expr.Ty.pi [ val_ty_var ]
(Expr.Ty.arrow [ val_nseq_ty ] (Expr.Ty.arrow [ int_ty ] val_ty)))
let nseq_length : Dolmen_std.Expr.term_cst = let nseq_length : Dolmen_std.Expr.term_cst =
Expr.Id.mk ~name:"nseq_length" ~builtin:NSeq_length Expr.Id.mk ~name:"nseq_length" ~builtin:NSeq_length
(Dolmen_std.Path.global "nseq_length") (Dolmen_std.Path.global "nseq_length")
...@@ -152,6 +159,8 @@ module Builtin = struct ...@@ -152,6 +159,8 @@ module Builtin = struct
app1 env s nseq_first app1 env s nseq_first
| Dolmen_loop.Typer.T.Id { ns = Term; name = Simple "nseq_last" } -> | Dolmen_loop.Typer.T.Id { ns = Term; name = Simple "nseq_last" } ->
app1 env s nseq_last app1 env s nseq_last
| Dolmen_loop.Typer.T.Id { ns = Term; name = Simple "nseq_content" } ->
app1 env s nseq_content
| Dolmen_loop.Typer.T.Id { ns = Term; name = Simple "nseq_length" } -> | Dolmen_loop.Typer.T.Id { ns = Term; name = Simple "nseq_length" } ->
app1 env s nseq_length app1 env s nseq_length
| Dolmen_loop.Typer.T.Id { ns = Term; name = Simple "nseq_get" } -> | Dolmen_loop.Typer.T.Id { ns = Term; name = Simple "nseq_get" } ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment