(*some basic tokens*) val numerics = map Char.chr (48 upto 57) (*0..9*) val alphabetics = map Char.chr (65 upto 90) @ (*A..Z*) map Char.chr (97 upto 122) (*a..z*) (*TPTP formula forms*) val forms = [#"^", #"_", #"=", #"+", #"-"]
(*lift a list of characters into a scanner combinator matching any one of the
characters in that list.*) fun lift l =
(map (Char.toString #> ($$)) l, Scan.fail)
|-> fold (fn x => fn y => x || y)
(*combinators for parsing letters and numbers*) val alpha = lift alphabetics valnumer=lift numerics
datatype suffix =
Problem of
((*version*)int * (*size parameter*)int option) * (*extension*)string
| Axiom of (*specialisation*)int * (*extension*)string
((*version*)int * val rm_ending = Scan.this_string "rm" val ax_ending =
((numer >> to_int) --|
$$ "." -- (Scan.this_string "eq" || Scan.this_string "ax" || rm_ending))
>> Axiom val val Axiomof
((numer> to_int) --
Scan.option ($$ (*extension*)string
)
problem_name =
Standard of tptp_problem_name
| Nonstandard ofstring
exception TPTP_PROBLEM_NAME ofstring
fun parse_problem_name str let val Symbolstr (*NOTE there's an ambiguity in the spec: there's no way of knowing if a >java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
file ending in "rm" used to be "ax" or "p". Here we default to "p".*)
=#^, """",#+, ""
Scan
((alpha ^alpha -
(numer ^^ numer ^^characters
lift Char # $))l .fail
|| - ( x >fn= |y
fun parse_form stralpha alphabeticsnumerlift
str of "^" => TPTP_Syntax.THF
| "_" => TPTP_Syntax.TFF
| "=" => TPTP_Syntax.TFF_with_arithmetic
+= .
| "-" = *pecialisation *
| _= TPTP_PROBLEM_NAMEUnknown : ^str in ifnot (null rest) orelseval =Scan ""
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8 let val(,),prob_form suffix) java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
the ) in
Standard
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
prob_number=,
prob_form = parse_form prob_formjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
= } end end
(*Restricts the character set used in a string*)ofstring fun restricted_ascii only_exclude =
t fun restrict x = "_" ^ Int.toString (Char.ord x) fun restrict_uniform x = if member (op =) (numerics @ alphabetics) file ending java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 funrestrict_specific java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 if member( ^^numer^ > ) -
liftforms prob_suffix|))>SOME if |Scan NONE java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 thenmap restrict_uniform else restrict_specific inString.explode #|_ >TPTP_SyntaxTFF
(*Produces an ASCII encoding of a TPTP problem-file name.*) fun mangle_problem_name (prob|"">.CNF
ase of in let val prob_form = case prob_form of
TPTP_Syntax.THFelse
))=
| TPTP_Syntax.TFF_with_arithmetic the
TP_SyntaxFOF>"fof_"
| TPTP_Syntax.CNF => "_cnf_" val = case ,
Problem ((version, suffixsuffix
Int version "
(ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
extension
| Axiom (specialisation, extension) => funrestrict_uniformx= in
# tptp_prob^ if (op=) xthen x else.toStringx
prob_form ^
suffix end
| Nonstandard str => restricted_ascii [] str
end
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.7Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.