/usr/local/lib/swipl/library/prolog_source.pl
All Application Manual Name SummaryHelp

  • swipl
    • library
      • error.pl
      • debug.pl
      • apply.pl
      • lists.pl
      • broadcast.pl
      • shlib.pl
      • option.pl
      • thread_pool.pl
      • gensym.pl
      • settings.pl
      • arithmetic.pl
      • main.pl
      • readutil.pl
      • operators.pl
      • pairs.pl
      • prolog_source.pl -- Examine Prolog source-files
        • quasi_quotation_syntax/2
        • xref_open_source/2
        • xref_close_source/2
        • prolog_read_source_term/4
        • requires_library/2
        • load_quasi_quotation_syntax/2
        • read_source_term_at_location/3
        • prolog_file_directives/3
        • prolog_open_source/2
        • prolog_close_source/1
        • prolog_canonical_source/2
        • file_name_on_path/2
        • file_alias_path/2
        • path_segments_atom/2
        • directory_source_files/3
        • valid_term_position/2
      • record.pl
      • quasi_quotations.pl
      • pure_input.pl
      • solution_sequences.pl
      • ordsets.pl
      • random.pl
      • base64.pl
      • aggregate.pl
      • yall.pl
      • sandbox.pl
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • assoc.pl
      • prolog_format.pl
      • predicate_options.pl
      • csv.pl
      • pprint.pl
      • atom.pl
      • modules.pl
      • occurs.pl
      • prolog_xref.pl -- Prolog cross-referencer data collection
      • prolog_colour.pl
      • lazy_lists.pl -- Lazy list handling
      • ugraphs.pl
      • url.pl
      • www_browser.pl
      • prolog_pack.pl
      • git.pl
      • rbtrees.pl -- Red black trees
      • dif.pl -- The dif/2 constraint
      • charsio.pl -- I/O on Lists of Character Codes
      • prolog_stack.pl
      • edinburgh.pl -- Some traditional Edinburgh predicates
      • prolog_clause.pl
      • prolog_breakpoints.pl
      • wfs.pl
      • dialect.pl
      • prolog_code.pl
      • sort.pl
      • iostream.pl -- Utilities to deal with streams
      • dicts.pl
      • varnumbers.pl
      • thread.pl -- High level thread primitives
      • base32.pl -- Base32 encoding and decoding
      • codesio.pl
      • coinduction.pl -- Co-Logic Programming
      • date.pl -- Process dates and times
      • heaps.pl -- heaps/priority queues
      • statistics.pl
      • terms.pl -- Term manipulation
      • utf8.pl
      • when.pl
      • backcomp.pl
      • optparse.pl
      • ansi_term.pl -- Print decorated text to ANSI consoles
      • prolog_versions.pl -- Demand specific (Prolog) versions
      • intercept.pl
      • listing.pl -- List programs and pretty print clauses
      • shell.pl
      • prolog_config.pl
      • qsave.pl
      • zip.pl
      • threadutil.pl -- Interactive thread utilities
      • nb_set.pl
      • exceptions.pl
      • streams.pl -- Manage Prolog streams
      • prolog_coverage.pl -- Coverage analysis tool
      • hashtable.pl
      • prolog_codewalk.pl
      • prolog_metainference.pl
      • prolog_wrap.pl
      • tables.pl
      • increval.pl
      • check.pl
      • files.pl
      • system.pl -- System utilities
      • macros.pl
      • edit.pl
      • quintus.pl
      • prolog_jiti.pl
      • prolog_trace.pl
      • writef.pl
 valid_term_position(@Term, @TermPos) is semidet
Check that a Term has an appropriate TermPos layout. An incorrect TermPos results in either failure of this predicate or an error.

If a position in TermPos is a variable, the validation of the corresponding part of Term succeeds. This matches the term_expansion/4 treats "unknown" layout information. If part of a TermPos is given, then all its "from" and "to" information must be specified; for example, string_position(X,Y) is an error but string_position(0,5) succeeds. The position values are checked for being plausible -- e.g., string_position(5,0) will fail.

This should always succeed:

read_term(Term, [subterm_positions(TermPos)]),
valid_term_position(Term, TermPos)
Arguments:
Term- Any Prolog term including a variable).
TermPos- The detailed layout of the term, for example from using read_term(Term, subterm_positions(TermPos).
Errors
- existence_error(matching_rule, Subterm) if a subterm of Term is inconsistent with the corresponding part of TermPos.
See also
- read_term/2, read_term/3, term_string/3
- expand_term/4, term_expansion/4, expand_goal/4, expand_term/4
- clause_info/4, clause_info/5
- unify_clause_hook/5