spc Usage
The page describes the different functions of spc.
An spc-command starts with a mode followed by a number of required arguments
and then followed by options and flags (optional). The required arguments are
determined by the mode. If the mode argument is omitted then spc tries to infer
it from the file extension of the first argument.
Mode compile
spc --mode=compile FileName.hsspc FileName.hs(only works with file extension.hs)
Reads a Haskell source code file and loads the sp-programs which it references.
Then it translates them into Haskell code and inserts them into this file.
The sp-programs must be stored in a directory with the same name as the
filename without the extension. For example, an sp-program called bubbleSort
referenced from FileName.hs must be stored in FileName/bubbleSort.sp.
Options:
-
--outputFile=xyz.hswrites output to a different file -
--remOpt=optionKeyignores any options in the sp-files with the given key --defOpt=optionif an sp-file does not contain an option with the same key then this one is used (default option). if option contains whitespaces then enclose it in", e.g."--defOpt=TRANSLATION Production"--setOpt=optionforces option even if the sp-file contains a different one (same as combining--remOptand--defOpt)
Flags:
--printOutputcauses output to be printed to the terminal instead of overwriting the source code file--clearremoves everything between--START OF PROGRAM xxxand--END OF PROGRAM xxx
Mode transpile
spc --mode=transpile programName.spspc programName.sp(only works with file extension.sp)
Loads an sp-program and translates it into Haskell code. The result it written
to programName.hs.
Options:
--outputFile=xyz.hswrites output to a different file--remOpt=optionKeysame as incompile-mode--defOpt=optionsame as incompile-mode--setOpt=optionsame as incompile-mode
Flags:
--printOutputcauses output to be printed to the terminal instead of writing it to a file
Mode compare
spc --mode=compare trace1.csv trace2.csvspc trace1.csv trace2.csv(only works with file extension.csv)
Compares two execution traces and determines if they are equal or not.
Flags:
--onlyOpsonly compares the operation columns of the two traces--onlyValuesonly compares the variable columns of the two traces
Mode compareDirs
spc --mode=compareDirs dir1 dir2
Compares every trace in directory dir1 with a trace which has the same filename
in the directory dir2. Every file with the extension .csv is assumed to be a
trace. The result is printed to the terminal.
Flags:
--omitEqualif two traces are equal they are omitted from the result--omitSubtrace12if the trace fromdir1is a subtrace of the one fromdir2then they are omitted from the result--omitSubtrace21analogous to the previous flag--onlyOpssame as in--mode=compare--onlyValuessame as in--mode=compare
Mode coverage
spc --mode=coverage programName.sp traceDir
Prints the code coverage of the sp-program based on the traces in traceDir.
Flags:
--omitBdtsdoes not include paths of BDTs in the result
Mode failedTraces
spc --mode=failedTraces traceDir
Prints every trace in traceDir which contains a failed operation or predicate.