Skip to main content

No project description provided

Project description

yapy-arm64

PyPI

🐍 Yet Another (ARM) Plagiarism, plagiarism detector for ARM64 source code with Lark

yapy is a tool used to detect and discourage the punishable copying of student exercise programs written in ARM64 (AArch64) for the Fundamentals of Computer Systems and Computer Architecture course units of the Bachelor in Informatics and Computing Engineering at Faculdade de Engenharia da Universidade do Porto.

Installation with the PyPI package

pip install yapy-arm64

Overview

yapy uses Lark to build an abstract syntax tree to ARM64 code.

The grammar built only provides the rules necessary for parsing code used with the instructions available for the two courses lectured.

After build the abstract syntax tree, the tree is transformed into a bag of tokens represented as an hash table with the key being each valuable token and the value the number of occurrences of that token.

Finally, the similarity between two files is calculated with Sørensen–Dice coefficient.

What doest it prevent?

  • Comments
  • Label name changes
  • Register allocation changes
  • Adding of redundant instructions
  • Switching the order of instructions
  • Switching the order of whole block of instructions

Usage

from yapy import PlagiarismCompare
from yapy.score.similarity_score import sorensen_dice_coefficient

# You could either pass an argument path specifying the path to look for files or pass a list of files with files=[...]
# If no threshold is set the comparison will return the similarity between all files found
p_compare = PlagiarismCompare(path='test/resources/directory', threshold=0.965)
p_compare.compare(sorensen_dice_coefficient)

json_result = p_compare.json_formatter.format_suspicious()
html_result = p_compare.html_formatter.format_suspicious()
csv_result = p_compare.csv_formatter.format_suspicious()

print(json_result) # will actually print all pairs of files with similarity above 0.965

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yapy-arm64-1.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

yapy_arm64-1.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file yapy-arm64-1.0.tar.gz.

File metadata

  • Download URL: yapy-arm64-1.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for yapy-arm64-1.0.tar.gz
Algorithm Hash digest
SHA256 0fa1a7cbd488abc30c554bb1bd284feca996a8cd0f129bd5c62306d71cb6b0e8
MD5 e65a379eebf7a6270a2827b976542e3c
BLAKE2b-256 adc605efd57d0d0af46ce3ac693139b5660c7191d015e0e9e563f2ed644d18b3

See more details on using hashes here.

File details

Details for the file yapy_arm64-1.0-py3-none-any.whl.

File metadata

  • Download URL: yapy_arm64-1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for yapy_arm64-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f99e79f1067008944219e6c462f0fefc11bcd3b5e946df747c062835378dd13
MD5 78afed7aaa91e122a405d9024e2aeb1d
BLAKE2b-256 8a62f33e1cb9afd5d3e877c5bcdecdcec33c6fd40d6ff2cafb9cadd56c54ddb3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page