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://gitlab.inria.fr/line/aide-group/macrovsa
04 May 2026, 13:41:51 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    No releases to show
  • d85ce8c
  • /
  • src
  • /
  • pizza_experiments.C
Raw File Download Save again
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
swh:1:cnt:d68560ec13615dc03e136b653b32dcf9af44808c
origin badgedirectory badge
swh:1:dir:b8157120e03f8858febdc76e496e300e843c5750
origin badgerevision badge
swh:1:rev:31a87d848f8ab28a06ccf77d0b359fc966974138
origin badgesnapshot badge
swh:1:snp:ffb1e6ef77e78b82672462770a7171c80c299b3b

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
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 31a87d848f8ab28a06ccf77d0b359fc966974138 authored by vthierry on 15 December 2025, 21:31:50 UTC
sync from makefile
Tip revision: 31a87d8
pizza_experiments.C
#include "macrovsa.hpp"
#include "time.hpp"
using namespace macrovsa;

/* Experiment corresponding to the (Viéville & Mercier 2024) draft
 * @param {bool} [with_RDFSS = true] Defines if we add extra RDFSs supplementary inferences.
 * @param {double} [tau_eat = 1] Defines if exact (tau_eat = 1) or approximate (tau_eat = 0.5) inference on eating.
 * @param {String} [trace = "ado"] Level of trace as defined Rules.hpp.
 */
void pizza_experiment(bool with_RDFSS = true, double tau_eat = 1, String trace = "ado")
{
  printf("pizza_experiment(bool with_RDFSS = %d, double tau_eat = %f, String trace = '%s'\n", with_RDFSS, tau_eat, trace.c_str());
  class SomeRules: public Rules {
public:
    SomeRules(String trace, bool with_RDFSS) : Rules(0, trace) {
      //
      // RDFS segment entailment rules
      //
      // ClassInheritance
      Rule_2(rdfs9,
             // getTau()
             return algo::conj(algo::sim(predicate_1, "rdf:type"), algo::sim(object_1, subject_2), algo::sim(predicate_2, "rdfs:subClassOf"));
             ,
             // setOutput()
             output.add(*subject_1, tau, "rdf:type", *object_2);
             );
      // ClassTransitivity
      Rule_2(rdfs11,
             // getTau()
             return algo::conj(algo::sim(predicate_1, "rdfs:subClassOf"), algo::sim(object_1, subject_2), algo::sim(predicate_2, "rdfs:subClassOf"));
             ,
             // setOutput()
             output.add(*subject_1, tau, "rdfs:subClassOf", *object_2);
             );
      // DomainInference
      Rule_2(rdfs2,
             // getTau()
             return algo::conj(algo::sim(predicate_1, subject_2), algo::sim(predicate_2, "rdfs:domain"));
             ,
             // setOutput()
             output.add(*subject_1, tau, "rdf:type", *object_2);
             );
      // RangeInference
      Rule_2(rdfs3,
             // getTau()
             return algo::conj(algo::sim(predicate_1, subject_2), algo::sim(predicate_2, "rdfs:range"));
             ,
             // setOutput()
             output.add(*object_1, tau, "rdf:type", *object_2);
             );
      // PropertyInference
      Rule_2(rdfs7,
             // getTau()
             return algo::conj(algo::sim(predicate_1, subject_2), algo::sim(predicate_2, "rdfs:subPropertyOf"));
             ,
             // setOutput()
             output.add(*subject_1, tau, *object_2, *object_1);
             );
      //
      // Additional entailment rules to infer node types
      // - Note: this is mainly used to examplify and test Rule_1 and Rule_3 macro and multiple outputs
      //
      if(with_RDFSS) {
        // PropertyTypeInference
        Rule_1(rdf1,
               // getTau()
               return 1;
               ,
               // setOutput()
               output.add(*predicate_1, "rdf:type", "rdfs:Property");
               );
        // ClassTypeInference
        Rule_1(rdfss1,
               // getTau()
               return algo::sim(predicate_1, "rdf:type");
               ,
               // setOutput()
               output.add(*object_1, tau, "rdf:type", "rdfs:Class");
               );
        Rule_1(rdfss2,
               // getTau()
               return algo::sim(predicate_1, "rdfs:subClassOf");
               ,
               // setOutput()
               output.add(*subject_1, tau, "rdf:type", "rdfs:Class");
               output.add(*object_1, tau, "rdf:type", "rdfs:Class");
               );
        Rule_1(rdfss3,
               // getTau()
               return algo::sim(predicate_1, "rdfs:subPropertyOf");
               ,
               // setOutput()
               output.add(*subject_1, tau, "rdf:type", "rdfs:Property");
               output.add(*object_1, tau, "rdf:type", "rdfs:Property");
               );
        // PropertyClassInheritance
        Rule_3(rdfss9,
               // getTau()
               return algo::conj(algo::sim(predicate_1, "rdf:type"), algo::sim(object_1, subject_2), algo::sim(predicate_2, subject_3), algo::sim(predicate_3, "rdf:type"), algo::sim(object_3, "rdfs:Property"));
               ,
               // setOutput()
               output.add(*subject_1, tau, *predicate_2, *object_2);
               );
      }
    }
  }
  someRules(trace, with_RDFSS);

  // Defines incoming facts
  RelationalMap incoming("Luigi pizza incomimg facts");
  incoming.add("Luigi", tau_eat, "eats", "thisPizza");
  incoming.add("eats", "rdfs:domain", "Person");
  incoming.add("eats", "rdfs:range", "Food");
  incoming.add("thisPizza", "rdf:type", "MagheritaPizza");
  incoming.add("thisPizza", "hasTopping", "thisMozzarella");
  incoming.add("MagheritaPizza", "rdfs:subClassOf", "Pizza");
  incoming.add("Pizza", "rdfs:subClassOf", "Food");
  incoming.add("hasTopping", "rdfs:subPropertyOf", "hasIngredient");
  incoming.add("MagheritaPizza", "hasTopping", "Tomato");

  // Runs inference
  RelationalMap infered("Luigi pizza infered facts");
  aidesys::now(false, false);
  someRules.apply(infered, incoming);
  printf("Calculus duration in msec : %.3f\n", aidesys::now(false, true));
  printf("%s\n", infered.asString().c_str());
}
int main()
{
  pizza_experiment(false, 1, "ado");
  pizza_experiment(false, 1, "");
  pizza_experiment(false, 0.5, "");
  pizza_experiment(true, 1, "");
  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