definition:
|
showPlTerm :: PlTerm -> String
showPlTerm (PlVar v) = v
showPlTerm (PlAtom a) = showPlAtom a
showPlTerm (PlInt i) = show i
showPlTerm (PlFloat f) = show f
showPlTerm (PlStruct f []) = showPlAtom f
showPlTerm (PlStruct f args@(h:t))
| f=="." && length args == 2 -- a Prolog list
= "[" ++ showPlTerm h ++ showPlListElems (head t) ++ "]"
| (f=="," || all (`elem` specialChars) f) && length args == 2 -- infix op
= "(" ++ showPlTerm (args!!0) ++ f ++ showPlTerm (args!!1) ++ ")"
| otherwise
= showPlAtom f ++ "(" ++ intercalate "," (map showPlTerm args) ++ ")"
|
demand:
|
argument 1
|
deterministic:
|
deterministic operation
|
documentation:
|
--- Shows a Prolog term in standard Prolog syntax.
|
failfree:
|
<FAILING>
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{({PlVar}) |-> _ || ({PlAtom}) |-> _ || ({PlInt}) |-> _ || ({PlFloat}) |-> _ || ({PlStruct}) |-> _}
|
name:
|
showPlTerm
|
precedence:
|
no precedence defined
|
result-values:
|
_
|
signature:
|
Language.Prolog.Types.PlTerm -> String
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|