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

Raw File Download

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
content badge
swh:1:cnt:59c55d5cc38535ff7085c6ba0deee48dc489e0bc

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
(requires biblatex-software package)
Generating citation ...
#include "macrovsa.hpp"

using namespace macrovsa;

int main()
{
  // Tests the basic belief, symbol, bundling, binding, and reduce, sim mechanisms via an associative map
  {
    Symbol y("y"), x("x"), z("z");
    AssociativeMap map("test1");
    map.add(x, y), map.add(x, z), map.add(y, x);
    const Symbol& m_x = map.get(x);
    Belief x_m_x = algo::sim(x, m_x), y_m_x = algo::sim(y, m_x);
    aidesys::alert(x_m_x.tau != 0 || y_m_x.tau != 1, "  illegal-state", "in macrovsa/test spurious result on basic data structures (x: '" + x.asString() + "' · map[x]: '" + m_x.asString() + "') = '" + x_m_x.asString() + "' (y: '" + y.asString() + "' · map[x]) = '" + y_m_x.asString() + "'");
  }
  // Tests the vector mesoscopic mechanisms
  {
    Symbol y("y"), x("x"), z("z");
    AssociativeMap map("test2");
    map.add(x, y), map.add(x, z), map.add(y, x);
    const Symbol& m_x = map.get(x);
    double x_m_x = algo::msim(x, m_x), y_m_x = algo::msim(y, m_x);
    aidesys::alert(fabs(x_m_x) > 0.1 || fabs(y_m_x) < 0.9, "  illegal-state", "in macrovsa/test spurious result on basic mesoscopic mechanism : (x · map[x]) = %f (y · map[x]) = %f", x_m_x, y_m_x);
  }
  // Tests the JSON syntax input output
  {
    const Symbol& symbol = Symbol::fromJSON("[ {b y: c x: [a b]}]");
    aidesys::alert(Symbol::toJSON(symbol) != Symbol::toJSON(Symbol::fromJSON(Symbol::toJSON(symbol))), "  illegal-state", "in macrovsa/test spurious result getSymbol/asString correspondance " + Symbol::toJSON(symbol) + " != " + Symbol::toJSON(Symbol::fromJSON(Symbol::toJSON(symbol))));
  }
  //
  return 0;
}

back to top

Software Heritage — Copyright (C) 2015–2026, 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