Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/FujiiMaika/fscd21.git
14 October 2025, 14:49:57 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    • ea403bcbbae3477540fd253d060af773fd16b72c
    No releases to show
  • 22b5f6d
  • /
  • eval7
  • /
  • eval.ml
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:3c344c69fefb3741b25d519c4c52dd477a1f162e
origin badgedirectory badge Iframe embedding
swh:1:dir:5a2c290a9c10fbae608631aff7bbcb31c7b0a963
origin badgerevision badge
swh:1:rev:ea403bcbbae3477540fd253d060af773fd16b72c
origin badgesnapshot badge
swh:1:snp:cce046a850a15c88a6908ba792dd848f1a78f852

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: ea403bcbbae3477540fd253d060af773fd16b72c authored by Maika Fujii on 24 June 2021, 05:44:21 UTC
Update README.md
Tip revision: ea403bc
eval.ml
open Syntax
open Value

(* Interpreter with combined arguments : eval7 *)

(* initial continuation : s -> t -> m -> v *)
let idc s t m = match s with
    v :: [] ->
    begin match t with
        TNil ->
        begin match m with
            MNil -> v
          | MCons ((c, s, t), m) -> c (v :: s) t m
        end
      | Trail (h) -> h v TNil m
    end
  | _ -> failwith "stack error"

(* cons : (v -> t -> m -> v) -> t -> t *)
let rec cons h t = match t with
    TNil -> Trail (h)
  | Trail (h') -> Trail (fun v t' m -> h v (cons h' t') m)

(* apnd : t -> t -> t *)
let apnd t0 t1 = match t0 with
    TNil -> t1
  | Trail (h) -> cons h t1

(* f7 : e -> string list -> c -> s -> t -> m -> v *)
let rec f7 e xs c s t m = match s with
    VEnv (vs) :: s ->
    begin match e with
        Num (n) -> c (VNum (n) :: s) t m 
      | Var (x) -> c ((List.nth vs (Env.offset x xs)) :: s) t m
      | Op (e0, op, e1) ->
        f7 e0 xs (fun s0 t0 m0 ->
            begin match s0 with
                v0 :: VEnv (vs) :: s0 ->
                f7 e1 xs (fun s1 t1 m1 ->
                    begin match s1 with
                        v1 :: v0 :: s1 ->
                        begin match (v0, v1) with
                            (VNum (n0), VNum (n1)) ->
                            begin match op with
                                Plus -> c (VNum (n0 + n1) :: s1) t1 m1
                              | Minus -> c (VNum (n0 - n1) :: s1) t1 m1
                              | Times -> c (VNum (n0 * n1) :: s1) t1 m1
                              | Divide ->
                                if n1 = 0 then failwith "Division by zero"
                                else c (VNum (n0 / n1) :: s1) t1 m1
                            end
                          | _ -> failwith (to_string v0 ^ " or " ^ to_string v1
                                           ^ " are not numbers")
                        end
                      | _ -> failwith "stack error"
                    end) (VEnv (vs) :: v0 :: s0) t0 m0
              | _ -> failwith "stack error"
            end) (VEnv (vs) :: VEnv (vs) :: s) t m
      | Fun (x, e) ->
        let vfun = VFun (fun c' s' t' m' ->
            begin match s' with
                v :: s' -> f7 e (x :: xs) c' (VEnv (v :: vs) :: s') t' m'
              | _ -> failwith "stack error"
            end) in
        c (vfun :: s) t m
      | App (e0, e1) ->
        f7 e0 xs (fun s0 t0 m0 ->
            begin match s0 with
                v0 :: VEnv (vs) :: s0 ->
                f7 e1 xs (fun s1 t1 m1 ->
                    begin match s1 with
                        v1 :: v0 :: s1 ->
                        begin match v0 with
                            VFun (f) -> f c (v1 :: s1) t1 m1
                          | VContS (c', s', t') ->
                            c' (v1 :: s') t' (MCons ((c, s1, t1), m1))
                          | VContC (c', s', t') ->
                            c' (v1 :: s')
                              (apnd t' (cons (fun v t m -> c (v :: s1) t m) t1))
                              m1
                          | _ -> failwith (to_string v0
                               ^ " is not a function; it can not be applied.")
                        end
                      | _ -> failwith "stack error"
                    end) (VEnv (vs) :: v0 :: s0) t0 m0
              | _ -> failwith "stack error"
            end) (VEnv (vs) :: VEnv (vs) :: s) t m
      | Shift (x, e) ->
        f7 e (x :: xs) idc (VEnv (VContS (c, s, t) :: vs) :: []) TNil m
      | Control (x, e) ->
        f7 e (x :: xs) idc (VEnv (VContC (c, s, t) :: vs) :: []) TNil m
      | Shift0 (x, e) ->
        begin match m with
            MCons ((c0, s0, t0), m0) ->
            f7 e (x :: xs) c0 (VEnv (VContS (c, s, t) :: vs) :: s0) t0 m0
          | _ -> failwith "shift0 is used without enclosing reset"
        end
      | Control0 (x, e) ->
        begin match m with
            MCons ((c0, s0, t0), m0) ->
            f7 e (x :: xs) c0 (VEnv (VContC (c, s, t) :: vs) :: s0) t0 m0
          | _ -> failwith "control0 is used without enclosing reset"
        end
      | Reset (e) -> f7 e xs idc (VEnv (vs) :: []) TNil (MCons ((c, s, t), m))
    end
  | _ -> failwith "stack error"
           
(* f : e -> v *)
let f expr = f7 expr [] idc (VEnv ([]) :: []) TNil MNil

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API