<commit_before>/* $Id: lift-error.c 12896 2004-03-11 12:21:39Z kooiker $ */

/*{{{  includes */

#include <stdio.h>
#include <unistd.h>
#include <aterm2.h>
#include <atb-tool.h>

#include "RStore-utils.h"
#include <ParsedRStore.h>
#include <RStore.h>
#include "lift-rstore.h"

/*}}}  */
/*{{{  globals */

static char myname[]    = "lift-error";
static char myversion[] = "1.1";
static char myarguments[] = "hi:o:tV";

/*}}}  */

/*{{{  void usage(void) */

void usage(void)
{
    fprintf(stderr,
	"This tool lifts abstract rstores to parsed rstores\n"
        "Usage: %s -h -i arg -o arg -Vt . . .\n"
        "Options:\n"
        "\t-h              display help information (usage)\n"
        "\t-i filename     input from file (default stdin)\n"
        "\t-o filename     output to file (default stdout)\n"
	"\t-t              output textual instead of binary (default off)\n"
        "\t-V              reveal program version (i.e. %s)\n",
        myname, myversion);
}

/*}}}  */

/*{{{  ATerm lift_rstore(int cid, ATerm in) */

ATerm lift_rstore(int cid, ATerm in)
{
  ATerm input = ATBunpack(in);
  PRS_OptLayout e = PRS_makeOptLayoutAbsent();
  PRS_RStore result = PRS_makeRStoreRstore(e, e, e, 
                                           PRS_makeRTupleRtuplesEmpty(), e, e);

  if (RS_isValidRStore(RS_RStoreFromTerm(input))) {
    result = RS_liftRStore(RS_RStoreFromTerm(input));
  }

  return ATmake("snd-value(lifted-rstore(<term>))", result);
}

/*}}}  */
/*{{{  ATerm lift_rstore(int cid, ATerm in) */

ATerm lift_rtuple(int cid, ATerm in)
{
  ATerm input = ATBunpack(in);
  PRS_OptLayout e = PRS_makeOptLayoutAbsent();
  PRS_RTuple result = PRS_makeRTupleRTuple();

  if (RS_isValidRTuple(RS_RTupleFromTerm(input))) {
    result = RS_liftRTuple(RS_RTupleFromTerm(input));
  }

  return ATmake("snd-value(lifted-rtuple(<term>))", result);
}

/*}}}  */

/*{{{  int rec_terminate(int cid) */
<commit_msg>* fixed minor bug<commit_after>/* $Id: lift-error.c 12896 2004-03-11 12:21:39Z kooiker $ */

/*{{{  includes */

#include <stdio.h>
#include <unistd.h>
#include <aterm2.h>
#include <atb-tool.h>

#include "RStore-utils.h"
#include <ParsedRStore.h>
#include <RStore.h>
#include "lift-rstore.h"

/*}}}  */
/*{{{  globals */

static char myname[]    = "lift-error";
static char myversion[] = "1.1";
static char myarguments[] = "hi:o:tV";

/*}}}  */

/*{{{  void usage(void) */

void usage(void)
{
    fprintf(stderr,
	"This tool lifts abstract rstores to parsed rstores\n"
        "Usage: %s -h -i arg -o arg -Vt . . .\n"
        "Options:\n"
        "\t-h              display help information (usage)\n"
        "\t-i filename     input from file (default stdin)\n"
        "\t-o filename     output to file (default stdout)\n"
	"\t-t              output textual instead of binary (default off)\n"
        "\t-V              reveal program version (i.e. %s)\n",
        myname, myversion);
}

/*}}}  */

/*{{{  ATerm lift_rstore(int cid, ATerm in) */

ATerm lift_rstore(int cid, ATerm in)
{
  ATerm input = ATBunpack(in);
  PRS_OptLayout e = PRS_makeOptLayoutAbsent();
  PRS_RStore result = PRS_makeRStoreRstore(e, e, e, 
                                           PRS_makeRTupleRtuplesEmpty(), e, e);

  if (RS_isValidRStore(RS_RStoreFromTerm(input))) {
    result = RS_liftRStore(RS_RStoreFromTerm(input));
  }

  return ATmake("snd-value(lifted-rstore(<term>))", result);
}

/*}}}  */
/*{{{  ATerm lift_rstore(int cid, ATerm in) */

ATerm lift_rtuple(int cid, ATerm in)
{
  ATerm input = ATBunpack(in);
  RS_RTuple temp = RS_makeRTupleRtuple(RS_makeIdConIdCon("*failed*"),
				       RS_makeRTypeBool(),
				       RS_makeRElemBool(RS_makeBoolConFalse()));
  PRS_RTuple result = RS_liftRTuple(temp);

  if (RS_isValidRTuple(RS_RTupleFromTerm(input))) {
    result = RS_liftRTuple(RS_RTupleFromTerm(input));
  }

  return ATmake("snd-value(lifted-rtuple(<term>))", result);
}

/*}}}  */

/*{{{  int rec_terminate(int cid) */

{'fraction_non_alphanumeric': 0.16818873668188736, 'fraction_numerical': 0.011161846778285134, 'mean_word_length': 2.8962450592885376, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3710411', 'n_tokens_mistral': 1578, 'n_tokens_neox': 1507, 'n_words': 315}